From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 E055E34DB7A for ; Wed, 17 Dec 2025 13:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979738; cv=none; b=hZi4GneJIV72HBE54apwCHyHNI5J1lqKMvsBJW9CySI+pAVhHvYWvQ5oC7qrCv8jX9SrOGjQmVOuqJizcowyXP+wbXJkn+DQA69jVUaiUdO7+5R4G7uHXF/FaPv63UhHJBLJbYYUs9B+UU9euvVPYUSoASwarwovaIaA+u/Lmsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979738; c=relaxed/simple; bh=uI48RSG+a+nSuEyywiQ6swM+axk120OhOUA8CnTh+yk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jn+fydiHIi12psDAYisaGPC3FO9ZyQcfoT6OYdWp8bMvAyfUo+5qwj6yhbdUXQeGs2lj12h6QkqRovfZmDq3B7m49oYRLDfpfq/IoMygsTjKkBn+GcGsyi0yXMxbU6Xr+DeO3WtMUba716/N8Ri+Qgzzjn6XODVjQypLZgoJZKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019B-Ae; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzQ-0067Ys-3C; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3SLS; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:51 +0100 Subject: [PATCH 01/11] ASoC: tlv320adcx140: invert DRE_ENABLE Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-1-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil Svendsen X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1278; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=WfOW2anrTgz/4XEyF51/kruoQkV8SVMulwmjlAzpc1c=; b=zTHm9wxvJRLhtaNf0abu1LNu43/5a0JNp7Pm6qDd5kPiMdJin2EnoYHuwtr1EvUBi3loEk5y0 lMuFBz2/hZnCX5OnSg1x3g//i8r2IjtUYJzIQK6YwMevAFeWWAsabBV X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil Svendsen Looking at section 8.6.1.1.69 in datasheets for both 5140 and 6140 (3140 doesn't support DRE). REG ADCX140_DSP_CFG1 BIT 3 field "DRE_AGC_SEL" it select either DRE or AGC. It states: * 0 =3D DRE * 1 =3D AGC The control is called "DRE_ENABLE" and for it to be true it has to be active low. This commit will invert the control so "DRE_ENABLE" is active low. Signed-off-by: Emil Svendsen Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index 443cf59cb71ab3e70f47c4395159752a0331b1ef..75e1007012a48a569586bc28964= 00e79ddce1c71 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -338,7 +338,7 @@ static const struct snd_kcontrol_new adcx140_dapm_ch4_d= re_en_switch =3D SOC_DAPM_SINGLE("Switch", ADCX140_CH4_CFG0, 0, 1, 0); =20 static const struct snd_kcontrol_new adcx140_dapm_dre_en_switch =3D - SOC_DAPM_SINGLE("Switch", ADCX140_DSP_CFG1, 3, 1, 0); + SOC_DAPM_SINGLE("Switch", ADCX140_DSP_CFG1, 3, 1, 1); =20 /* Output Mixer */ static const struct snd_kcontrol_new adcx140_output_mixer_controls[] =3D { --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 6DE00314A86 for ; Wed, 17 Dec 2025 13:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979733; cv=none; b=ny4LBzoLPz7MQ5rEfm/yZx6Wafp4eUT+fpNXOaxAkKBl440rIMuBG0B7Xmy3wBkp/1Q4QUBH7XVVXN4aKpLbB/ts6aQrRzEf+To0ZuNNCxe31kKZYmi1bVsO9x+RdPPgNXLmqPXbWnLTupm5WpoG/CbeClXchW0rKZhVl5LKzro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979733; c=relaxed/simple; bh=zPpdXJh32fTl/pow4D5Akokivv3EhcAmHbMnAg6Y7mk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IC0rQ1elgC6J7SSqZVUbS031atiKjH/uOu8cQ9r7n2UXhb1SKPcxEIbuo9YcWWs7DOKGImiPVDN69/VbIcw/GtwoIPP6OTsYOuFywf685yTb1aE99txo8TN5Y2ysb2h9cT1ULVO1UwAXaP3N8Y24Pewl0SqHFdxjLlWv26ds71s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019A-Ag; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzQ-0067Yr-3B; Wed, 17 Dec 2025 14:54:52 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3TDr; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:52 +0100 Subject: [PATCH 02/11] ASoC: tlv320adcx140: fix null pointer Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-2-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil Svendsen X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=4599; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=kXe/dgFdcFD3wr8yI0ZYTPwUBzycKle01oM0utMLno0=; b=mASLkyf2r4+++Rji8xl9SELvcrjt8wYwKM5P3eBVoJKP573Oi2rfJ7L93sx8WOKy4GJPQ/XI3 H0MAG8C6UDjCtJjRyKSXxVo11cLg2HXr/Oarmzs0GT9VLuVv7ejdyD3 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil Svendsen The "snd_soc_component" in "adcx140_priv" was only used once but never set. It was only used for reaching "dev" which is already present in "adcx140_priv". Kernel OOPS: [ 438.223704] Unable to handle kernel read from unreadable memory at virtu= al address 0000000000000018 [ 438.232776] Mem abort info: [ 438.235569] ESR =3D 0x0000000096000004 [ 438.239326] EC =3D 0x25: DABT (current EL), IL =3D 32 bits [ 438.244646] SET =3D 0, FnV =3D 0 [ 438.247764] EA =3D 0, S1PTW =3D 0 [ 438.250906] FSC =3D 0x04: level 0 translation fault [ 438.255788] Data abort info: [ 438.258669] ISV =3D 0, ISS =3D 0x00000004 [ 438.262509] CM =3D 0, WnR =3D 0 [ 438.265482] user pgtable: 4k pages, 48-bit VAs, pgdp=3D0000000046d3d000 [ 438.271929] [0000000000000018] pgd=3D0000000000000000, p4d=3D00000000000= 00000 [ 438.278731] Internal error: Oops: 0000000096000004 [#1] PREEMPT_RT SMP [ 438.278739] Modules linked in: veth md4 btnxpuart crc8 moal mlan iio_res= cale fsl_imx8_ddr_perf snd_soc_wisa_rx cfg80211 imx8m_ddrc ads7828 snd_soc_= tlv320adcx140 sr1xxDriver tsf ts5usba224 snd_soc_audio_graphs [ 438.278798] CPU: 1 PID: 64 Comm: kworker/u8:3 Not tainted 6.1.7-20231014= -1-rt5 #1 [ 438.278804] Hardware name: B&O mozart2 Seoul Rev c (UNKNOWN) (DT) [ 438.278809] Workqueue: events_unbound async_run_entry_fn [ 438.278823] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE= =3D--) [ 438.278829] pc : adcx140_pwr_ctrl+0x90/0xb0 [snd_soc_tlv320adcx140] [ 438.278845] lr : adcx140_pwr_ctrl+0x58/0xb0 [snd_soc_tlv320adcx140] [ 438.278861] sp : ffff800009b7bcd0 [ 438.278863] x29: ffff800009b7bcd0 x28: 0000000000000000 x27: ffff8000097= 31c58 [ 438.278870] x26: ffff000002365b74 x25: ffff000000102205 x24: ffff0000099= 5dba8 [ 438.278879] x23: 0000000000000000 x22: ffff000006d52080 x21: 00000000000= 00000 [ 438.278890] x20: 0000000000000060 x19: ffff000006c97480 x18: 00000000000= 00000 [ 438.278899] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000000= 00034 [ 438.278906] x14: 0000000000000000 x13: 0000000000000000 x12: 00000000000= 00001 [ 438.278914] x11: 0000000000000000 x10: 0000000000000a50 x9 : ffff8000086= 55f04 [ 438.278925] x8 : 0000c63716b3149c x7 : 0000000000001980 x6 : 00000000000= 00000 [ 438.278934] x5 : ffff800009014c60 x4 : 0000000000000000 x3 : 00000000fff= fff92 [ 438.278940] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 00000000fff= fff92 [ 438.278952] Call trace: [ 438.278954] adcx140_pwr_ctrl+0x90/0xb0 [snd_soc_tlv320adcx140] [ 438.278969] adcx140_set_bias_level+0x30/0x50 [snd_soc_tlv320adcx140] [ 438.278985] snd_soc_component_set_bias_level+0x2c/0x80 [ 438.278995] snd_soc_dapm_set_bias_level+0x60/0x1b0 [ 438.279000] dapm_pre_sequence_async+0x84/0xc0 [ 438.279005] async_run_entry_fn+0x38/0x150 [ 438.279010] process_one_work+0x1e4/0x490 [ 438.279016] worker_thread+0x64/0x410 [ 438.279021] kthread+0x128/0x130 [ 438.279032] ret_from_fork+0x10/0x20 [ 438.279041] Code: 95e38c64 a94153f3 a8c37bfd d65f03c0 (f9400ea0) [ 438.327685] read channel() error: -110 [ 438.327694] thermal thermal_zone4: failed to read out thermal zone (-110) [ 438.497842] ---[ end trace 0000000000000000 ]--- Fixes: 4e82971f7b55 ("ASoC: tlv320adcx140: Add a new kcontrol") Signed-off-by: Emil Svendsen Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index 75e1007012a48a569586bc2896400e79ddce1c71..3fb1b6251e6f8b361e8f82ce638= 1a7e8cfcd1935 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -23,7 +23,6 @@ #include "tlv320adcx140.h" =20 struct adcx140_priv { - struct snd_soc_component *component; struct regulator *supply_areg; struct gpio_desc *gpio_reset; struct regmap *regmap; @@ -699,7 +698,6 @@ static void adcx140_pwr_ctrl(struct adcx140_priv *adcx1= 40, bool power_state) { int pwr_ctrl =3D 0; int ret =3D 0; - struct snd_soc_component *component =3D adcx140->component; =20 if (power_state) pwr_ctrl =3D ADCX140_PWR_CFG_ADC_PDZ | ADCX140_PWR_CFG_PLL_PDZ; @@ -711,7 +709,7 @@ static void adcx140_pwr_ctrl(struct adcx140_priv *adcx1= 40, bool power_state) ret =3D regmap_write(adcx140->regmap, ADCX140_PHASE_CALIB, adcx140->phase_calib_on ? 0x00 : 0x40); if (ret) - dev_err(component->dev, "%s: register write error %d\n", + dev_err(adcx140->dev, "%s: register write error %d\n", __func__, ret); } =20 --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 317D634F278 for ; Wed, 17 Dec 2025 13:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979743; cv=none; b=Ayjcp8Bv75gkSzgAra7YMFSjUyeRiEup6eqyxdY0QvzBgJ80F7B4E6l5kYoDdZmiUTL+LpHthsuHuxdpeo5cVm5zsLcvJ4lD7vH+6xB/BXc1GNDbLbR1RNv5+HNl2ma5pTpOgg5M/yq5lVSKVzwGpFQNWSZ+JGhnFojjf+/XJ9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979743; c=relaxed/simple; bh=KIVZf9eQsEe24xzKqF2imdi5YUmFlNEbdV3+FMOkKwE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u5WYurl6dJlG997nAyZjmp4pHwg4A8NJxmN8KuS3cC5zb+ix/W5V2hvYz8fSJ1E+nlSR+7yUu5TgDma9B3TaaojyEddI+AHM0AwXMIKAqj7bUcV80pUUw+zmT3EVoTLODZdckCwCO7Xm73yomgbtF+YdjDsuiC75xVa7A77Ucg8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019E-Aw; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzR-0067Yu-08; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3U9J; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:53 +0100 Subject: [PATCH 03/11] ASoC: tlv320adcx140: Propagate error codes during probe Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-3-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Dimitrios Katsaros X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1285; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=PpAmR8wKqRTX1YV1R8fVM7vj/FkNO/cKPTJr6ncyO00=; b=Lmsr373tVsUPXJXaGvQZv99Z8QpPFjlDFtShSLA+VZS/trGASkNcumkV6pvm6/9fBy0dl9vVK A17congPgMrCHuBPmCnQtJn/6bzNzaYFniJ425lxP10TgYuc1BgRMO8 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Dimitrios Katsaros When scanning for the reset pin, we could get an -EPROBE_DEFER. The driver would assume that no reset pin had been defined, which would mean that the chip would never be powered. Now we both respect any error we get from devm_gpiod_get_optional. We also now properly report the missing GPIO definition when 'gpio_reset' is NULL. Signed-off-by: Dimitrios Katsaros Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index 3fb1b6251e6f8b361e8f82ce6381a7e8cfcd1935..58a6dfa228cc326d18b3c3f1267= 32033749c8e49 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -1154,6 +1154,9 @@ static int adcx140_i2c_probe(struct i2c_client *i2c) adcx140->gpio_reset =3D devm_gpiod_get_optional(adcx140->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(adcx140->gpio_reset)) + return dev_err_probe(&i2c->dev, PTR_ERR(adcx140->gpio_reset), + "Failed to get Reset GPIO\n"); + if (!adcx140->gpio_reset) dev_info(&i2c->dev, "Reset GPIO not defined\n"); =20 adcx140->supply_areg =3D devm_regulator_get_optional(adcx140->dev, --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 CF10133BBA9 for ; Wed, 17 Dec 2025 13:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979732; cv=none; b=cNa04xVCOxtXO1vVTh1BC9El/4wEKFdrwKsaIejOwoF0tTnqr7ep6FT1RGIV9QEA9YoFmLer1QgZ5iNEgqW+JI5IJDGqCvHe+Y+zMC2CYeA16/qme4TioF1a8sDzXcLuUPQ7+sUkIN8ZxAJTPKLQ20mOV+nZGX/dlpw4bI/snEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979732; c=relaxed/simple; bh=VZx0u1LV4OE/RGQRohcWYqHEcQkYI+lNdynE0cp27ZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JpphtrdvNfJW3Dsiy/Nr7hLqU2WCyHP5ETgFubeqt3HeSvVDBR6J/ul0rh/N4ihe5h8Bnh4edYr3aCR5+/q1NG0b0EWoBpfLG0V/n3bFtoPimY7fizeesKOYgdi0DGSde8URz/YH/KK6z4LfOkha5rY2tEXA89vmXG+rqOSm0C4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019H-Ah; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzR-0067Yv-08; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3Vgt; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:54 +0100 Subject: [PATCH 04/11] ASoC: tlv320adcx140: fix word length Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-4-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil Svendsen X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1458; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=v43nJHLbOeXsx5JJSDE5Vevx6RwD4qkqiA+EJyAWPpo=; b=WRUNF464xmJdu8VeEEquvRASqbNE0UeFwYngH41I8RR0w7bHiPzmCUF/zDuss1P1cze3E+lbH GZiN3DVX4J9D9kQRpaqzQYffS5sG6A9uVmY1CprXbXPdZC1dwii4Lvc X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil Svendsen The word length is the physical width of the channel slots. So the hw_params would misconfigure when format width and physical width doesn't match. Like S24_LE which has data width of 24 bits but physical width of 32 bits. So if using asymmetric formats you will get a lot of noise. Fixes: 689c7655b50c5 ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec dri= ver family") Signed-off-by: Emil Svendsen Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index 58a6dfa228cc326d18b3c3f126732033749c8e49..fdf4a9add852deb5e879dba5c8a= 09458fc6e709d 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -725,7 +725,7 @@ static int adcx140_hw_params(struct snd_pcm_substream *= substream, struct adcx140_priv *adcx140 =3D snd_soc_component_get_drvdata(component); u8 data =3D 0; =20 - switch (params_width(params)) { + switch (params_physical_width(params)) { case 16: data =3D ADCX140_16_BIT_WORD; break; @@ -740,7 +740,7 @@ static int adcx140_hw_params(struct snd_pcm_substream *= substream, break; default: dev_err(component->dev, "%s: Unsupported width %d\n", - __func__, params_width(params)); + __func__, params_physical_width(params)); return -EINVAL; } =20 --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 25500346AD1 for ; Wed, 17 Dec 2025 13:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979738; cv=none; b=BBaed2WRWO2TmeCP0+9pNkBKK1fy5lYY1Yas1ko5OF34QqEJ/b3Yi3UL/32C9tElnGgfPy5MzWNKnOjJB6aNUhBiDbWGPlOU8gYYuwn6mq16TPV3JO3eV1dKPht92TC4bwyeesHjWLLyoM/RlydOn7kzm3+9HcrMKZYy+wZD52g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979738; c=relaxed/simple; bh=GKEP9AMHKJ5a6QyDgU/OzjIEbqOGjcz+nleihAOIg1o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LrAK1xF2dobldoLAOOJLg168ECbl08apUdoT47b/2R1JJWhv5bX0s0a04oldMJ7kr1mX8ryC1mw9aAOlvgn8TyU8R1YnGm0Qr+nqicD6o647d8C6dPDlDZGwIQGvILQLwIYRV7xOXaxu6rDh3xztcCceYfW5g2DrX40Z1fHanUo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019C-Ah; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzR-0067Yw-04; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3Wsb; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:55 +0100 Subject: [PATCH 05/11] ASoC: tlv320adcx140: implement register caching Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-5-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil-Juhl X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=4851; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=ea1XVBbDlDq+86UiTFrQSLPJP6o7hjwGJAsuTxqcX9E=; b=JFqG24vOUudcOM9puVhc5pwH/8zBjLeww2s0Fsk7nQ34R0/htBd4sZSo7WqurEu9+Jjd1n12Z bdKlnMCzfycAuKM7oOEP9D28V2uX3TzmVTxI9xBbtQytXcCtrcBFMPg X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil-Juhl The tlv320adcx140 can be connected to controllable AVDD/IOVDD regulators which when disabled will reset the registers to their default. In preparation for adding support for them implement register caching. Signed-off-by: Emil-Juhl Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 89 ++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 87 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index fdf4a9add852deb5e879dba5c8a09458fc6e709d..444c0e80f0907de201ed1818b56= 12164a48b0fca 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -121,6 +121,34 @@ static const struct reg_default adcx140_reg_defaults[]= =3D { { ADCX140_DEV_STS1, 0x80 }, }; =20 +static const struct regmap_range adcx140_wr_ranges[] =3D { + regmap_reg_range(ADCX140_PAGE_SELECT, ADCX140_SLEEP_CFG), + regmap_reg_range(ADCX140_SHDN_CFG, ADCX140_SHDN_CFG), + regmap_reg_range(ADCX140_ASI_CFG0, ADCX140_ASI_CFG2), + regmap_reg_range(ADCX140_ASI_CH1, ADCX140_MST_CFG1), + regmap_reg_range(ADCX140_CLK_SRC, ADCX140_CLK_SRC), + regmap_reg_range(ADCX140_PDMCLK_CFG, ADCX140_GPO_CFG3), + regmap_reg_range(ADCX140_GPO_VAL, ADCX140_GPO_VAL), + regmap_reg_range(ADCX140_GPI_CFG0, ADCX140_GPI_CFG1), + regmap_reg_range(ADCX140_GPI_MON, ADCX140_GPI_MON), + regmap_reg_range(ADCX140_INT_CFG, ADCX140_INT_MASK0), + regmap_reg_range(ADCX140_BIAS_CFG, ADCX140_CH4_CFG4), + regmap_reg_range(ADCX140_CH5_CFG2, ADCX140_CH5_CFG4), + regmap_reg_range(ADCX140_CH6_CFG2, ADCX140_CH6_CFG4), + regmap_reg_range(ADCX140_CH7_CFG2, ADCX140_CH7_CFG4), + regmap_reg_range(ADCX140_CH8_CFG2, ADCX140_CH8_CFG4), + regmap_reg_range(ADCX140_DSP_CFG0, ADCX140_DRE_CFG0), + regmap_reg_range(ADCX140_AGC_CFG0, ADCX140_AGC_CFG0), + regmap_reg_range(ADCX140_IN_CH_EN, ADCX140_PWR_CFG), + regmap_reg_range(ADCX140_PHASE_CALIB, ADCX140_PHASE_CALIB), + regmap_reg_range(0x7e, 0x7e), +}; + +static const struct regmap_access_table adcx140_wr_table =3D { + .yes_ranges =3D adcx140_wr_ranges, + .n_yes_ranges =3D ARRAY_SIZE(adcx140_wr_ranges), +}; + static const struct regmap_range_cfg adcx140_ranges[] =3D { { .range_min =3D 0, @@ -156,6 +184,7 @@ static const struct regmap_config adcx140_i2c_regmap = =3D { .num_ranges =3D ARRAY_SIZE(adcx140_ranges), .max_register =3D 12 * 128, .volatile_reg =3D adcx140_volatile, + .wr_table =3D &adcx140_wr_table, }; =20 /* Digital Volume control. From -100 to 27 dB in 0.5 dB steps */ @@ -1073,19 +1102,73 @@ static int adcx140_codec_probe(struct snd_soc_compo= nent *component) return ret; } =20 +static int adcx140_pwr_off(struct adcx140_priv *adcx140) +{ + regcache_cache_only(adcx140->regmap, true); + regcache_mark_dirty(adcx140->regmap); + + /* Assert the reset GPIO */ + gpiod_set_value_cansleep(adcx140->gpio_reset, 0); + + /* + * Datasheet - TLV320ADC3140 Rev. B, TLV320ADC5140 Rev. A, + * TLV320ADC6140 Rev. A 8.4.1: + * wait for hw shutdown (25ms) + >=3D 1ms + */ + usleep_range(30000, 100000); + + return 0; +} + +static int adcx140_pwr_on(struct adcx140_priv *adcx140) +{ + int ret; + + /* De-assert the reset GPIO */ + gpiod_set_value_cansleep(adcx140->gpio_reset, 1); + + /* + * Datasheet - TLV320ADC3140 Rev. B, TLV320ADC5140 Rev. A, + * TLV320ADC6140 Rev. A 8.4.2: + * wait >=3D 10 ms after entering sleep mode. + */ + usleep_range(10000, 100000); + + regcache_cache_only(adcx140->regmap, false); + + /* Flush the regcache */ + ret =3D regcache_sync(adcx140->regmap); + if (ret) { + dev_err(adcx140->dev, "Failed to restore register map: %d\n", + ret); + return ret; + } + + return 0; +} + static int adcx140_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { struct adcx140_priv *adcx140 =3D snd_soc_component_get_drvdata(component); + enum snd_soc_bias_level prev_level + =3D snd_soc_component_get_bias_level(component); =20 switch (level) { case SND_SOC_BIAS_ON: case SND_SOC_BIAS_PREPARE: + if (prev_level =3D=3D SND_SOC_BIAS_STANDBY) + adcx140_pwr_ctrl(adcx140, true); + break; case SND_SOC_BIAS_STANDBY: - adcx140_pwr_ctrl(adcx140, true); + if (prev_level =3D=3D SND_SOC_BIAS_PREPARE) + adcx140_pwr_ctrl(adcx140, false); + if (prev_level =3D=3D SND_SOC_BIAS_OFF) + return adcx140_pwr_on(adcx140); break; case SND_SOC_BIAS_OFF: - adcx140_pwr_ctrl(adcx140, false); + if (prev_level =3D=3D SND_SOC_BIAS_STANDBY) + return adcx140_pwr_off(adcx140); break; } =20 @@ -1186,6 +1269,8 @@ static int adcx140_i2c_probe(struct i2c_client *i2c) return ret; } =20 + regcache_cache_only(adcx140->regmap, true); + i2c_set_clientdata(i2c, adcx140); =20 return devm_snd_soc_register_component(&i2c->dev, --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 1CC4333D6C1 for ; Wed, 17 Dec 2025 13:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979735; cv=none; b=V4Q5QvORddUUE9DHuIz3jPqBhVLMYWqyjCdGUQBN6ZJA3p4LHeaXHkbKJkJLSMnU1MrAERvCKDf6KZKiSGJd7hJBCwsCnJkLJO4SSsfG5oO1Z8e5Lko+rM+TkGsdiJ18VxDL0dCqxmpuG8pvsXjhmUQdKIPyC0hs3ezSP1tLLgU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979735; c=relaxed/simple; bh=I+OiwRe1Qyqt09aUmluGs1uW9nAJj7S2sqKV4dEwxxI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IP8qJWkhVGblU7d5mZvXtcn4i52itei/LjSuEtnhSkSmHgDmiTSjvNgK5rHcBkAuk8fvxvFlPzOdOhGMnx0Ux8b6E8r1L905RDzYfg7KntqHir0h1382le8vHHUiZk+1Vrju4Jw28EqiawHinzs/+wSNFnWHeJjs1vHL95rmb9Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019J-Ak; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzR-0067Yx-09; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3YBi; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:56 +0100 Subject: [PATCH 06/11] ASoC: tlv320adcx140: add avdd and iovdd supply Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-6-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil-Juhl X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=3059; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=84HiVGIj2AW9qbDeHDmfc8VFd7pOspkpmSN018Mo9VI=; b=kzaZ6wQCfNAWfDeodmPX/fh1A+Xi0FJ5mp3q+004ekTZXzb8VglOIA+P8a4i50MoDGf1LxLXQ NyZ9gLRo+16AUvH2ZEBHXf/CeJV40bjSy2Vwm7wrnJMdRvcL9uzHpzq X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil-Juhl The datasheet, under "10 Power Supply Recommendations" section, specifies that both the AVDD and IOVDD supplies must be up and stable for at least 100us before the SHDNZ can be released. After that, the chip is ready to receive commands after another 2ms. Currently the driver doesn't contain any options to bind AVDD and IOVDD supplies to the tlv320adcx140. This commit adds bindings for AVDD and IOVDD supplies which the driver will enable when used. Signed-off-by: Emil-Juhl Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index 444c0e80f0907de201ed1818b5612164a48b0fca..a7200e149e5f40ddd61e3c0455b= 796c81f55e2e8 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -22,8 +22,16 @@ =20 #include "tlv320adcx140.h" =20 +static const char *const adcx140_supply_names[] =3D { + "avdd", + "iovdd", +}; + +#define ADCX140_NUM_SUPPLIES ARRAY_SIZE(adcx140_supply_names) + struct adcx140_priv { struct regulator *supply_areg; + struct regulator_bulk_data supplies[ADCX140_NUM_SUPPLIES]; struct gpio_desc *gpio_reset; struct regmap *regmap; struct device *dev; @@ -1104,6 +1112,8 @@ static int adcx140_codec_probe(struct snd_soc_compone= nt *component) =20 static int adcx140_pwr_off(struct adcx140_priv *adcx140) { + int ret; + regcache_cache_only(adcx140->regmap, true); regcache_mark_dirty(adcx140->regmap); =20 @@ -1117,6 +1127,14 @@ static int adcx140_pwr_off(struct adcx140_priv *adcx= 140) */ usleep_range(30000, 100000); =20 + /* Power off the regulators, `avdd` and `iovdd` */ + ret =3D regulator_bulk_disable(ARRAY_SIZE(adcx140->supplies), + adcx140->supplies); + if (ret) { + dev_err(adcx140->dev, "Failed to disable supplies: %d\n", ret); + return ret; + } + return 0; } =20 @@ -1124,6 +1142,14 @@ static int adcx140_pwr_on(struct adcx140_priv *adcx1= 40) { int ret; =20 + /* Power on the regulators, `avdd` and `iovdd` */ + ret =3D regulator_bulk_enable(ARRAY_SIZE(adcx140->supplies), + adcx140->supplies); + if (ret) { + dev_err(adcx140->dev, "Failed to enable supplies: %d\n", ret); + return ret; + } + /* De-assert the reset GPIO */ gpiod_set_value_cansleep(adcx140->gpio_reset, 1); =20 @@ -1234,6 +1260,16 @@ static int adcx140_i2c_probe(struct i2c_client *i2c) adcx140->phase_calib_on =3D false; adcx140->dev =3D &i2c->dev; =20 + for (int i =3D 0; i < ADCX140_NUM_SUPPLIES; i++) + adcx140->supplies[i].supply =3D adcx140_supply_names[i]; + + ret =3D devm_regulator_bulk_get(&i2c->dev, ADCX140_NUM_SUPPLIES, + adcx140->supplies); + if (ret) { + dev_err_probe(&i2c->dev, ret, "Failed to request supplies\n"); + return ret; + } + adcx140->gpio_reset =3D devm_gpiod_get_optional(adcx140->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(adcx140->gpio_reset)) --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 DBB4D33F395 for ; Wed, 17 Dec 2025 13:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979733; cv=none; b=nykg2yimdv8oiQ/6q0fGXnHbVR6Yi5O9p8UuGyXwBRVTqyIzQqb90bwfVtTG7KZ+LMocw9y5aPDHjSrfAObBLS4y4UoZ3cdFllhIxKrJMpydeGVh67SOQgFmyorgXHw6s3DxDj4RPUuOgig3R5l/Rn2BtZ06rAHrs8QvYndq8NY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979733; c=relaxed/simple; bh=Gt/yd6Gg1gVsX4My67tGlLMQaMCQ6n106Zyf/PV/7CU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Kbcbh9yfkXUiqOPELIwjaVrqspSfCoDec0HoROXu5Elkc48qCbBEyUHJVXnJJ0gxMI+de8WMwkOnOKvN1Hoz7GWAwyj2olrEe6vpFPG8A0w36jKz/3FFouCgQo7gtyVyzOB7K+diQHglbBedmhrfaEoQbL7ACGqwA38qQ6PxZIc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019F-Ai; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzR-0067Yy-03; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3ZHF; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:57 +0100 Subject: [PATCH 07/11] ASoC: dt-bindings: add avdd and iovdd supply Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-7-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1231; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=Gt/yd6Gg1gVsX4My67tGlLMQaMCQ6n106Zyf/PV/7CU=; b=rB5ByCR5VKwlfo7/AiAe/IG2Hmxb2hBPhIfcQ5eg3p+K90A/hUOhma2tV2v4wTq208D0A+bqt xR3KKPPTKXtARZgTCGu7SP+ddv7f5s1A/rrvcXElPdIK96itWPiojx1 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Add bindings for the avdd-supply and iovdd-supply which are named after the corresponding pins on the tlv320adcx140 chips. Signed-off-by: Sascha Hauer --- Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml | 10 +++++++= +++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml = b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml index 876fa97bfbcdd3b9450aa6ff57de42f1faed350d..0f043a51f1822f4d39214438818= e3bc84d3e8681 100644 --- a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml +++ b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml @@ -44,6 +44,16 @@ properties: Regulator with AVDD at 3.3V. If not defined then the internal regul= ator is enabled. =20 + avdd-supply: + description: | + Provide a handle to the regulator supplying AVDD. If not provided, a= dummy + regulator will be used. + + iovdd-supply: + description: | + Provide a handle to the regulator supplying IOVDD. If not provided, a + dummy regulator will be used. + ti,mic-bias-source: description: | Indicates the source for MIC Bias. --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 DBA3E313273 for ; Wed, 17 Dec 2025 13:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979733; cv=none; b=A/XpdXL9pqdJx9m5HIQIYCxL6rYOuii0CXhgDf67TSFmF1tvxjFkAR/ylqQLLjFZ4saqDp0CwIONfRT8w7SyaAK6lpykzdfRa0bNi4qoKXFM2uqjgISsl9BfV07R4bGTQzdAQ+faneBaigQ/pvdT+qWPbS8CYxyWFlwHjs7GFFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979733; c=relaxed/simple; bh=3q1Bb9aNUhXdLZynKuJFzoIjjRh/VZFhJ+NnPBLkf78=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DcuGMh+xEmylDNnwvvEzALEiWPZHsL4/HCZlQd7CWtgX/+PxSj1o41Z/sAOQrietLR4bg/jsY9NO+L8kDvHzkrIGkpWAobKNahiNRPftfrf7IlfunlmSMNBT5wF2j49RU4Mz3TLFE/GiqSuft6jlIBTfhQmQSNpoNY8PzMqLZ+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019D-Af; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzR-0067Yz-07; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3aI0; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:58 +0100 Subject: [PATCH 08/11] ASoC: dt-bindings: clarify areg-supply documentation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-8-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil-Juhl X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1226; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=Zi7IATji7fJN0pX28I/qZv7ioSn8CLaQD4yfaWXgIc0=; b=FdPzUlucFHYTia4/7FxZ+STWp59ObsDQjnL96Yu+A9qslowjUi8wE8WawjLSG1B+rbPTsvjzO woFWxO1hH/VDpjFS8snJq7tNVaTxV8YcN8FD/1cLMj9QbJyFiW+XM3/ X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil-Juhl The documentation for areg-supply could cause confusion mainly in terms of the relationship between AREG and AVDD. According to the datasheet[1] the AREG can be one of two cases: 1) an external 1.8V supply 2) generated by an internal regulator (hence a 1.8V output) [1] https://www.ti.com/lit/ds/symlink/tlv320adc5140.pdf Signed-off-by: Sascha Hauer --- Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml = b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml index 0f043a51f1822f4d39214438818e3bc84d3e8681..0c550c04f5ef239f403bea668ff= d8c6051d86821 100644 --- a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml +++ b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml @@ -41,8 +41,8 @@ properties: =20 areg-supply: description: | - Regulator with AVDD at 3.3V. If not defined then the internal regul= ator - is enabled. + External supply of 1.8V. If not defined then the internal regulator = is + enabled instead. =20 avdd-supply: description: | --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 52212342169 for ; Wed, 17 Dec 2025 13:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979734; cv=none; b=MRFHpj5tCH9CGGvIzvVmePHJDlifYGvqtolrhIrNO2/LTfgnalvuycRYhRfLMou9OYGS/EZ3kkKMQvyMY6GmF5E+Wu5ibtaE19oeNdPDuETkfE9axhsJh0xSmBG9OJt3aYDgP6j4OweEc88Kz8PrGfww2r2LanXfmoz++m2hjTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765979734; c=relaxed/simple; bh=mufaNSnxOyOJaXre14Y6jf5ZcVEkcfur+VRINOEz6V8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tJ3xlS7cbiZV0aa8entafo19FPW8vAeFWheO9UkGshfeCxg8ltuA2nO6mNXdtejCAnVPf21lC3ygpsbKrVU7Idd5eWwGy2JYpewi/tH0rlFylp+5qfcev6caFn+0pOD7cbw1gbGSOmeEu1AnGdx88xSlMJjPu1Smcbyl1au/FyQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVrzW-00019G-Af; Wed, 17 Dec 2025 14:54:58 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrzR-0067Z0-09; Wed, 17 Dec 2025 14:54:53 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3bQK; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:54:59 +0100 Subject: [PATCH 09/11] ASoC: tlv320adcx140: Add kcontrols for TDM Slot assignment Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-9-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Andreas Sloth , Andreas Pehn Sloth X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1243; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=/CKeb3D1C2I/QEaSoCCDRI6gq3lhbGRa4YCn/nWD5Kg=; b=+zTgmoquauS/t8FniXCXoxFBGV0jP1HkA+mYqbRY7+xWQfr8qlFceMARyv44s6YNJGZ7N/2aI fPJ21HKzRjdAmJmrnFTrAqTHh9sb9K4LuSEMiYoofUtKKk+tKdA3Q64 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Andreas Sloth Signed-off-by: Andreas Pehn Sloth Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index a7200e149e5f40ddd61e3c0455b796c81f55e2e8..a835074d9a7898466c6854f0c0e= 8ab687a99c57a 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -708,6 +708,16 @@ static const struct snd_kcontrol_new adcx140_snd_contr= ols[] =3D { 0, 0xff, 0, dig_vol_tlv), SOC_SINGLE_TLV("Digital CH8 Out Volume", ADCX140_CH8_CFG2, 0, 0xff, 0, dig_vol_tlv), + + SOC_SINGLE("CH1_ASI_Slot", ADCX140_ASI_CH1, 0, 0x3f, 0), + SOC_SINGLE("CH2_ASI_Slot", ADCX140_ASI_CH2, 0, 0x3f, 0), + SOC_SINGLE("CH3_ASI_Slot", ADCX140_ASI_CH3, 0, 0x3f, 0), + SOC_SINGLE("CH4_ASI_Slot", ADCX140_ASI_CH4, 0, 0x3f, 0), + SOC_SINGLE("CH5_ASI_Slot", ADCX140_ASI_CH5, 0, 0x3f, 0), + SOC_SINGLE("CH6_ASI_Slot", ADCX140_ASI_CH6, 0, 0x3f, 0), + SOC_SINGLE("CH7_ASI_Slot", ADCX140_ASI_CH7, 0, 0x3f, 0), + SOC_SINGLE("CH8_ASI_Slot", ADCX140_ASI_CH8, 0, 0x3f, 0), + ADCX140_PHASE_CALIB_SWITCH("Phase Calibration Switch"), }; =20 --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 6F2F0396DB1 for ; Wed, 17 Dec 2025 14:08:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765980538; cv=none; b=aSfVH/iPSjjpiQhYsH/l6CtdmV+ZjD0xPblq4Ze7QkyJZVhoCE2S59vivm81oqRB50dEFS+M+EPaC3PC2cda02D0CJpUfv5fQGt+uqga0+QqKdlgzePfrPqH9jM/GFsX8MITGuAlnAc7T9fXb+fyp6dKjV2JdhMaoYLJEPYKAcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765980538; c=relaxed/simple; bh=psw6OIrwkaBiE2O7lF2QKi4RGG61GxTElFyh95uR00M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qGv0AgaW+NeajZKdaEGeJtJ8Y+QxfAAcnPRXMwnfB1tAkgHrSdim/gsTmG8J4jF3uZ5bF62mTuVc8K6JdL+9V1af0CjxeYnRqsuHWaGCCMn7pxEZqyfIMtb+g3YARg0rFXmAnnJvVQed/R65gYNyWF74r1cKXK3CPQNBcw/kAMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVs9r-0002Xr-2f; Wed, 17 Dec 2025 15:05:39 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVs9p-0067qh-2h; Wed, 17 Dec 2025 15:05:37 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3cL9; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:55:00 +0100 Subject: [PATCH 10/11] ASoC: tlv320adcx140: add kcontrol for num biquads Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-10-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil-Juhl X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1159; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=u6go7JAZwUS7BsR7tvarSkNkpQtFGjP95RxpYP1aFUI=; b=kbvT+CYRnbHOLiJmG6qDWdGTPNduDWmbb9MTYG5yPUYxnFb7M1xLxwEew6xfcBLKnSDihN2xw 1FYb/mOHyn3DhahXB9Eq/AG7RPnk/Zuef+PSjjxfSd1CwHGZM6KE/B9 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil-Juhl The tlv320adcx140 chips have a configurable amount of biquad filters enabled per input channel. Currently this number is always left at the default value of 2 biquads per channel. This commit adds a kcontrol to allow runtime configuration of the amount of biquads per channel. The configuration is controlled by bits [5-6] in the DSP_CFG1 register. Signed-off-by: Emil-Juhl Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index a835074d9a7898466c6854f0c0e8ab687a99c57a..d8b6e6fafb68bc48ce9be01e243= 5bfecdb5bafc8 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -719,6 +719,8 @@ static const struct snd_kcontrol_new adcx140_snd_contro= ls[] =3D { SOC_SINGLE("CH8_ASI_Slot", ADCX140_ASI_CH8, 0, 0x3f, 0), =20 ADCX140_PHASE_CALIB_SWITCH("Phase Calibration Switch"), + + SOC_SINGLE("Biquads Per Channel", ADCX140_DSP_CFG1, 5, 3, 0), }; =20 static int adcx140_reset(struct adcx140_priv *adcx140) --=20 2.47.3 From nobody Mon Feb 9 19:57:42 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 11E0C39657C for ; Wed, 17 Dec 2025 14:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765980537; cv=none; b=Zmy0MDGOPIMHyJ6jPXny1nec/IuaesJ+XIpsluBdM4TTGclPENErVAU82GtsLeIDND3LmeBcWB6Tvg1T0SfA2nFs+M+7/a20hD/cm2/tBLY5w3QqOikCUHDUXcdpRJ7hC994xZvbC1t7z78LT/pQ3C3JmeWBwCfsbzmowZ8N/II= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765980537; c=relaxed/simple; bh=x4MhiHIBxXZT/JGnBW6uY17eLmz9TncIJc1+KlFk9mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VnjQEGAMO077k63oRebMy70JKB30NqjGZPWWuyZvBFIW8XEaIUdVEZLv0wYW2TQl608VW808jaN3N3sKwF1vIS6uiU1IMNSKvfpdAWQBrZkFB6DDAEMwmsom6WoE/qUjoZKf1BRVNYagddFK8piPfSHXXYvY6g31r+pF5ptm2bM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vVs9r-0002Xq-2f; Wed, 17 Dec 2025 15:05:39 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVs9p-0067qe-2H; Wed, 17 Dec 2025 15:05:37 +0100 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vVrzQ-00000004tQv-3enP; Wed, 17 Dec 2025 14:54:52 +0100 From: Sascha Hauer Date: Wed, 17 Dec 2025 14:55:01 +0100 Subject: [PATCH 11/11] ASoC: tlv320adcx140: add channel sum control Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251217-sound-soc-codecs-tvl320adcx140-v1-11-293dea149d7b@pengutronix.de> References: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> In-Reply-To: <20251217-sound-soc-codecs-tvl320adcx140-v1-0-293dea149d7b@pengutronix.de> To: Shenghao Ding , Kevin Lu , Baojun Xu , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Dan Murphy Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Lu , linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sascha Hauer , Emil Svendsen X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765979692; l=1805; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=B4XLlj4yXAj1cRuxwpnqVGmABzsNU6rXcpOes817Bdk=; b=sWuf6hpTwFoOGIfSt9ZVGZCUgGhRW8zvVEmA1ODx2tyZ3UobRD+0KXCTA5KuoehvSD5nGGASF ZHfPacU4NnIDNq5oFKty+5CrxmzbX1+vq8fPGsP9ouPfD90Q6S4k+S5 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Emil Svendsen Add control for channel summation. 3 modes are supported: 1. "Disabled": Normal operation 2. "2 Channel": Every two channels are summed and divided by 2 Out 1 <- (CH1 + CH2) / 2 Out 2 <- (CH1 + CH2) / 2 Out 3 <- (CH3 + CH4) / 2 Out 4 <- (CH3 + CH4) / 2 3. "4 Channel": Every four channels are summed and divided by 4 Out 1 <- (CH1 + CH2 + CH3 + CH4) / 4 Out 2 <- (CH1 + CH2 + CH3 + CH4) / 4 Out 3 <- (CH1 + CH2 + CH3 + CH4) / 4 Out 4 <- (CH1 + CH2 + CH3 + CH4) / 4 Signed-off-by: Emil Svendsen Signed-off-by: Sascha Hauer --- sound/soc/codecs/tlv320adcx140.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx= 140.c index d8b6e6fafb68bc48ce9be01e2435bfecdb5bafc8..4f7d2a771a272a23050616a3a6d= b473f69ee752e 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -222,6 +222,13 @@ static const struct snd_kcontrol_new decimation_filter= _controls[] =3D { SOC_DAPM_ENUM("Decimation Filter", decimation_filter_enum), }; =20 +static const char * const channel_summation_text[] =3D { + "Disabled", "2 Channel", "4 Channel" +}; + +static SOC_ENUM_SINGLE_DECL(channel_summation_enum, ADCX140_DSP_CFG0, 2, + channel_summation_text); + static const char * const pdmclk_text[] =3D { "2.8224 MHz", "1.4112 MHz", "705.6 kHz", "5.6448 MHz" }; @@ -721,6 +728,8 @@ static const struct snd_kcontrol_new adcx140_snd_contro= ls[] =3D { ADCX140_PHASE_CALIB_SWITCH("Phase Calibration Switch"), =20 SOC_SINGLE("Biquads Per Channel", ADCX140_DSP_CFG1, 5, 3, 0), + + SOC_ENUM("Channel Summation", channel_summation_enum), }; =20 static int adcx140_reset(struct adcx140_priv *adcx140) --=20 2.47.3