Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=67.231.152.168 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796211847; b=EOsRddkah/U/rfOgmHfB05S0tImPduCQuc/h7uq2Vcakv91FiiKVT+YxRA18xgcpozqT twmSWCEAcMsOGVBmisHLqDmEO1Y0Fu8wgBddXiyXw0H5zpG8GxBgIP3uX3hR1JUVRXCTa 8IP1g2QctJj2gTiaqZbXALoTFZ45W/KFtBX0lN3YYYzWz+wC+5KWz6q/wx5K/rEz5xqKS A1AFfsGqW3TNQTVjal/F2QxW3HHJqNUys8JhER0+pW+qFDr+pj681IMeT1YD7TGiZRlft QfYxKgN12Hic3koCb8Q+fqkjcpJ/5AC3r4O+m8UZ6AvU3FcN+XbZtfCQ4lvoK3MP3/w== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796211847; h=DMARC-Filter:Received:DKIM-Signature:Received:DKIM-Signature: Received:Received:X-MS-Exchange-Authentication-Results:Received-SPF: Received:Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding: X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:Content-Type: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-OriginatorOrg:X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info: X-Proofpoint-Spam-Details-Enc:X-Authority-Analysis: X-Proofpoint-Spam-Reason; bh=v6lSwX5sBVpMFB3kl5Vbg+kzedzfpoeT6xK0Hlah1xI=; b=JH977/QK2RJ2kHZH/RiTu6dq9Cvh2o1kKFliGocwRffLnVwEoKWgAj9UFTtaHpUummmH aWlgK0as3POUvkdgWSzbWtsKVw4uSWaXKvzy8p/HTEv2SMVPiyJzZmrne/dvDOobdT+4L VjV5S0jsv8YYWFWZr93w4g/QVYfF7c58H5yVnv3yQAQjsa0BT/DyxjZH83dBV3ua2lkD8 DKAmkWxrESkYOYiVnxJ1vyarHXAyaql5PVsbDs8B+j8aDmMjI3zF/HzF8d2kyi1/HfBk4 BB3DixWb9kYJFK85flBeENPPrKX2LNZrIrKCQn4FPWgQP4mE4qyLnoNhPrgtbyf98mw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=f1Xfzi9J; dkim=pass header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-cirrus4-onmicrosoft-com header.b=eznlgWcX; arc=pass header.oldest-pass=0 smtp.remote-ip=67.231.152.168 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF7CB606A323; Wed, 2 Dec 2026 11:44:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DF7CB606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=f1Xfzi9J; dkim=pass (1024-bit key, unprotected) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-cirrus4-onmicrosoft-com header.b=eznlgWcX Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B29C522151092; Wed, 2 Dec 2026 05:43:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=PODMain02222019; bh=v6lSwX5sBVpMFB3k l5Vbg+kzedzfpoeT6xK0Hlah1xI=; b=f1Xfzi9JZj0G1iJVGCkXDS6VXaDUeSWd 6nvMnpbq5SDHHNZr5npk781VLayZpuYyjrNYXrwQEUWHyWkRUTmmgCRL9ISic/02 nPhMWST9kpi99S8QpDyT2+RMgkhQBjc46Nrvh4m7FyKfL7nwCYQB1Z3ssS1NDut3 Uca1+Pk83g4GCPLRcqKLchP0daEFuY4xOmFwAqrTiNxgBGFLWDDhG5DnDPlNufev cjzPS+lQT66f8tZm+xJMVh15mQGAZuFAT0hXRbVliGUtiRuz1oH1vIpn84vdjf1t qha92L/Ae/jojJfIvry0JOjnG3SY0wnVUcr+11geB57d9hKKfNL0zA== Received: from bn8pr05cu002.outbound.protection.outlook.com (mail-eastus2azon11021132.outbound.protection.outlook.com [52.101.57.132]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 4ja81fgs5k-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 05:43:52 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F3Ou5uT6rNLm4OHdeRzPjA2aOyBk2y9Ao6ec1YGot42Ya8R7SGW+O6JwfQ1HsH0zumjufvtUxQKZ/UcG+0D7ce1LHCajlUDlc+4MWrwPWQTEFHCI78oQP0eICn27cILkTZVcvmaklVYui+DpdEI55kiGnMJm6ADhGht3ndrEnr03VzgSBxoUUrjqKs/xV/LKZ9xyDmgpPEHQEhd3PZ4VXu+vAELU/yC6dGLYJPlqgTqWk2c7eHEO2nUUvX2qTSmQuu4iCkQ3+SOu83SGHnPIcVALC5Ue5fNRg0dehzxSVE+aeHHh+tJ12u8bTSyz0+7FY/0g/GCZfhZjSkP3wLaTbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v6lSwX5sBVpMFB3kl5Vbg+kzedzfpoeT6xK0Hlah1xI=; b=L9gOg2+dOEsOygJwoJnDd5qUWWxvPO7iXBdRuJz4ckdo1Czci9V5khj/pBuN8Q60l7YiRkLZh/kEkpVyjcLqEHkHyXyqPuCK5dLV9NS3f9EnZjoKB/UAmds2SoGUD9EhsrXB7sIeUrhxiGWYvx38CPcM/okod/C6hPf2acwiVcA49pg82JdmRA+r1StSda9QcqfdmiHRbRNB/Ljdz5YGaQPefz4UxsPZaBW+6Ap+YjUS0IxwXOCHXwBSnOQ4ganc3rx5IFbXS9zUXEox1Gua2c+FjPjW12Ozv1ycEroEWerbOVRYNYQS+sMCU/vWA1mPMqYrlK5jJr4HiJJY0K/DPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v6lSwX5sBVpMFB3kl5Vbg+kzedzfpoeT6xK0Hlah1xI=; b=eznlgWcX5Dbdeqo6WKrO2fCXpZDbIZAOhNDkxJwM93yvHnVbh+8ffquj/UVmBETnDlnIPC7XSHtKykJChdF7U8HOu/+yr9E+/xO257YBxYfVRTDTvCcKT1MuQByU4kfM0U1nWzRkw9CAKw2XVlvCA49+y9iDOs7gagPTxWgMLuM= Received: from BLAPR05CA0020.namprd05.prod.outlook.com (2603:10b6:208:36e::23) by SA0PR19MB4572.namprd19.prod.outlook.com (2603:10b6:806:b9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 11:43:46 +0000 Received: from IA0PEPF00000039.namprd03.prod.outlook.com (2603:10b6:208:36e:cafe::8e) by BLAPR05CA0020.outlook.office365.com (2603:10b6:208:36e::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.709.5 via Frontend Transport; Wed, 2 Dec 2026 11:43:45 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=softfail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by IA0PEPF00000039.mail.protection.outlook.com (10.167.249.70) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 11:43:44 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 5F7AA406540; Wed, 2 Dec 2026 11:43:33 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.12]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 5159982024C; Wed, 2 Dec 2026 11:43:33 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org, tiwai@suse.com Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH] ASoC: cs35l56: Add module parameter to allow factory calibration Date: Wed, 2 Dec 2026 11:43:33 +0000 Message-ID: <20261202114333.816138-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PEPF00000039:EE_|SA0PR19MB4572:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0db2d1ac-ffc0-432b-c15d-08df50698511 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|61400799027|376014|23010399003|82310400026|16102099003|56012099006|261021123027099003|261026140227099003|261021121427099003|261102123227099003|261028144727099003|261102130727099003|10067099003|261026121527099003|261022105027099003|261022075727099003|261009223027099003|11063799006|18002099003; X-Microsoft-Antispam-Message-Info: qkVz69hPDJnA1/Ru38lnJAO+LLPm+aL3Wl71jhqmbXujl68H+AxjfbP/faooX1XlFyMBWnFnlaWLAESHQW/plQGOxq0vIl6i/4BLtSjoFA8Ao7Xl9ZVfGsG812zxIcXBgmwC/O6vzf800H0x4X9aidga9y03uBA/QWo+Z/pTqKycdnQHJtcCUdikhaKenkg8X/R6B/EY2Gfr4DWp/LRn+tngCnKtgYcIYeryoOLoENjk2kDzoZtRK8rQdViW5NOj0XZiOcIJksx8S+FOtdwst/GsnFg74Mn/s35JxYm1Wr8UpKvKjBa8Qua2Uart9wkDEknu/r29xap/NzJu38KJQBQZg64Ki1SvHkk/wgIr39X4pCQzATHdRl1v16bmZ1k7Oi0Bh6W1qHaL/haP3S1a0E5E2UHmmgQYbSJVJzbHyRg0gWi16rrZ1Sq1+Tt8qYAgkO0B7ToRs8AeLEIir3JYMLAJkvAyUEZjNbWCNyUVRx+r7Q9mcnmD8w7nfMvS4nkT1bXFX7j/37249ckGoffBTlA9QRr9HMkNAL8bZJM8pnIPkTkrr5LXP7OLb4dyXO+TXNLzK9tCyONHFJ4lqITjkR87CKSq8YxKnbbgZh8DeaK4g/TRjYdSt/vYCHFxGneBhvroJQFi2Lp/PugG+zbkrcZlx3yc1aYAqpniUjOH8zx2qA3BHwoPlabCPB8Qv4Ezlw41TpS298FbdLy0SYEsxQ== X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(61400799027)(376014)(23010399003)(82310400026)(16102099003)(56012099006)(261021123027099003)(261026140227099003)(261021121427099003)(261102123227099003)(261028144727099003)(261102130727099003)(10067099003)(261026121527099003)(261022105027099003)(261022075727099003)(261009223027099003)(11063799006)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5sJYYQ/nqZvzseY3UaZZLsoTVO7cxgzsU9pXZyY6Y6smVJ0uSNpBLq4B8uABpd3FAs3TfLXgcl1+ObYnOuKb2jgmOZEV2130l4UPB1zhpvs8NgMriizE8kDOTWtey+qqvb5QbqKpzODLFxQ2gAQBeHnZzSTAH1zyiKuWHdep1TfUbKXLFXGW9VJb1pdtuyJ2bDppQueMThZ91Kl6utiz33GTY1iD5r62n32Fs1UEYa8lvxgwG4zYEMHG93qPpteVyA1vyCeXZUY3iXYkctm6QSDBtqeIZ+/xsqV52kfYyan1k/3DLKfjyYpBdTntYD5yizM1WQV6gXvOtXUW5FV4BPNtXnoJZhQ2DFBO7OD1bbXmx/GyONL3sxSfcodx3JeGj1InzFtfWdU+5lmo3FFzczXUxfpnzCfIrJVrpfQluzQDAEfCFotqdgzC5vvJavmX X-Exchange-RoutingPolicyChecked: ZEask/zGHCthKW2fZzrjMg/I0jvh4Pb+93l0ZmE8F+11w8/w3wDXyWteurWvs9ZlNTfG2k4DJ00b5Hg5/J3UrtOSDo90oT01UBFMGoDQBy2JHMtxIKW1xGOCY67xMve/HUL8nHB/d3zJKBVAHPXr/RBoDMEu9tB8j7/XHxExVejku88wDlHOOGZfvfijJ4rP4voOSFp6oU2X1oci8SVKU/cZ+roUh0rdj4yMMCAwuZn+MXNNw5wDhbNvXJtddqX01rWHS/Oo4gQiW30hmfbU9esOx1p4kWHW/wubf2q8UlpEb7i6lFGvm9BstBmMJautwagkPaqGJCTG/wOilTR0yg== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 11:43:44.2165 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0db2d1ac-ffc0-432b-c15d-08df50698511 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-IA0PEPF00000039.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR19MB4572 X-Proofpoint-GUID: pZjDJ0j3N9_begqBDrhd_WtYHtMRs97C X-Proofpoint-ORIG-GUID: pZjDJ0j3N9_begqBDrhd_WtYHtMRs97C X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA0NiBTYWx0ZWRfXzLOCgCaC4nmQ E8yjPUBaOOft4Yq/XtYcmUxDovhFjOjzYIQ80QbfImP7tR+UChZNcbAQ8L19lFhWsfvOR+aM6RB ajcnjKpemFmY9GUeLFx669R9pAx8PB8= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA0NiBTYWx0ZWRfX8ylhTp+KNibm EA14dYNB4xTr8kA7strwxU9iuTOuAdYN1r8m+G2ZstjXVD8djttcGG/Lbzg0Lfxd2Extax/ngK6 fe96f31GG0CJpRnK53K/zRJt9gToE88kf5R1D13w68wOy0JT9DJ2/lV9JmOfMRJV6yAg7T+OYez q50mPiGQIP0nAg0ZIgOVDu2DswYo3t9zQ5RUxgSk8wIUXniyd6XDVWuY2aH4ZFqkuduIVD69gSJ mXb1gLVnUzmZAjUGJ9F9imLAg8VKZrtXUVs0fuCewK0DGGsObAuOg6MGYQKK798vc7Yj/iySiDx wGZekAOV0wVji87FE5SODfWCAgY5B6QXAnU40DZFRRU0EiyPyI5oPnpa5sAGCQmOGQ50+BjskHu djtZs7SQBhq8YIB8u2B/pW9G1I9Xmcaayp6uODbJFntQ1I2Scy1I3Y1jwngaEPCiL8ke9bmZ8lu gX57P6OnZmv54MTeeGA== X-Authority-Analysis: v=2.4 cv=S7xMU4sP c=1 sm=1 tr=0 ts=6b100478 cx=c_pps a=JvsELR4xF/cD9QySNJCEFQ==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=pUM-KoujPXoA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=KfkQE9S9VqCBgivYGm0O:22 a=w1d2syhTAAAA:8 a=lLbJOjpSodZss-Xg-dEA:9 X-Proofpoint-Spam-Reason: safe Always build the calibration debugfs support into the driver, but only create the debugfs files if the new module parameter 'allow_factory_cal' is true, or the existing CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS Kconfig is enabled. This allows manufacturers to perform factory calibration on the production line without the need to build and install a custom kernel. If the kernel has been built with CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS, the module parameter can be forced to 0 to disable calibration. A small change is needed to the Kconfig for the HDA driver to delete the select of SND_SOC_CS35L56_CAL_DEBUGFS_COMMON, as that Kconfig symbol is now removed. The CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS Kconfig is retained to prevent changing the behaviour of existing downstream products that depend on it enabling the debugfs. Factory calibration is disabled by default to prevent accidental use of this feature in non-factory conditions, which could result in the speakers being under-protected. Signed-off-by: Richard Fitzgerald --- Takashi/Mark: There is a trivial change to the Kconfig for the HDA driver. We don't have any other changes planned to that Kconfig so should be safe to take this patch through the ASoC tree. sound/hda/codecs/side-codecs/Kconfig | 1 - sound/soc/codecs/Kconfig | 6 ------ sound/soc/codecs/cs35l56-shared.c | 15 --------------- sound/soc/codecs/cs35l56.c | 6 +++++- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/sound/hda/codecs/side-codecs/Kconfig b/sound/hda/codecs/side-codecs/Kconfig index b7e2a6fa4258..3c36c82fe0a7 100644 --- a/sound/hda/codecs/side-codecs/Kconfig +++ b/sound/hda/codecs/side-codecs/Kconfig @@ -116,7 +116,6 @@ menu "CS35L56 driver options" config SND_HDA_SCODEC_CS35L56_CAL_DEBUGFS bool "CS35L56 create debugfs for factory calibration" depends on DEBUG_FS - select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON help Create debugfs entries used during factory-line manufacture for factory calibration. diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index c353c54465d3..169427d43898 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -911,16 +911,12 @@ config SND_SOC_CS35L56_SDW help Enable support for Cirrus Logic CS35L56 boosted amplifier with SoundWire control -config SND_SOC_CS35L56_CAL_DEBUGFS_COMMON - bool - menu "CS35L56 driver options" depends on SND_SOC_CS35L56 config SND_SOC_CS35L56_CAL_DEBUGFS bool "CS35L56 create debugfs for factory calibration" depends on DEBUG_FS - select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON help Create debugfs entries used during factory-line manufacture for factory calibration. @@ -929,7 +925,6 @@ config SND_SOC_CS35L56_CAL_DEBUGFS config SND_SOC_CS35L56_CAL_SET_CTRL bool "CS35L56 ALSA control to restore factory calibration" - select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON help Allow restoring factory calibration data through an ALSA control. This is only needed on platforms without UEFI or @@ -942,7 +937,6 @@ config SND_SOC_CS35L56_CAL_SET_CTRL config SND_SOC_CS35L56_CAL_PERFORM_CTRL bool "CS35L56 ALSA control to perform factory calibration" - select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON help Allow performing factory calibration data through an ALSA control. It is recommended to use the debugfs method instead diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c index 329351de32b1..f7374afb7097 100644 --- a/sound/soc/codecs/cs35l56-shared.c +++ b/sound/soc/codecs/cs35l56-shared.c @@ -1084,9 +1084,6 @@ ssize_t cs35l56_calibrate_debugfs_write(struct cs35l56_base *cs35l56_base, char buf[11] = { 0 }; int num_amps, ret; - if (!IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS_COMMON)) - return -ENXIO; - if (*ppos) return -EINVAL; @@ -1139,9 +1136,6 @@ ssize_t cs35l56_cal_ambient_debugfs_write(struct cs35l56_base *cs35l56_base, unsigned long val; int ret; - if (!IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS_COMMON)) - return -ENXIO; - if (*ppos) return -EINVAL; @@ -1170,9 +1164,6 @@ ssize_t cs35l56_cal_data_debugfs_read(struct cs35l56_base *cs35l56_base, char __user *to, size_t count, loff_t *ppos) { - if (!IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS_COMMON)) - return -ENXIO; - if (!cs35l56_base->cal_data_valid) return 0; @@ -1188,9 +1179,6 @@ ssize_t cs35l56_cal_data_debugfs_write(struct cs35l56_base *cs35l56_base, struct cirrus_amp_cal_data cal_data; int ret; - if (!IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS_COMMON)) - return -ENXIO; - /* Only allow a full blob to be written */ if (*ppos || (count != sizeof(cal_data))) return -EMSGSIZE; @@ -1210,9 +1198,6 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_cal_data_debugfs_write, "SND_SOC_CS35L56_SHARED"); void cs35l56_create_cal_debugfs(struct cs35l56_base *cs35l56_base, const struct cs35l56_cal_debugfs_fops *fops) { - if (!IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS_COMMON)) - return; - cs35l56_base->debugfs = cs_amp_create_debugfs(cs35l56_base->dev); debugfs_create_file("calibrate", diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c index 0ea8c69d93fc..34588245a8f3 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -43,6 +43,10 @@ #include "wm_adsp.h" #include "cs35l56.h" +static bool cs35l56_allow_factory_cal = IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS); +module_param_named(allow_factory_cal, cs35l56_allow_factory_cal, bool, 0444); +MODULE_PARM_DESC(allow_factory_cal, "Enable support for factory calibration"); + /* * snd_soc_register_component() can call component_probe() on all instances * in a card, so deferred registration must be protected across all instances. @@ -1532,7 +1536,7 @@ static int _cs35l56_component_probe(struct snd_soc_component *component) if (ret) return ret; - if (IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_DEBUGFS)) + if (cs35l56_allow_factory_cal) cs35l56_create_cal_debugfs(&cs35l56->base, &cs35l56_cal_debugfs_fops); queue_work(cs35l56->dsp_wq, &cs35l56->dsp_work); -- 2.47.3