* [PATCH 01/11] ASoC: tlv320adcx140: invert DRE_ENABLE
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 13:54 ` [PATCH 02/11] ASoC: tlv320adcx140: fix null pointer Sascha Hauer
` (9 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil Svendsen
From: Emil Svendsen <emas@bang-olufsen.dk>
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 = DRE
* 1 = 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 <emas@bang-olufsen.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
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/tlv320adcx140.c
index 443cf59cb71ab3e70f47c4395159752a0331b1ef..75e1007012a48a569586bc2896400e79ddce1c71 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_dre_en_switch =
SOC_DAPM_SINGLE("Switch", ADCX140_CH4_CFG0, 0, 1, 0);
static const struct snd_kcontrol_new adcx140_dapm_dre_en_switch =
- SOC_DAPM_SINGLE("Switch", ADCX140_DSP_CFG1, 3, 1, 0);
+ SOC_DAPM_SINGLE("Switch", ADCX140_DSP_CFG1, 3, 1, 1);
/* Output Mixer */
static const struct snd_kcontrol_new adcx140_output_mixer_controls[] = {
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 02/11] ASoC: tlv320adcx140: fix null pointer
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
2025-12-17 13:54 ` [PATCH 01/11] ASoC: tlv320adcx140: invert DRE_ENABLE Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 13:58 ` Mark Brown
2025-12-17 13:54 ` [PATCH 03/11] ASoC: tlv320adcx140: Propagate error codes during probe Sascha Hauer
` (8 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil Svendsen
From: Emil Svendsen <emas@bang-olufsen.dk>
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 virtual address 0000000000000018
[ 438.232776] Mem abort info:
[ 438.235569] ESR = 0x0000000096000004
[ 438.239326] EC = 0x25: DABT (current EL), IL = 32 bits
[ 438.244646] SET = 0, FnV = 0
[ 438.247764] EA = 0, S1PTW = 0
[ 438.250906] FSC = 0x04: level 0 translation fault
[ 438.255788] Data abort info:
[ 438.258669] ISV = 0, ISS = 0x00000004
[ 438.262509] CM = 0, WnR = 0
[ 438.265482] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000046d3d000
[ 438.271929] [0000000000000018] pgd=0000000000000000, p4d=0000000000000000
[ 438.278731] Internal error: Oops: 0000000096000004 [#1] PREEMPT_RT SMP
[ 438.278739] Modules linked in: veth md4 btnxpuart crc8 moal mlan iio_rescale 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=--)
[ 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: ffff800009731c58
[ 438.278870] x26: ffff000002365b74 x25: ffff000000102205 x24: ffff00000995dba8
[ 438.278879] x23: 0000000000000000 x22: ffff000006d52080 x21: 0000000000000000
[ 438.278890] x20: 0000000000000060 x19: ffff000006c97480 x18: 0000000000000000
[ 438.278899] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000034
[ 438.278906] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000001
[ 438.278914] x11: 0000000000000000 x10: 0000000000000a50 x9 : ffff800008655f04
[ 438.278925] x8 : 0000c63716b3149c x7 : 0000000000001980 x6 : 0000000000000000
[ 438.278934] x5 : ffff800009014c60 x4 : 0000000000000000 x3 : 00000000ffffff92
[ 438.278940] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 00000000ffffff92
[ 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 <emas@bang-olufsen.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
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/tlv320adcx140.c
index 75e1007012a48a569586bc2896400e79ddce1c71..3fb1b6251e6f8b361e8f82ce6381a7e8cfcd1935 100644
--- a/sound/soc/codecs/tlv320adcx140.c
+++ b/sound/soc/codecs/tlv320adcx140.c
@@ -23,7 +23,6 @@
#include "tlv320adcx140.h"
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 *adcx140, bool power_state)
{
int pwr_ctrl = 0;
int ret = 0;
- struct snd_soc_component *component = adcx140->component;
if (power_state)
pwr_ctrl = ADCX140_PWR_CFG_ADC_PDZ | ADCX140_PWR_CFG_PLL_PDZ;
@@ -711,7 +709,7 @@ static void adcx140_pwr_ctrl(struct adcx140_priv *adcx140, bool power_state)
ret = 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);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 02/11] ASoC: tlv320adcx140: fix null pointer
2025-12-17 13:54 ` [PATCH 02/11] ASoC: tlv320adcx140: fix null pointer Sascha Hauer
@ 2025-12-17 13:58 ` Mark Brown
0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2025-12-17 13:58 UTC (permalink / raw)
To: Sascha Hauer
Cc: Shenghao Ding, Kevin Lu, Baojun Xu, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Sebastian Andrzej Siewior,
Clark Williams, Steven Rostedt, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andrew Davis, Dan Murphy, linux-sound, linux-kernel,
Kevin Lu, linux-rt-devel, devicetree, Emil Svendsen
[-- Attachment #1: Type: text/plain, Size: 827 bytes --]
On Wed, Dec 17, 2025 at 02:54:52PM +0100, Sascha Hauer wrote:
> Kernel OOPS:
> [ 438.223704] Unable to handle kernel read from unreadable memory at virtual address 0000000000000018
> [ 438.232776] Mem abort info:
> [ 438.235569] ESR = 0x0000000096000004
> [ 438.239326] EC = 0x25: DABT (current EL), IL = 32 bits
> [ 438.244646] SET = 0, FnV = 0
> [ 438.247764] EA = 0, S1PTW = 0
> [ 438.250906] FSC = 0x04: level 0 translation fault
Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative (it often is
for search engines if nothing else) then it's usually better to pull out
the relevant sections.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 03/11] ASoC: tlv320adcx140: Propagate error codes during probe
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
2025-12-17 13:54 ` [PATCH 01/11] ASoC: tlv320adcx140: invert DRE_ENABLE Sascha Hauer
2025-12-17 13:54 ` [PATCH 02/11] ASoC: tlv320adcx140: fix null pointer Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 13:54 ` [PATCH 04/11] ASoC: tlv320adcx140: fix word length Sascha Hauer
` (7 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Dimitrios Katsaros
From: Dimitrios Katsaros <patcherwork@gmail.com>
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 <patcherwork@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
sound/soc/codecs/tlv320adcx140.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index 3fb1b6251e6f8b361e8f82ce6381a7e8cfcd1935..58a6dfa228cc326d18b3c3f126732033749c8e49 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 = 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");
adcx140->supply_areg = devm_regulator_get_optional(adcx140->dev,
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 04/11] ASoC: tlv320adcx140: fix word length
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (2 preceding siblings ...)
2025-12-17 13:54 ` [PATCH 03/11] ASoC: tlv320adcx140: Propagate error codes during probe Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 13:54 ` [PATCH 05/11] ASoC: tlv320adcx140: implement register caching Sascha Hauer
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil Svendsen
From: Emil Svendsen <emas@bang-olufsen.dk>
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 driver family")
Signed-off-by: Emil Svendsen <emas@bang-olufsen.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
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/tlv320adcx140.c
index 58a6dfa228cc326d18b3c3f126732033749c8e49..fdf4a9add852deb5e879dba5c8a09458fc6e709d 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 = snd_soc_component_get_drvdata(component);
u8 data = 0;
- switch (params_width(params)) {
+ switch (params_physical_width(params)) {
case 16:
data = 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;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 05/11] ASoC: tlv320adcx140: implement register caching
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (3 preceding siblings ...)
2025-12-17 13:54 ` [PATCH 04/11] ASoC: tlv320adcx140: fix word length Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 14:11 ` Mark Brown
2025-12-17 13:54 ` [PATCH 06/11] ASoC: tlv320adcx140: add avdd and iovdd supply Sascha Hauer
` (5 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil-Juhl
From: Emil-Juhl <emdj@bang-olufsen.dk>
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 <emdj@bang-olufsen.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
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/tlv320adcx140.c
index fdf4a9add852deb5e879dba5c8a09458fc6e709d..444c0e80f0907de201ed1818b5612164a48b0fca 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[] = {
{ ADCX140_DEV_STS1, 0x80 },
};
+static const struct regmap_range adcx140_wr_ranges[] = {
+ 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 = {
+ .yes_ranges = adcx140_wr_ranges,
+ .n_yes_ranges = ARRAY_SIZE(adcx140_wr_ranges),
+};
+
static const struct regmap_range_cfg adcx140_ranges[] = {
{
.range_min = 0,
@@ -156,6 +184,7 @@ static const struct regmap_config adcx140_i2c_regmap = {
.num_ranges = ARRAY_SIZE(adcx140_ranges),
.max_register = 12 * 128,
.volatile_reg = adcx140_volatile,
+ .wr_table = &adcx140_wr_table,
};
/* 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_component *component)
return ret;
}
+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) + >= 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 >= 10 ms after entering sleep mode.
+ */
+ usleep_range(10000, 100000);
+
+ regcache_cache_only(adcx140->regmap, false);
+
+ /* Flush the regcache */
+ ret = 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 = snd_soc_component_get_drvdata(component);
+ enum snd_soc_bias_level prev_level
+ = snd_soc_component_get_bias_level(component);
switch (level) {
case SND_SOC_BIAS_ON:
case SND_SOC_BIAS_PREPARE:
+ if (prev_level == SND_SOC_BIAS_STANDBY)
+ adcx140_pwr_ctrl(adcx140, true);
+ break;
case SND_SOC_BIAS_STANDBY:
- adcx140_pwr_ctrl(adcx140, true);
+ if (prev_level == SND_SOC_BIAS_PREPARE)
+ adcx140_pwr_ctrl(adcx140, false);
+ if (prev_level == SND_SOC_BIAS_OFF)
+ return adcx140_pwr_on(adcx140);
break;
case SND_SOC_BIAS_OFF:
- adcx140_pwr_ctrl(adcx140, false);
+ if (prev_level == SND_SOC_BIAS_STANDBY)
+ return adcx140_pwr_off(adcx140);
break;
}
@@ -1186,6 +1269,8 @@ static int adcx140_i2c_probe(struct i2c_client *i2c)
return ret;
}
+ regcache_cache_only(adcx140->regmap, true);
+
i2c_set_clientdata(i2c, adcx140);
return devm_snd_soc_register_component(&i2c->dev,
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 05/11] ASoC: tlv320adcx140: implement register caching
2025-12-17 13:54 ` [PATCH 05/11] ASoC: tlv320adcx140: implement register caching Sascha Hauer
@ 2025-12-17 14:11 ` Mark Brown
0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2025-12-17 14:11 UTC (permalink / raw)
To: Sascha Hauer
Cc: Shenghao Ding, Kevin Lu, Baojun Xu, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Sebastian Andrzej Siewior,
Clark Williams, Steven Rostedt, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andrew Davis, Dan Murphy, linux-sound, linux-kernel,
Kevin Lu, linux-rt-devel, devicetree, Emil-Juhl
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]
On Wed, Dec 17, 2025 at 02:54:55PM +0100, Sascha Hauer wrote:
> 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.
This patch doesn't actually enable register caching, there's no cache
type specified. Indeed, the driver already has a register cache which
for some reason is REGCACHE_FLAT (which seems rather bogus and will have
defaulted most of the registers to 0 which may or may not be a good
idea). This looks like it's a substantial improvement but the change
doesn't correspond to the changelog.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 06/11] ASoC: tlv320adcx140: add avdd and iovdd supply
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (4 preceding siblings ...)
2025-12-17 13:54 ` [PATCH 05/11] ASoC: tlv320adcx140: implement register caching Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 13:54 ` [PATCH 07/11] ASoC: dt-bindings: " Sascha Hauer
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil-Juhl
From: Emil-Juhl <emdj@bang-olufsen.dk>
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 <emdj@bang-olufsen.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
sound/soc/codecs/tlv320adcx140.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index 444c0e80f0907de201ed1818b5612164a48b0fca..a7200e149e5f40ddd61e3c0455b796c81f55e2e8 100644
--- a/sound/soc/codecs/tlv320adcx140.c
+++ b/sound/soc/codecs/tlv320adcx140.c
@@ -22,8 +22,16 @@
#include "tlv320adcx140.h"
+static const char *const adcx140_supply_names[] = {
+ "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_component *component)
static int adcx140_pwr_off(struct adcx140_priv *adcx140)
{
+ int ret;
+
regcache_cache_only(adcx140->regmap, true);
regcache_mark_dirty(adcx140->regmap);
@@ -1117,6 +1127,14 @@ static int adcx140_pwr_off(struct adcx140_priv *adcx140)
*/
usleep_range(30000, 100000);
+ /* Power off the regulators, `avdd` and `iovdd` */
+ ret = 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;
}
@@ -1124,6 +1142,14 @@ static int adcx140_pwr_on(struct adcx140_priv *adcx140)
{
int ret;
+ /* Power on the regulators, `avdd` and `iovdd` */
+ ret = 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);
@@ -1234,6 +1260,16 @@ static int adcx140_i2c_probe(struct i2c_client *i2c)
adcx140->phase_calib_on = false;
adcx140->dev = &i2c->dev;
+ for (int i = 0; i < ADCX140_NUM_SUPPLIES; i++)
+ adcx140->supplies[i].supply = adcx140_supply_names[i];
+
+ ret = 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 = devm_gpiod_get_optional(adcx140->dev,
"reset", GPIOD_OUT_LOW);
if (IS_ERR(adcx140->gpio_reset))
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 07/11] ASoC: dt-bindings: add avdd and iovdd supply
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (5 preceding siblings ...)
2025-12-17 13:54 ` [PATCH 06/11] ASoC: tlv320adcx140: add avdd and iovdd supply Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 14:29 ` Krzysztof Kozlowski
2025-12-17 13:54 ` [PATCH 08/11] ASoC: dt-bindings: clarify areg-supply documentation Sascha Hauer
` (3 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer
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 <s.hauer@pengutronix.de>
---
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..0f043a51f1822f4d39214438818e3bc84d3e8681 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 regulator
is enabled.
+ 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.
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 07/11] ASoC: dt-bindings: add avdd and iovdd supply
2025-12-17 13:54 ` [PATCH 07/11] ASoC: dt-bindings: " Sascha Hauer
@ 2025-12-17 14:29 ` Krzysztof Kozlowski
0 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-17 14:29 UTC (permalink / raw)
To: Sascha Hauer, 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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree
On 17/12/2025 14:54, Sascha Hauer wrote:
> 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 <s.hauer@pengutronix.de>
> ---
> 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..0f043a51f1822f4d39214438818e3bc84d3e8681 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 regulator
> is enabled.
>
> + avdd-supply:
> + description: |
> + Provide a handle to the regulator supplying AVDD. If not provided, a dummy
> + regulator will be used.
Drop description, you did not say anything useful. Core already tells
this is phandle, "AVDD" duplicates property name and Linux kernel
behavior is here irrelevant.
If BSD does not create a dummy regulator, does this mean binding is wrong?
The bigger problem is that you are duplicating AVDD already described
under name areg. At least that's my impression and commit msg idd not
clarify anything here.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 08/11] ASoC: dt-bindings: clarify areg-supply documentation
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (6 preceding siblings ...)
2025-12-17 13:54 ` [PATCH 07/11] ASoC: dt-bindings: " Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 14:30 ` Krzysztof Kozlowski
2025-12-17 13:54 ` [PATCH 09/11] ASoC: tlv320adcx140: Add kcontrols for TDM Slot assignment Sascha Hauer
` (2 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil-Juhl
From: Emil-Juhl <emdj@bang-olufsen.dk>
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 <s.hauer@pengutronix.de>
---
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..0c550c04f5ef239f403bea668ffd8c6051d86821 100644
--- a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml
+++ b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml
@@ -41,8 +41,8 @@ properties:
areg-supply:
description: |
- Regulator with AVDD at 3.3V. If not defined then the internal regulator
- is enabled.
+ External supply of 1.8V. If not defined then the internal regulator is
+ enabled instead.
avdd-supply:
description: |
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 08/11] ASoC: dt-bindings: clarify areg-supply documentation
2025-12-17 13:54 ` [PATCH 08/11] ASoC: dt-bindings: clarify areg-supply documentation Sascha Hauer
@ 2025-12-17 14:30 ` Krzysztof Kozlowski
2025-12-18 14:13 ` Sascha Hauer
0 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-17 14:30 UTC (permalink / raw)
To: Sascha Hauer, 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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Emil-Juhl
On 17/12/2025 14:54, Sascha Hauer wrote:
> From: Emil-Juhl <emdj@bang-olufsen.dk>
>
> 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
>
Incomplete DCO chain.
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> 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..0c550c04f5ef239f403bea668ffd8c6051d86821 100644
> --- a/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml
> +++ b/Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml
> @@ -41,8 +41,8 @@ properties:
>
> areg-supply:
> description: |
> - Regulator with AVDD at 3.3V. If not defined then the internal regulator
> - is enabled.
> + External supply of 1.8V. If not defined then the internal regulator is
> + enabled instead.
Please re-order the patches. Fixes are always before new features and
you would solve yourself one review question...
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 08/11] ASoC: dt-bindings: clarify areg-supply documentation
2025-12-17 14:30 ` Krzysztof Kozlowski
@ 2025-12-18 14:13 ` Sascha Hauer
0 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2025-12-18 14:13 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: 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, linux-sound, linux-kernel,
Kevin Lu, linux-rt-devel, devicetree, Emil-Juhl
On Wed, Dec 17, 2025 at 03:30:39PM +0100, Krzysztof Kozlowski wrote:
> On 17/12/2025 14:54, Sascha Hauer wrote:
> > From: Emil-Juhl <emdj@bang-olufsen.dk>
> >
> > 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
> >
>
> Incomplete DCO chain.
We asked Emil to provide his signed-off-by: I'll wait for that before
sending an updated series.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 09/11] ASoC: tlv320adcx140: Add kcontrols for TDM Slot assignment
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (7 preceding siblings ...)
2025-12-17 13:54 ` [PATCH 08/11] ASoC: dt-bindings: clarify areg-supply documentation Sascha Hauer
@ 2025-12-17 13:54 ` Sascha Hauer
2025-12-17 14:13 ` Mark Brown
2025-12-17 13:55 ` [PATCH 10/11] ASoC: tlv320adcx140: add kcontrol for num biquads Sascha Hauer
2025-12-17 13:55 ` [PATCH 11/11] ASoC: tlv320adcx140: add channel sum control Sascha Hauer
10 siblings, 1 reply; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:54 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Andreas Sloth, Andreas Pehn Sloth
From: Andreas Sloth <anps@bang-olufsen.dk>
Signed-off-by: Andreas Pehn Sloth <anps@bang-olufsen.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
sound/soc/codecs/tlv320adcx140.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index a7200e149e5f40ddd61e3c0455b796c81f55e2e8..a835074d9a7898466c6854f0c0e8ab687a99c57a 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_controls[] = {
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"),
};
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 09/11] ASoC: tlv320adcx140: Add kcontrols for TDM Slot assignment
2025-12-17 13:54 ` [PATCH 09/11] ASoC: tlv320adcx140: Add kcontrols for TDM Slot assignment Sascha Hauer
@ 2025-12-17 14:13 ` Mark Brown
0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2025-12-17 14:13 UTC (permalink / raw)
To: Sascha Hauer
Cc: Shenghao Ding, Kevin Lu, Baojun Xu, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Sebastian Andrzej Siewior,
Clark Williams, Steven Rostedt, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andrew Davis, Dan Murphy, linux-sound, linux-kernel,
Kevin Lu, linux-rt-devel, devicetree, Andreas Sloth,
Andreas Pehn Sloth
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
On Wed, Dec 17, 2025 at 02:54:59PM +0100, Sascha Hauer wrote:
> From: Andreas Sloth <anps@bang-olufsen.dk>
>
> Signed-off-by: Andreas Pehn Sloth <anps@bang-olufsen.com>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
This is obviously bogus, we have an API for controlling TDM.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 10/11] ASoC: tlv320adcx140: add kcontrol for num biquads
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (8 preceding siblings ...)
2025-12-17 13:54 ` [PATCH 09/11] ASoC: tlv320adcx140: Add kcontrols for TDM Slot assignment Sascha Hauer
@ 2025-12-17 13:55 ` Sascha Hauer
2025-12-17 13:55 ` [PATCH 11/11] ASoC: tlv320adcx140: add channel sum control Sascha Hauer
10 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:55 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil-Juhl
From: Emil-Juhl <emdj@bang-olufsen.dk>
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 <emdj@bang-olufsen.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
sound/soc/codecs/tlv320adcx140.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index a835074d9a7898466c6854f0c0e8ab687a99c57a..d8b6e6fafb68bc48ce9be01e2435bfecdb5bafc8 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_controls[] = {
SOC_SINGLE("CH8_ASI_Slot", ADCX140_ASI_CH8, 0, 0x3f, 0),
ADCX140_PHASE_CALIB_SWITCH("Phase Calibration Switch"),
+
+ SOC_SINGLE("Biquads Per Channel", ADCX140_DSP_CFG1, 5, 3, 0),
};
static int adcx140_reset(struct adcx140_priv *adcx140)
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 11/11] ASoC: tlv320adcx140: add channel sum control
2025-12-17 13:54 [PATCH 00/11] sound: codecs: tlv320adcx140: assorted patches Sascha Hauer
` (9 preceding siblings ...)
2025-12-17 13:55 ` [PATCH 10/11] ASoC: tlv320adcx140: add kcontrol for num biquads Sascha Hauer
@ 2025-12-17 13:55 ` Sascha Hauer
10 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2025-12-17 13:55 UTC (permalink / raw)
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, linux-kernel, Kevin Lu, linux-rt-devel, devicetree,
Sascha Hauer, Emil Svendsen
From: Emil Svendsen <emas@bang-olufsen.dk>
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 <emas@bang-olufsen.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
sound/soc/codecs/tlv320adcx140.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index d8b6e6fafb68bc48ce9be01e2435bfecdb5bafc8..4f7d2a771a272a23050616a3a6db473f69ee752e 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[] = {
SOC_DAPM_ENUM("Decimation Filter", decimation_filter_enum),
};
+static const char * const channel_summation_text[] = {
+ "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[] = {
"2.8224 MHz", "1.4112 MHz", "705.6 kHz", "5.6448 MHz"
};
@@ -721,6 +728,8 @@ static const struct snd_kcontrol_new adcx140_snd_controls[] = {
ADCX140_PHASE_CALIB_SWITCH("Phase Calibration Switch"),
SOC_SINGLE("Biquads Per Channel", ADCX140_DSP_CFG1, 5, 3, 0),
+
+ SOC_ENUM("Channel Summation", channel_summation_enum),
};
static int adcx140_reset(struct adcx140_priv *adcx140)
--
2.47.3
^ permalink raw reply related [flat|nested] 18+ messages in thread