From nobody Sat Feb 7 18:55:37 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3946019E7F9; Thu, 16 Oct 2025 13:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760619856; cv=none; b=tu2vs7FUB/57becCV5rpn+urn6dOzacHSiHpQtWnz3kMJT7xAYB7N40hxP8e6Snn0offN9WbZcYuYCFYB90l3leNtb6wV4ppWjjxGqPRZqL5ZDOm+KDWv98EhHgxQ8ey8L2RBeu3EulHXAndjbMhPHb9LsnKBkSkNFk87a3VLX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760619856; c=relaxed/simple; bh=QReg2vp97BUkr6fGoaX3HVTBKM4wAz/0LebQasrMhpw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ldrJJjX6VxCfNYmpfdIlKgstLuYyWnJHfyRkbgl8Rrz39/rbfXPoGI24mjhheSBH+Xp77MaBwxOtZUFWpm1jG92qiud4rZp0rW1OznogpyPMmAjfzRAQ2/mJyY/MOAxw6kDpIiHmH9ucpg/u0Ma5T0e9SzdGWfUQPMd9qveOabM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=mFngzCWQ; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="mFngzCWQ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 64C991A1429; Thu, 16 Oct 2025 13:04:12 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 39C4B6062C; Thu, 16 Oct 2025 13:04:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id BDD77102F22EF; Thu, 16 Oct 2025 15:04:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760619851; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=xjCaRMRjVPxm5y+Ak8E+acuNrbc32ytUH8e92tM/4FA=; b=mFngzCWQYfGixlbS21zV34AGh8gfnhdomnXyf160lglJWjQXIQtRjcsCVB2RaAW5gt5SMU kZca+FEXkN5PzDeH+0T9MO8d7CKHHEKIIYT1Tgo+JmR3qgBugv5K2bZOrnk97rm73y3qsq LQQU7oyqzZD3GrBcWNM3+qHwmyOduKRZ6H/OsVzpFBOsqFJmZIwr+FokdYwrE7ErKy8nBk 1e9iekLQ3IMC/28Qxpt3dlDMPD7LgJOjHeTz6Lynvt4DMEJyA4Sz0hyCMBfX5Dh8LrZSD1 eshHBrzqZ8q0+SggSYnYURVONhDgK8/bWAdDtSO/RVSAmGY0GkgdgFLtlutxZA== From: Herve Codina To: David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alexander Sverdlin , Nikita Shubin , Axel Lin , Brian Austin Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Herve Codina , stable@vger.kernel.org Subject: [PATCH 1/3] ASoC: cs4271: Fix cs4271 I2C and SPI drivers automatic module loading Date: Thu, 16 Oct 2025 15:03:37 +0200 Message-ID: <20251016130340.1442090-2-herve.codina@bootlin.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251016130340.1442090-1-herve.codina@bootlin.com> References: <20251016130340.1442090-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" In commit c973b8a7dc50 ("ASoC: cs4271: Split SPI and I2C code into different modules") the driver was slit into a core, an SPI and an I2C part. However, the MODULE_DEVICE_TABLE(of, cs4271_dt_ids) was in the core part and so, module loading based on module.alias (based on DT compatible string matching) loads the core part but not the SPI or I2C parts. In order to have the I2C or the SPI module loaded automatically, move the MODULE_DEVICE_TABLE(of, ...) the core to I2C and SPI parts. Also move cs4271_dt_ids itself from the core part to I2C and SPI parts as both the call to MODULE_DEVICE_TABLE(of, ...) and the cs4271_dt_ids table itself need to be in the same file. Fixes: c973b8a7dc50 ("ASoC: cs4271: Split SPI and I2C code into different m= odules") Cc: stable@vger.kernel.org Signed-off-by: Herve Codina --- sound/soc/codecs/cs4271-i2c.c | 6 ++++++ sound/soc/codecs/cs4271-spi.c | 6 ++++++ sound/soc/codecs/cs4271.c | 9 --------- sound/soc/codecs/cs4271.h | 1 - 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/cs4271-i2c.c b/sound/soc/codecs/cs4271-i2c.c index 1d210b969173..cefb8733fc61 100644 --- a/sound/soc/codecs/cs4271-i2c.c +++ b/sound/soc/codecs/cs4271-i2c.c @@ -28,6 +28,12 @@ static const struct i2c_device_id cs4271_i2c_id[] =3D { }; MODULE_DEVICE_TABLE(i2c, cs4271_i2c_id); =20 +static const struct of_device_id cs4271_dt_ids[] =3D { + { .compatible =3D "cirrus,cs4271", }, + { } +}; +MODULE_DEVICE_TABLE(of, cs4271_dt_ids); + static struct i2c_driver cs4271_i2c_driver =3D { .driver =3D { .name =3D "cs4271", diff --git a/sound/soc/codecs/cs4271-spi.c b/sound/soc/codecs/cs4271-spi.c index 4feb80436bd9..82abc654293c 100644 --- a/sound/soc/codecs/cs4271-spi.c +++ b/sound/soc/codecs/cs4271-spi.c @@ -23,6 +23,12 @@ static int cs4271_spi_probe(struct spi_device *spi) return cs4271_probe(&spi->dev, devm_regmap_init_spi(spi, &config)); } =20 +static const struct of_device_id cs4271_dt_ids[] =3D { + { .compatible =3D "cirrus,cs4271", }, + { } +}; +MODULE_DEVICE_TABLE(of, cs4271_dt_ids); + static struct spi_driver cs4271_spi_driver =3D { .driver =3D { .name =3D "cs4271", diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index 6a3cca3d26c7..ff9c6628224c 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c @@ -543,15 +543,6 @@ static int cs4271_soc_resume(struct snd_soc_component = *component) #define cs4271_soc_resume NULL #endif /* CONFIG_PM */ =20 -#ifdef CONFIG_OF -const struct of_device_id cs4271_dt_ids[] =3D { - { .compatible =3D "cirrus,cs4271", }, - { } -}; -MODULE_DEVICE_TABLE(of, cs4271_dt_ids); -EXPORT_SYMBOL_GPL(cs4271_dt_ids); -#endif - static int cs4271_component_probe(struct snd_soc_component *component) { struct cs4271_private *cs4271 =3D snd_soc_component_get_drvdata(component= ); diff --git a/sound/soc/codecs/cs4271.h b/sound/soc/codecs/cs4271.h index 290283a9149e..4965ce085875 100644 --- a/sound/soc/codecs/cs4271.h +++ b/sound/soc/codecs/cs4271.h @@ -4,7 +4,6 @@ =20 #include =20 -extern const struct of_device_id cs4271_dt_ids[]; extern const struct regmap_config cs4271_regmap_config; =20 int cs4271_probe(struct device *dev, struct regmap *regmap); --=20 2.51.0 From nobody Sat Feb 7 18:55:37 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E9241A2398 for ; Thu, 16 Oct 2025 13:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760619858; cv=none; b=W0u9vuy0kQVFMz9i8Lt7CBhaC2pc67FVIQY7Wy8I8iDnU1jBTt94nz0OLkyWqk2hI0Ep3wbHzmP/Zx03xPziCFuH0C42HflAs+M94KRw3VI7WUq6wkELhr8qL9NHChqSPOysBXN+bV/bqJBD11OXmXb0VldCLmgUxDVXuT8ktcg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760619858; c=relaxed/simple; bh=pT9rQgKll8jmWS4orI3/Yt4belu5XsXdLKl4a9KPSBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SZa6HoGffRkuCm7yVcS4cICq0xHd+ZWPy8stJs1WS73upNM36RVqGvMOJM4il5lLT5FUvrmU5nr2E52KoRZmlpSABb2z+mkGYIyAh4U5GciRf0rYoD4R+D+/74P9I9xrvXSTL3Pr0vRdh1ITooFbxl2xwPqUd7+UHotb6QV/DbY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=S98R/FuY; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="S98R/FuY" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 0EF10C041CD; Thu, 16 Oct 2025 13:03:55 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 428856062C; Thu, 16 Oct 2025 13:04:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B1C85102F2309; Thu, 16 Oct 2025 15:04:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760619853; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=uoDF+HIilfVMcll1NHENrGFL0ZTm+xsdbcPT8m/QM8M=; b=S98R/FuYBCgboDW/7GMSIicVwXIUKDKfFZWqNdIRE0xHLTv8Lt08JGGgVpC2odcuUo7N7o SnAcNRA4bsuiTcfwLg76rO7wOR0pB0MSTdnyYteQvWHxnsnnKoRwy2AnbI2+nAn8mfqVWp 5X0Po1AjtC90zJNcHHLs3Leyo1BPXekKaRMe7dGnoU0ts0ojkxq99NxRdgmwQ88V6y40Hp WFvQ6M+CZz8etB8CERkLpteLsTihT7IEL5n1AQEFsjk491DU0uN1W44Zjg0bCtYSE63360 cZcF7tr0LndgMbWOjJyMEpzK1lzPEdFOn/pyvV9pLbhgnQ8Jk/VMMYEVmzQR2g== From: Herve Codina To: David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alexander Sverdlin , Nikita Shubin , Axel Lin , Brian Austin Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Herve Codina Subject: [PATCH 2/3] ASoC: dt-bindings: cirrus,cs4271: Document mclk clock Date: Thu, 16 Oct 2025 15:03:38 +0200 Message-ID: <20251016130340.1442090-3-herve.codina@bootlin.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251016130340.1442090-1-herve.codina@bootlin.com> References: <20251016130340.1442090-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The Cirrus CS4271 codec can use an external clock as an input Master Clock. When no crystal is used, the CS4271 component considers its MCLK pin as an input pin and expects the external clock connected to provide the Master Clock. This clock is not documented in the binding. Add the missing clock. Signed-off-by: Herve Codina Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/sound/cirrus,cs4271.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/cirrus,cs4271.yaml b/D= ocumentation/devicetree/bindings/sound/cirrus,cs4271.yaml index 68fbf5cc208f..d286eb169915 100644 --- a/Documentation/devicetree/bindings/sound/cirrus,cs4271.yaml +++ b/Documentation/devicetree/bindings/sound/cirrus,cs4271.yaml @@ -25,6 +25,16 @@ properties: reg: maxItems: 1 =20 + clocks: + items: + - description: + Master clock connected to the MCLK pin if MCLK is an input (i.e.= no + crystal used). + + clock-names: + items: + - const: mclk + spi-cpha: true =20 spi-cpol: true --=20 2.51.0 From nobody Sat Feb 7 18:55:37 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B91532D7F9; Thu, 16 Oct 2025 13:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760619859; cv=none; b=o0MO0hU4xixXzNaz9Z16eZoG17s3FnXcsPF/wHtyHNQ1FnFxbc3LCvFPsNwTI71dVBjZA0kpZPhDb4ay00EzlytS+O54pI1keMJ4HABduHB2Jjd4RWcUZLyevmRK/31Pr1GGzwGzXgot5RYPFUBwOnI9qRIrBT1eZDRF3iD8a10= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760619859; c=relaxed/simple; bh=Co5KuU+qAIZuiHL/bWuYupCgu6V+k3j8ZJmVSLCA1ec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gONR/P8D3QMILWUNcfbzX8fG4kyOKovG8ThCz2hX2EbLsbrAI+ZhEFarIkRQ6da/OEB7jXM25ZsHn4BbSrTCjQDdOHQ+swZlcQh57yQqCbQiZgn4iNDZnbcUzKWGyNzZdH0z/W/5+2GA4Fy2JaYP45qTo+kX7ED5gaf7yw/FnUQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=iQidPaz1; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="iQidPaz1" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 7B06AC041CE; Thu, 16 Oct 2025 13:03:56 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id AE15C6062C; Thu, 16 Oct 2025 13:04:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 70291102F230E; Thu, 16 Oct 2025 15:04:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760619854; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=3lP2zPTU9xBiuqJX81V4KyxoE+dPnxkHHBQsJkwfLuU=; b=iQidPaz1wmtCgZW4zp6DrvqXRLr6T6rLr+Q4rcnRXs6zNNSg885oGAUQBKh9uUnZ3YYI5j +6I7H5nqzr4eFRsV/dbOOnkPRWC9nU9XJi7TsGPsaINY5RSfZfCcVAEoWE+vYyF4/Y3ZV9 fUiXLys9iO3Q2DWLSt8ZfzhnXFWGpa40aJDi69chdq4VCmYAjYOtqfBAHYNX4gwmaqVMHE N9MkkqCAueJ4SpElOoyIw5gcvi8NPbw5mNn+/aGOVstiTL5XGlLbdh1KnfQRaWrkX79QVV aBcKKq4PVgXzizXbK2I53bXgGxKt3Mb0tvDfwCgcIBF7y6L/HC8YUuHNv0eSmw== From: Herve Codina To: David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alexander Sverdlin , Nikita Shubin , Axel Lin , Brian Austin Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Herve Codina Subject: [PATCH 3/3] ASoC: cs4271: Add support for the external mclk Date: Thu, 16 Oct 2025 15:03:39 +0200 Message-ID: <20251016130340.1442090-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251016130340.1442090-1-herve.codina@bootlin.com> References: <20251016130340.1442090-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The mclk (master clock) of the cs4271 codec can be an input clock. In this case the connected clock needs to be enabled outside of any audio stream. Indeed, this clock is needed for i2c communication. Add support of this clock and enable it before the first i2c transfer. Signed-off-by: Herve Codina --- sound/soc/codecs/cs4271.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index ff9c6628224c..481a2c20b7cf 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c @@ -10,6 +10,7 @@ * DAPM support not implemented. */ =20 +#include #include #include #include @@ -163,6 +164,7 @@ struct cs4271_private { /* enable soft reset workaround */ bool enable_soft_reset; struct regulator_bulk_data supplies[ARRAY_SIZE(supply_names)]; + struct clk *clk; }; =20 static const struct snd_soc_dapm_widget cs4271_dapm_widgets[] =3D { @@ -567,22 +569,36 @@ static int cs4271_component_probe(struct snd_soc_comp= onent *component) cs4271->enable_soft_reset =3D cs4271plat->enable_soft_reset; } =20 + ret =3D clk_prepare_enable(cs4271->clk); + if (ret) { + dev_err(component->dev, "Failed to enable clk: %d\n", ret); + goto err_disable_regulators; + } + + /* + * Be sure to have the clock and power-supplies stable before releasing + * the reset. + */ + fsleep(1000); + /* Reset codec */ cs4271_reset(component); =20 ret =3D regcache_sync(cs4271->regmap); if (ret < 0) - return ret; + goto err_force_reset; =20 ret =3D regmap_update_bits(cs4271->regmap, CS4271_MODE2, CS4271_MODE2_PDN | CS4271_MODE2_CPEN, CS4271_MODE2_PDN | CS4271_MODE2_CPEN); if (ret < 0) - return ret; + goto err_force_reset; + ret =3D regmap_update_bits(cs4271->regmap, CS4271_MODE2, CS4271_MODE2_PDN, 0); if (ret < 0) - return ret; + goto err_force_reset; + /* Power-up sequence requires 85 uS */ udelay(85); =20 @@ -592,6 +608,13 @@ static int cs4271_component_probe(struct snd_soc_compo= nent *component) CS4271_MODE2_MUTECAEQUB); =20 return 0; + +err_force_reset: + gpiod_set_value(cs4271->reset, 1); + clk_disable_unprepare(cs4271->clk); +err_disable_regulators: + regulator_bulk_disable(ARRAY_SIZE(cs4271->supplies), cs4271->supplies); + return ret; } =20 static void cs4271_component_remove(struct snd_soc_component *component) @@ -603,6 +626,7 @@ static void cs4271_component_remove(struct snd_soc_comp= onent *component) =20 regcache_mark_dirty(cs4271->regmap); regulator_bulk_disable(ARRAY_SIZE(cs4271->supplies), cs4271->supplies); + clk_disable_unprepare(cs4271->clk); }; =20 static const struct snd_soc_component_driver soc_component_dev_cs4271 =3D { @@ -637,6 +661,10 @@ static int cs4271_common_probe(struct device *dev, "error retrieving RESET GPIO\n"); gpiod_set_consumer_name(cs4271->reset, "CS4271 Reset"); =20 + cs4271->clk =3D devm_clk_get_optional(dev, "mclk"); + if (IS_ERR(cs4271->clk)) + return dev_err_probe(dev, PTR_ERR(cs4271->clk), "Failed to get mclk\n"); + for (i =3D 0; i < ARRAY_SIZE(supply_names); i++) cs4271->supplies[i].supply =3D supply_names[i]; =20 --=20 2.51.0