From nobody Mon Feb 9 21:03:50 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 160CC2D5C92 for ; Thu, 18 Dec 2025 15:04: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=1766070275; cv=none; b=EAVvnm+c5HMfzbGPXjbUjJPLnke6DnrUyQyR0fN1UV593kpWZVIIZbSVDJaqKTJGSXvfrbvRaIEee78ijmN6WUeJ1jWZEYla05vi3nOTJrCElwXZNnZcvBQvo33ca8ZZDGRO4lWp7uP0i/dIholNpUnzAGs4c3NrEsLZzsIoxBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070275; 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=gmNQk7ekSh3FSsLs6Z071oeYWMhy7SjH0dAcMMbXu2nPzCVLbYWg7pR9F2CVEi7YC9NhwutX/xsNDq3BnJhjpPVKY4Xy//Tc/Be3NsXW73ubVNy3ZicWV4wC7c1Dsh+QuPMvcNTgT899L8F1mOrjd3nCSpZKt03FOicg3gp+etE= 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 1vWFY4-0007j2-Oa; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfH-1p; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1nOx; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:07 +0100 Subject: [PATCH v2 01/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-1-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=1278; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=WfOW2anrTgz/4XEyF51/kruoQkV8SVMulwmjlAzpc1c=; b=KZwIJgesMBd2J6tlmJpgQ5foIXa4107d+o+0giboc5aT1Axyfd5+f0ZihcbZfHKAOXNvFHwYR y7n3RCZNtytBacLBW4Jql74pzrXKyc3K2ncwqxxfWSUHNsi3Wb8i2Jb 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 21:03:50 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 3B7292D876B for ; Thu, 18 Dec 2025 15:04: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=1766070276; cv=none; b=HOecxzSJKaMFSFSrbR0SvMX0rX8j6GcWHtb98BWrfCpQLR6kg5D5VcwqxQZhNLj8RkyaxeiEfc8Klt2qZ1ho3ijAto1a8fIm2FagJR65vTizJLZOkyQAsOxIimMIVZ1N2DtitGnQfoKh6MowBX4C3ILugRkeQnFcmYWD/8D18bE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070276; c=relaxed/simple; bh=41flRPH4TSGsnCvQyNzqSTUzQqo/QHTY/SRkQLuvrVs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cBZhw1izsge4Nf0Cht1IvG8Dy5f3sm77NkY2u4QIeRmoEZDryR7v7U6xaqJykp/NqXhYX/acHoTwK1+5QBxoqvN9IohChcMixUtcDXvgzOsXHXjko+QgOdEtkEXS7tCGHIwULVSEKWO4+S7cuU07a4ITCygoDWn/RmPnIoZzD/k= 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 1vWFY4-0007j6-Og; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfJ-29; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1owo; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:08 +0100 Subject: [PATCH v2 02/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-2-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=1573; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=Rp2iiRNuVwV+taJffar+hJiVimp4OjAE0fMMm0vIwyQ=; b=jjKb/FpjU4yYrNLqSQ92DgMSJ8W/5UOWeuOfPQW9qlipN8n2OFOfNZQab6lfQNsGm2tLZqQxS kXNoZ9mJtwhBNWnoWLUHVccemqj1hKMKxflt8B6q94Xg8zv8WeduBmU 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". 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 21:03:50 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 A92B72ED175 for ; Thu, 18 Dec 2025 15:04:44 +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=1766070286; cv=none; b=fOIH3H7Xk1eLL0m3HVZ8f146eAvTR4MyoM6Cao1+ZcdNOZfRdp92GTrkjMg+cO39RNHyJzMoLEOLdhbTToTnSyCLtCVBA0roRMWxMDWlWK4VDQ2hi8P6SDoGpEKFxaVVxk8EcxOdaCMvQ8P6VXoni/+uEs5pvisGGfvEfTxXMM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070286; c=relaxed/simple; bh=KIVZf9eQsEe24xzKqF2imdi5YUmFlNEbdV3+FMOkKwE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g0PLftX21gqCpNpRNm9is96jXzSabqXMMYwYsbyK6LFJ7072e/GrrPzMVExlqX3oCId6W+csirCi5BXHLYA8CdJhnaeXQfYuthubdU132AFVohVme3zZ4QRawfnGAobqKXezKtPQyYo9elaPL3DwXYSBvxdtolKf3Ha2l9T9svQ= 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 1vWFY4-0007j5-Oc; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfK-24; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1rUt; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:09 +0100 Subject: [PATCH v2 03/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-3-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=1285; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=PpAmR8wKqRTX1YV1R8fVM7vj/FkNO/cKPTJr6ncyO00=; b=vMcrHYK9mVO+dwSeKWY9gMBoscUUpIhqK78dQkhSx2RUvJia+V5GCzvhOcjTx/jitAghTkAeP v7ha4gFIGYSCnJpJGhBuSZXjIquRvIdxyalK+AM9LinM2vjPkzYSIrO 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 21:03:50 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 6224C2DAFC7 for ; Thu, 18 Dec 2025 15:04:39 +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=1766070282; cv=none; b=V471OVTecF9U97zq554vJU++zyoNEgzOk2qvPIZdtmfaJ2GDGMksK74IuthOSfpUT9riaWmHNJGys8dNt8vHNDQ6MIQSgw/AGCYf2rsvJV9p9/v0yTODDYntN4k5F5+0RKNKgxODGJlE9Xauafds+RmC7OKIZj033CaL7zaBpzc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070282; c=relaxed/simple; bh=VZx0u1LV4OE/RGQRohcWYqHEcQkYI+lNdynE0cp27ZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PuJ34YgbWfqVDwHy3mHm84lefd3G+NmzxTd/nmut37O7MYgGaKd18rDBFU8qYCHZX8BMfjfRKBoA76QdivujNKIP9zJy2LVda2MtyCvG+qRD9DqD2BKBkm4YNTsuSLte+xHZLyLQK+B1e5iQlE4yA8koCsyy4h00BT2P8Ww24u8= 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 1vWFY4-0007j9-Oc; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfL-2H; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1t8Q; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:10 +0100 Subject: [PATCH v2 04/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-4-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=1458; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=v43nJHLbOeXsx5JJSDE5Vevx6RwD4qkqiA+EJyAWPpo=; b=Weg9/LbT39wBSbizPqoNS2Y16FGGoTzScLMtk6vb6FOX5BlDITb1jbL5myNLI/eyP+AhjfFey qlirMQgDenADpKaiuIsJJoP1c/5+FP0CU2CAmojtHAbquaBhpnv8x9m 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 21:03:50 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 9B3E72DC32B for ; Thu, 18 Dec 2025 15:04: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=1766070274; cv=none; b=tvbtB2Tg60WZkCBNXT2RNFl6Xn7gaPJ+gF+86OIAb9IAunZG6E81cVa6s8vonOXUqGG+eXT8k7h5HhcZVVUJlG78oofGqmMDEvF/MOxD1yOp6HRZUYq756kGgXEkuLqGDrINsPJotCX7JnHNrqUuEiklsG8cc+WFDIgdl4+ticw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070274; c=relaxed/simple; bh=YmYfAiYtDMLwEYQHfzbK96EA7eR/wsi3lxl4N1XTMhg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bhaJcMvc6k9RNuScSRBvnw52AZskxQCcBcUZf6ea99LgDqgQU0X2tRTf82mFV11BvS2gpkknOPeWfisb8j0deGymYTV6TbA/eGeegy3dvUSR4Wc4iYRfjhoWhsRMt2sBvQPZH4wIZBSVuiJ0bIDgRxLMMHmTufI+UZmCnoEgTrc= 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 1vWFY4-0007j7-Oe; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfM-2M; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1uel; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:11 +0100 Subject: [PATCH v2 05/10] ASoC: tlv320adcx140: power on/off the device on demand 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-5-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=4929; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=ZnNeTOgXVvM9bTi+Jtpw4nD9MeKZ7YeJc6ZpZ/WVJxM=; b=hpoBvkey/bc3LThjtJLc7xSRm2Z/yp+0liV4kb9BY2rY15QW9X94fVLiwpPtk2DUO4qe5xYsQ ADiGEBT/znVAT7mHmpjViWoJTr8FV8HRtjIms8ow9LEn+eXMOY/J+cD 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 that switch to register writes to cache only when powered off and sync the cached values to the registers when powered back on. 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 21:03:50 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 91A122E7BD9 for ; Thu, 18 Dec 2025 15:04:39 +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=1766070282; cv=none; b=JEoOLuKvaGUajrLANqSmZEEfFuECPpdKmM0kmQv1mnOPe3HHxMWDh29p72Mllw1s/KaFJxM7aL4wofIBEVhBPLFDWwk9JWnSck3k2Y8r5xwerwae7rkKw+JZSrAIoUQ9wDX5SEsAD6e3gXai5XlHb312k4EgMpmxw5jBRB5IQk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070282; c=relaxed/simple; bh=I+OiwRe1Qyqt09aUmluGs1uW9nAJj7S2sqKV4dEwxxI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cjRbj+1/k2c9T9upAsVcfROjF60h+MiOOkN1ovp/8hzLspGRRWuFoptHFBfZ4nxj/+DVX63QBHKxSTu/kordxTEVbDAu4H9QoJLg0J37HUttgKW58LhjPnRswoRYKWCZaLv7Gk1kko3ae6Rb2URxwcmnE22dhtjBblfz57Hr/pg= 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 1vWFY4-0007jA-OY; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfN-2L; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1w5J; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:12 +0100 Subject: [PATCH v2 06/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-6-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=3059; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=84HiVGIj2AW9qbDeHDmfc8VFd7pOspkpmSN018Mo9VI=; b=MZ2qt5y97ZnWu2eybya+DnrKLaxRStwg1kTMqvTTy6NBz9LZRp04nzU9yyKbEEnfXYVi0dWf6 gv5BLMWezXbDNhwoqig1O2dYlilRPEqsmDQ00XTZjj2HcM3KMzy17cB 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 21:03:50 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 DFE9F2D3EF1 for ; Thu, 18 Dec 2025 15:04:24 +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=1766070269; cv=none; b=RvSFZ1yAwF9raux7kULIdW8nbc7eE0GuMywIfSikYTPPrEal7BZUt7RMH7naQyw0+dAX0cpJtKw/gPJHxz++gcwkjGJ46EVRIcjqClG70uQRXh3v+QaSoPIqKXMKeMML9Z4O9GC9Yt8bTh+1Q6/4AdU6X1dCSbhzN90nfWysgrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070269; c=relaxed/simple; bh=XLqH3l6PU4VmqJ4ZW7Obnr3k+/J5JRnsXv0iCi8V8Z8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UyXiMHQgmxm2o7kNiInpqC5m3D2fV0hHNHuDZEbLv1PBs1dsWO7SvpKiCUfvVAz9NyuD8+ujyGgxpiFMKzySWsTrIARrC6qB3RggSbhV23jsNxCxk0ln4DkbbBuB8aZPy6Je5RxiWiSDpSzm4AufZM/UQPF6tYLm5a3vWlwXqwo= 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 1vWFY4-0007jB-Og; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfO-2F; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1xMe; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:13 +0100 Subject: [PATCH v2 07/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-7-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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 , Emil-Juhl X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1766070249; l=1285; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=7RfFbFyTNGaSY6avmnHjxprtJDzNzxIoQg0ZhbFwspg=; b=1mUtQux9IUp/C2Fr5xEUCc3AmeEZcwTCd5FbHWQfP328NyumtfBaycIo8vAKweZx6/Ys5DYIP G6kq5Kn/LRVDwLSga4w8cGuV8Vz9s0ROaCmzOdlfN7QNeMdAqBp+l98 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: Emil-Juhl 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 876fa97bfbcdd3b9450aa6ff57de42f1faed350d..b34ea7824360310434d8b826392= 864dbfa5fc369 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 ti,mic-bias-source: description: | --=20 2.47.3 From nobody Mon Feb 9 21:03:50 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 49AD42D660E for ; Thu, 18 Dec 2025 15:04:23 +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=1766070269; cv=none; b=AcDPpOVnzOcGZ8pj3Q39+0tq0cGNwSqYWweE4/sbz5t2nJsTF5Y5zlTXhQEsutQpk5IAUYdUhJaT8iNSZj18/wAHl+JVGr4PMv1nHpaoEHAXgVStQwNwScc2VtqQxL/BtUcX17zz85w+dDMAJH2ne6ZwEc7NEhCNTgXKBdoDA/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070269; c=relaxed/simple; bh=qcmcfZEIlFcWuH8O6//zI+Eh0dn5AfQ8w4FItXEukno=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XActhsP+AheBrR8nD7NTG8d74q2IEyAHWCdlz28cDe2+VWe9j/Y6c4fATibUI7yLh1rTZlaSpHeoz9X3qtxXAlblp9bVUP0NJBe6JTBgbvFC/eNcsmT5OWKMTQSd3u5A55vUP3QkVRdwfIqPKe1p5uctkBlrjm2jSW4fgi/iJzM= 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 1vWFY4-0007j4-Oa; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfP-24; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1yly; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:14 +0100 Subject: [PATCH v2 08/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-8-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=948; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=qcmcfZEIlFcWuH8O6//zI+Eh0dn5AfQ8w4FItXEukno=; b=lgIUxAGJvhP5uCXlbIoIqRA1zCQqoh6Mq6Yp4QRmPukihQFsZ1mB76e2jj94y1TgQUCzvUboo i1Vw4st+aJnDtSDryvtMPNA25t4ia+vlfX/npoZuRfzKYdMt05UCdxf 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml = b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml index b34ea7824360310434d8b826392864dbfa5fc369..2931d536d7129e6a88eafbb6c45= d00f50bbc7d5b 100644 --- a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml +++ b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml @@ -44,6 +44,9 @@ properties: External supply of 1.8V. If not defined then the internal regulator = is enabled instead. =20 + avdd-supply: + iovdd-supply: + ti,mic-bias-source: description: | Indicates the source for MIC Bias. --=20 2.47.3 From nobody Mon Feb 9 21:03:50 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 E69072C326A for ; Thu, 18 Dec 2025 15:04:22 +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=1766070269; cv=none; b=B2AADffDKZlj6drgKqlUusRUjUa8mSVBPbzA+iT0cUT1Dx+ETggXu4hmPcRUqIBsm8o0+E8dmqhmJfUX1cGIKn7yKDhH73rH3ILYN+BbOba9h5pwG+AELsuqy2rCOAWmy1Bwxz8HhSvcpBTxFw9VoVVIhqUxtf2ySZL48p7dkZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070269; c=relaxed/simple; bh=BftEMXNe9b9u5qp4tnrpwQrsP8OnPjgSNlWWBG1pYyE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xisb/e+2uY5B3HXlNIoZDD9MePud1/65hZQcBPYkQ3mr71+ZpjlhN9CDPGb7L7YideyihqWrLK0bP+A9sRVPmcGcryidNbgJGuIVHY18gEMKw2948cEoN3Wfxgqjx4M2KECrxIqsNTqqStOqtu41u245OuYNq692Q6p0qbOBhDE= 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 1vWFY4-0007j8-OY; Thu, 18 Dec 2025 16:04:12 +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 1vWFY1-006IfQ-2J; Thu, 18 Dec 2025 16:04:09 +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 1vWFY1-00000002kPh-1zsF; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:15 +0100 Subject: [PATCH v2 09/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-9-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=1189; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=qc2dQpr272s/at2Ej519T5bc2Pd27yFq5qfLTQIbZ5w=; b=k3j1lAsnKy8JJbxs9OEGZyC/a8foLGiD/KZDlTrkeg4oEcqoYeCyVLtTHIu1kpCMuQVI0hcIx jd81geFfQMbAxGEf7+RvxeTfuOIDW6xFK1e6BeE0RFiJofe64JiOpwP 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 a7200e149e5f40ddd61e3c0455b796c81f55e2e8..e7c607af642f43b2b783597f3cb= a3a8cbb31de4a 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -709,6 +709,8 @@ static const struct snd_kcontrol_new adcx140_snd_contro= ls[] =3D { SOC_SINGLE_TLV("Digital CH8 Out Volume", ADCX140_CH8_CFG2, 0, 0xff, 0, dig_vol_tlv), 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 21:03:50 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 EB0A92EACEF for ; Thu, 18 Dec 2025 15:05:46 +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=1766070348; cv=none; b=juF65c8KasN6jbUyzAojP7Bk5n8ONur8tSNAKB+eH5i3A1JcT0evN8XevV2e5gZZhZqU+WWqdGXkh2XdwtLEeFUj6KXPsP2dyneAkn6rL01xMmrAmMGTmMn59tg3qSF7IiDXd36BvUg/Ug5XuDhvugdBVeS7OgiwkyjVfsR/RwY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070348; c=relaxed/simple; bh=zIzI+RWN8I+PPp7gM10QfdwWfky+ttRAA/4WGgQBPSs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sIYNuSMtIwRgqKkVj9hVQE+5EP6GoVYvCl7v3VgHDe6kcILfV+a4jYxT5ehcE216GGIU/b7OUhtI/4l6uh/cp9dTNjaj1OD1id+JphlQLll8Z3TxDn4JFlaATvwcOMzLN3kfcxA3ZdAi1wmnapItSbYDC31ifz68MzKq50x5QJM= 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 1vWFZS-00080k-Oi; Thu, 18 Dec 2025 16:05:38 +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 1vWFZR-006IkO-2Q; Thu, 18 Dec 2025 16: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 1vWFY1-00000002kPh-224q; Thu, 18 Dec 2025 16:04:09 +0100 From: Sascha Hauer Date: Thu, 18 Dec 2025 16:04:16 +0100 Subject: [PATCH v2 10/10] 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: <20251218-sound-soc-codecs-tvl320adcx140-v2-10-3c2270c34bac@pengutronix.de> References: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@pengutronix.de> In-Reply-To: <20251218-sound-soc-codecs-tvl320adcx140-v2-0-3c2270c34bac@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=1766070249; l=1805; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=0KnIM+Y4QBq/N0NnDfRAKNRfpAubDFVWi/5K2Fijr9k=; b=DyJ5K/YS/KOBuHz5cwQlYzcr0nvB/FdzrWmoR44Zs8aFCe7Sk41MiXXjEHNgiXZLlUfHPNc9G 6NklkWiv0bxBTpIa0UV9MLLlthEnECv1LBoi0AZVS3CvQfH8VJaRqY5 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 e7c607af642f43b2b783597f3cba3a8cbb31de4a..ac6aab8d722409b2c47b4e1df2a= 23760bebe795b 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" }; @@ -711,6 +718,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