* [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check
@ 2025-11-17 5:15 Jonathan Marek
2025-11-17 5:15 ` [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence Jonathan Marek
` (9 more replies)
0 siblings, 10 replies; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
WSA_MACRO_RX0 is 0 and WSA_MACRO_RX_MIX1 is (WSA_MACRO_RX_MAX-1), which
means it is not possible for the bounds check to fail.
Removing the WSA_MACRO_RX_MIX1 limit is needed to add support for other
ports (RX4, RX5, etc.), in which case the valid range depends on the HW
version: rely on the driver only setting valid ports in active_ch_mask
instead (already the case).
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 38faa9074ca3e..6e54c1beac8f9 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -1168,12 +1168,6 @@ static int wsa_macro_set_prim_interpolator_rate(struct snd_soc_dai *dai,
for_each_set_bit(port, &wsa->active_ch_mask[dai->id], WSA_MACRO_RX_MAX) {
int_1_mix1_inp = port;
- if ((int_1_mix1_inp < WSA_MACRO_RX0) || (int_1_mix1_inp > WSA_MACRO_RX_MIX1)) {
- dev_err(component->dev, "%s: Invalid RX port, Dai ID is %d\n",
- __func__, dai->id);
- return -EINVAL;
- }
-
int_mux_cfg0 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG0;
/*
@@ -1220,11 +1214,6 @@ static int wsa_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai,
for_each_set_bit(port, &wsa->active_ch_mask[dai->id], WSA_MACRO_RX_MAX) {
int_2_inp = port;
- if ((int_2_inp < WSA_MACRO_RX0) || (int_2_inp > WSA_MACRO_RX_MIX1)) {
- dev_err(component->dev, "%s: Invalid RX port, Dai ID is %d\n",
- __func__, dai->id);
- return -EINVAL;
- }
int_mux_cfg1 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG1;
for (j = 0; j < NUM_INTERPOLATORS; j++) {
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:36 ` Srinivas Kandagatla
2025-11-19 15:36 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 3/9] ASoC: codecs: lpass-wsa-macro: remove mix path event Jonathan Marek
` (8 subsequent siblings)
9 siblings, 2 replies; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
Reading and writing the same value to this register does nothing.
Looking at downstream driver it seems there was meant to be an offset added
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 6e54c1beac8f9..6f16d54aee401 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -1567,17 +1567,14 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
- u16 path_reg, gain_reg;
- int val;
+ u16 path_reg;
switch (w->shift) {
case WSA_MACRO_RX_MIX0:
path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL;
- gain_reg = CDC_WSA_RX0_RX_VOL_MIX_CTL;
break;
case WSA_MACRO_RX_MIX1:
path_reg = CDC_WSA_RX1_RX_PATH_MIX_CTL;
- gain_reg = CDC_WSA_RX1_RX_VOL_MIX_CTL;
break;
default:
return 0;
@@ -1585,8 +1582,6 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_POST_PMU:
- val = snd_soc_component_read(component, gain_reg);
- snd_soc_component_write(component, gain_reg, val);
break;
case SND_SOC_DAPM_POST_PMD:
snd_soc_component_update_bits(component, path_reg,
@@ -1931,7 +1926,6 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
u16 gain_reg;
u16 reg;
- int val;
struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
if (w->shift == WSA_MACRO_COMP1) {
@@ -1971,8 +1965,6 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
CDC_WSA_RX_PGA_HALF_DB_MASK,
CDC_WSA_RX_PGA_HALF_DB_ENABLE);
}
- val = snd_soc_component_read(component, gain_reg);
- snd_soc_component_write(component, gain_reg, val);
wsa_macro_config_ear_spkr_gain(component, wsa,
event, gain_reg);
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 3/9] ASoC: codecs: lpass-wsa-macro: remove mix path event
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
2025-11-17 5:15 ` [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 4/9] ASoC: codecs: lpass-wsa-macro: fix path clock dependencies Jonathan Marek
` (7 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
All it does it disable the mix path clk bit, but this is already managed by
the WSA_RX_MIX0_CLK/WSA_RX_MIX1_CLK supplies.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 46 +++---------------------------
1 file changed, 4 insertions(+), 42 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 6f16d54aee401..06570e474c850 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -1563,36 +1563,6 @@ static int wsa_macro_enable_vi_feedback(struct snd_soc_dapm_widget *w,
return 0;
}
-static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
- u16 path_reg;
-
- switch (w->shift) {
- case WSA_MACRO_RX_MIX0:
- path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL;
- break;
- case WSA_MACRO_RX_MIX1:
- path_reg = CDC_WSA_RX1_RX_PATH_MIX_CTL;
- break;
- default:
- return 0;
- }
-
- switch (event) {
- case SND_SOC_DAPM_POST_PMU:
- break;
- case SND_SOC_DAPM_POST_PMD:
- snd_soc_component_update_bits(component, path_reg,
- CDC_WSA_RX_PATH_MIX_CLK_EN_MASK,
- CDC_WSA_RX_PATH_MIX_CLK_DISABLE);
- break;
- }
-
- return 0;
-}
-
static void wsa_macro_hd2_control(struct snd_soc_component *component,
u16 reg, int event)
{
@@ -2475,30 +2445,22 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets_v2_1[] = {
SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux_v2_1),
SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux_v2_1),
SND_SOC_DAPM_MUX("WSA_RX0 INP2", SND_SOC_NOPM, 0, 0, &rx0_prim_inp2_mux_v2_1),
- SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX0,
- 0, &rx0_mix_mux_v2_1, wsa_macro_enable_mix_path,
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_MUX("WSA_RX0 MIX INP", SND_SOC_NOPM, 0, 0, &rx0_mix_mux_v2_1),
SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux_v2_1),
SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux_v2_1),
SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux_v2_1),
- SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX1,
- 0, &rx1_mix_mux_v2_1, wsa_macro_enable_mix_path,
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_MUX("WSA_RX1 MIX INP", SND_SOC_NOPM, 0, 0, &rx1_mix_mux_v2_1),
};
static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets_v2_5[] = {
SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux_v2_5),
SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux_v2_5),
SND_SOC_DAPM_MUX("WSA_RX0 INP2", SND_SOC_NOPM, 0, 0, &rx0_prim_inp2_mux_v2_5),
- SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX0,
- 0, &rx0_mix_mux_v2_5, wsa_macro_enable_mix_path,
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_MUX("WSA_RX0 MIX INP", SND_SOC_NOPM, 0, 0, &rx0_mix_mux_v2_5),
SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux_v2_5),
SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux_v2_5),
SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux_v2_5),
- SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX1,
- 0, &rx1_mix_mux_v2_5, wsa_macro_enable_mix_path,
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_MUX("WSA_RX1 MIX INP", SND_SOC_NOPM, 0, 0, &rx1_mix_mux_v2_5),
};
static const struct snd_soc_dapm_route wsa_audio_map[] = {
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 4/9] ASoC: codecs: lpass-wsa-macro: fix path clock dependencies
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
2025-11-17 5:15 ` [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence Jonathan Marek
2025-11-17 5:15 ` [PATCH 3/9] ASoC: codecs: lpass-wsa-macro: remove mix path event Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 5/9] ASoC: codecs: lpass-wsa-macro: add volume controls for mix path Jonathan Marek
` (6 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
"WSA_RX0_CLK",etc. are path clocks, but "WSA RX0",etc. are ports, and there
isn't a correspondence between the ports and paths.
For example "WSA RX0" port could be used by the "RX1 MIX" path.
The problem becomes obvious when RX4,etc. ports are added.
Enabling the path clocks should depend on the path being enabled.
With this fix, the main path clock will be enabled whenever the path is
active: previously using the mix ports only would only activate the mix
path clock and no audio would play.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 06570e474c850..27c8c060cab19 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -2496,10 +2496,8 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
{"WSA RX_MIX0", NULL, "WSA RX_MIX0 MUX"},
{"WSA RX_MIX1", NULL, "WSA RX_MIX1 MUX"},
- {"WSA RX0", NULL, "WSA_RX0_CLK"},
- {"WSA RX1", NULL, "WSA_RX1_CLK"},
- {"WSA RX_MIX0", NULL, "WSA_RX_MIX0_CLK"},
- {"WSA RX_MIX1", NULL, "WSA_RX_MIX1_CLK"},
+ {"WSA_RX INT0 MIX", NULL, "WSA_RX0_CLK"},
+ {"WSA_RX INT1 MIX", NULL, "WSA_RX1_CLK"},
{"WSA_RX0 INP0", "RX0", "WSA RX0"},
{"WSA_RX0 INP0", "RX1", "WSA RX1"},
@@ -2529,6 +2527,8 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
{"WSA_RX0 MIX INP", "RX1", "WSA RX1"},
{"WSA_RX0 MIX INP", "RX_MIX0", "WSA RX_MIX0"},
{"WSA_RX0 MIX INP", "RX_MIX1", "WSA RX_MIX1"},
+ {"WSA_RX0 MIX INP", NULL, "WSA_RX0_CLK"},
+ {"WSA_RX0 MIX INP", NULL, "WSA_RX_MIX0_CLK"},
{"WSA_RX INT0 SEC MIX", NULL, "WSA_RX0 MIX INP"},
{"WSA_RX INT0 SEC MIX", NULL, "WSA_RX INT0 MIX"},
@@ -2568,6 +2568,8 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
{"WSA_RX1 MIX INP", "RX1", "WSA RX1"},
{"WSA_RX1 MIX INP", "RX_MIX0", "WSA RX_MIX0"},
{"WSA_RX1 MIX INP", "RX_MIX1", "WSA RX_MIX1"},
+ {"WSA_RX1 MIX INP", NULL, "WSA_RX1_CLK"},
+ {"WSA_RX1 MIX INP", NULL, "WSA_RX_MIX1_CLK"},
{"WSA_RX INT1 SEC MIX", NULL, "WSA_RX1 MIX INP"},
{"WSA_RX INT1 SEC MIX", NULL, "WSA_RX INT1 MIX"},
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 5/9] ASoC: codecs: lpass-wsa-macro: add volume controls for mix path
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
` (2 preceding siblings ...)
2025-11-17 5:15 ` [PATCH 4/9] ASoC: codecs: lpass-wsa-macro: fix path clock dependencies Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 6/9] ASoC: codecs: lpass-wsa-macro: remove main path event Jonathan Marek
` (5 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
This allows changing the mix gain registers from the default value.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 27c8c060cab19..2a814a5d2d1f0 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -2248,6 +2248,10 @@ static const struct snd_kcontrol_new wsa_macro_snd_controls[] = {
-84, 40, digital_gain),
SOC_SINGLE_S8_TLV("WSA_RX1 Digital Volume", CDC_WSA_RX1_RX_VOL_CTL,
-84, 40, digital_gain),
+ SOC_SINGLE_S8_TLV("WSA_RX0_MIX Digital Volume", CDC_WSA_RX0_RX_VOL_MIX_CTL,
+ -84, 40, digital_gain),
+ SOC_SINGLE_S8_TLV("WSA_RX1_MIX Digital Volume", CDC_WSA_RX1_RX_VOL_MIX_CTL,
+ -84, 40, digital_gain),
SOC_SINGLE("WSA_RX0 Digital Mute", CDC_WSA_RX0_RX_PATH_CTL, 4, 1, 0),
SOC_SINGLE("WSA_RX1 Digital Mute", CDC_WSA_RX1_RX_PATH_CTL, 4, 1, 0),
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 6/9] ASoC: codecs: lpass-wsa-macro: remove main path event
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
` (3 preceding siblings ...)
2025-11-17 5:15 ` [PATCH 5/9] ASoC: codecs: lpass-wsa-macro: add volume controls for mix path Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 7/9] ASoC: codecs: lpass-wsa-macro: add RX4 and RX5 Jonathan Marek
` (4 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
The event enables the main path clock when the mux is set to DEC0/DEC1.
My patch ("ASoC: codecs: lpass-wsa-macro: fix path clock dependencies")
makes it depend on the main path clock, so this event is now redundant.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 59 +-----------------------------
1 file changed, 2 insertions(+), 57 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 2a814a5d2d1f0..e2e78ff6dd54e 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -1726,59 +1726,6 @@ static int wsa_macro_config_softclip(struct snd_soc_component *component,
return 0;
}
-static bool wsa_macro_adie_lb(struct snd_soc_component *component,
- int interp_idx)
-{
- struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
- u16 int_mux_cfg0, int_mux_cfg1;
- u8 int_n_inp0, int_n_inp1, int_n_inp2;
-
- int_mux_cfg0 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG0 + interp_idx * 8;
- int_mux_cfg1 = int_mux_cfg0 + 4;
-
- int_n_inp0 = snd_soc_component_read_field(component, int_mux_cfg0,
- wsa->reg_layout->rx_intx_1_mix_inp0_sel_mask);
- if (int_n_inp0 == INTn_1_INP_SEL_DEC0 ||
- int_n_inp0 == INTn_1_INP_SEL_DEC1)
- return true;
-
- int_n_inp1 = snd_soc_component_read_field(component, int_mux_cfg0,
- wsa->reg_layout->rx_intx_1_mix_inp1_sel_mask);
- if (int_n_inp1 == INTn_1_INP_SEL_DEC0 ||
- int_n_inp1 == INTn_1_INP_SEL_DEC1)
- return true;
-
- int_n_inp2 = snd_soc_component_read_field(component, int_mux_cfg1,
- wsa->reg_layout->rx_intx_1_mix_inp2_sel_mask);
- if (int_n_inp2 == INTn_1_INP_SEL_DEC0 ||
- int_n_inp2 == INTn_1_INP_SEL_DEC1)
- return true;
-
- return false;
-}
-
-static int wsa_macro_enable_main_path(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol,
- int event)
-{
- struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
- u16 reg;
-
- reg = CDC_WSA_RX0_RX_PATH_CTL + WSA_MACRO_RX_PATH_OFFSET * w->shift;
- switch (event) {
- case SND_SOC_DAPM_PRE_PMU:
- if (wsa_macro_adie_lb(component, w->shift)) {
- snd_soc_component_update_bits(component, reg,
- CDC_WSA_RX_PATH_CLK_EN_MASK,
- CDC_WSA_RX_PATH_CLK_ENABLE);
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
static int wsa_macro_interp_get_primary_reg(u16 reg, u16 *ind)
{
u16 prim_int_reg = 0;
@@ -2395,10 +2342,8 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets[] = {
SND_SOC_DAPM_MIXER("WSA RX_MIX0", SND_SOC_NOPM, 0, 0, NULL, 0),
SND_SOC_DAPM_MIXER("WSA RX_MIX1", SND_SOC_NOPM, 0, 0, NULL, 0),
- SND_SOC_DAPM_MIXER_E("WSA_RX INT0 MIX", SND_SOC_NOPM, 0, 0, NULL, 0,
- wsa_macro_enable_main_path, SND_SOC_DAPM_PRE_PMU),
- SND_SOC_DAPM_MIXER_E("WSA_RX INT1 MIX", SND_SOC_NOPM, 1, 0, NULL, 0,
- wsa_macro_enable_main_path, SND_SOC_DAPM_PRE_PMU),
+ SND_SOC_DAPM_MIXER("WSA_RX INT0 MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
+ SND_SOC_DAPM_MIXER("WSA_RX INT1 MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
SND_SOC_DAPM_MIXER("WSA_RX INT0 SEC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
SND_SOC_DAPM_MIXER("WSA_RX INT1 SEC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 7/9] ASoC: codecs: lpass-wsa-macro: add RX4 and RX5
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
` (4 preceding siblings ...)
2025-11-17 5:15 ` [PATCH 6/9] ASoC: codecs: lpass-wsa-macro: remove main path event Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:33 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 8/9] ASoC: codecs: lpass-wsa-macro: remove unused WSA_MACRO_RX_MIX enum Jonathan Marek
` (3 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
This allows playback using the WSA_2CH AIF, which feeds RX4 and RX5 on both
WSA and WSA2.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 48 ++++++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index e2e78ff6dd54e..f02153108c275 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -300,6 +300,8 @@ enum {
WSA_MACRO_RX_MIX,
WSA_MACRO_RX_MIX0 = WSA_MACRO_RX_MIX,
WSA_MACRO_RX_MIX1,
+ WSA_MACRO_RX4,
+ WSA_MACRO_RX5,
WSA_MACRO_RX_MAX,
};
@@ -2228,6 +2230,10 @@ static const struct snd_kcontrol_new rx_mux[WSA_MACRO_RX_MAX] = {
wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
SOC_DAPM_ENUM_EXT("WSA RX_MIX1 Mux", rx_mux_enum,
wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
+ SOC_DAPM_ENUM_EXT("WSA RX4 Mux", rx_mux_enum,
+ wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
+ SOC_DAPM_ENUM_EXT("WSA RX5 Mux", rx_mux_enum,
+ wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
};
static int wsa_macro_vi_feed_mixer_get(struct snd_kcontrol *kcontrol,
@@ -2410,6 +2416,10 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets_v2_5[] = {
SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux_v2_5),
SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux_v2_5),
SND_SOC_DAPM_MUX("WSA_RX1 MIX INP", SND_SOC_NOPM, 0, 0, &rx1_mix_mux_v2_5),
+ SND_SOC_DAPM_MIXER("WSA RX4", SND_SOC_NOPM, 0, 0, NULL, 0),
+ SND_SOC_DAPM_MIXER("WSA RX5", SND_SOC_NOPM, 0, 0, NULL, 0),
+ SND_SOC_DAPM_MUX("WSA RX4 MUX", SND_SOC_NOPM, WSA_MACRO_RX4, 0, &rx_mux[WSA_MACRO_RX4]),
+ SND_SOC_DAPM_MUX("WSA RX5 MUX", SND_SOC_NOPM, WSA_MACRO_RX5, 0, &rx_mux[WSA_MACRO_RX5]),
};
static const struct snd_soc_dapm_route wsa_audio_map[] = {
@@ -2529,6 +2539,31 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
{"WSA_SPK2 OUT", NULL, "WSA_MCLK"},
};
+static const struct snd_soc_dapm_route wsa_audio_map_v2_5[] = {
+ {"WSA RX4 MUX", "AIF1_PB", "WSA AIF1 PB"},
+ {"WSA RX5 MUX", "AIF1_PB", "WSA AIF1 PB"},
+ {"WSA RX4 MUX", "AIF_MIX1_PB", "WSA AIF_MIX1 PB"},
+ {"WSA RX5 MUX", "AIF_MIX1_PB", "WSA AIF_MIX1 PB"},
+ {"WSA RX4", NULL, "WSA RX4 MUX"},
+ {"WSA RX5", NULL, "WSA RX5 MUX"},
+ {"WSA_RX0 INP0", "RX4", "WSA RX4"},
+ {"WSA_RX0 INP0", "RX5", "WSA RX5"},
+ {"WSA_RX0 INP1", "RX4", "WSA RX4"},
+ {"WSA_RX0 INP1", "RX5", "WSA RX5"},
+ {"WSA_RX0 INP2", "RX4", "WSA RX4"},
+ {"WSA_RX0 INP2", "RX5", "WSA RX5"},
+ {"WSA_RX0 MIX INP", "RX4", "WSA RX4"},
+ {"WSA_RX0 MIX INP", "RX5", "WSA RX5"},
+ {"WSA_RX1 INP0", "RX4", "WSA RX4"},
+ {"WSA_RX1 INP0", "RX5", "WSA RX5"},
+ {"WSA_RX1 INP1", "RX4", "WSA RX4"},
+ {"WSA_RX1 INP1", "RX5", "WSA RX5"},
+ {"WSA_RX1 INP2", "RX4", "WSA RX4"},
+ {"WSA_RX1 INP2", "RX5", "WSA RX5"},
+ {"WSA_RX1 MIX INP", "RX4", "WSA RX4"},
+ {"WSA_RX1 MIX INP", "RX5", "WSA RX5"},
+};
+
static int wsa_swrm_clock(struct wsa_macro *wsa, bool enable)
{
struct regmap *regmap = wsa->regmap;
@@ -2562,7 +2597,9 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(comp);
struct wsa_macro *wsa = snd_soc_component_get_drvdata(comp);
const struct snd_soc_dapm_widget *widgets;
- unsigned int num_widgets;
+ const struct snd_soc_dapm_route *routes;
+ unsigned int num_widgets, num_routes;
+ int ret;
snd_soc_component_init_regmap(comp, wsa->regmap);
@@ -2587,6 +2624,7 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
case LPASS_CODEC_VERSION_2_1:
widgets = wsa_macro_dapm_widgets_v2_1;
num_widgets = ARRAY_SIZE(wsa_macro_dapm_widgets_v2_1);
+ num_routes = 0;
break;
case LPASS_CODEC_VERSION_2_5:
case LPASS_CODEC_VERSION_2_6:
@@ -2595,12 +2633,18 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
case LPASS_CODEC_VERSION_2_9:
widgets = wsa_macro_dapm_widgets_v2_5;
num_widgets = ARRAY_SIZE(wsa_macro_dapm_widgets_v2_5);
+ routes = wsa_audio_map_v2_5;
+ num_routes = ARRAY_SIZE(wsa_audio_map_v2_5);
break;
default:
return -EINVAL;
}
- return snd_soc_dapm_new_controls(dapm, widgets, num_widgets);
+ ret = snd_soc_dapm_new_controls(dapm, widgets, num_widgets);
+ if (ret)
+ return ret;
+
+ return snd_soc_dapm_add_routes(dapm, routes, num_routes);
}
static int swclk_gate_enable(struct clk_hw *hw)
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 8/9] ASoC: codecs: lpass-wsa-macro: remove unused WSA_MACRO_RX_MIX enum
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
` (5 preceding siblings ...)
2025-11-17 5:15 ` [PATCH 7/9] ASoC: codecs: lpass-wsa-macro: add RX4 and RX5 Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:33 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 9/9] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths Jonathan Marek
` (2 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
Minor cleanup.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-wsa-macro.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index f02153108c275..694ee3ceda986 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -297,8 +297,7 @@ enum {
enum {
WSA_MACRO_RX0 = 0,
WSA_MACRO_RX1,
- WSA_MACRO_RX_MIX,
- WSA_MACRO_RX_MIX0 = WSA_MACRO_RX_MIX,
+ WSA_MACRO_RX_MIX0,
WSA_MACRO_RX_MIX1,
WSA_MACRO_RX4,
WSA_MACRO_RX5,
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 9/9] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
` (6 preceding siblings ...)
2025-11-17 5:15 ` [PATCH 8/9] ASoC: codecs: lpass-wsa-macro: remove unused WSA_MACRO_RX_MIX enum Jonathan Marek
@ 2025-11-17 5:15 ` Jonathan Marek
2025-11-19 15:33 ` Srinivas Kandagatla
2025-11-19 15:35 ` [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Srinivas Kandagatla
2025-11-20 9:40 ` (subset) " Mark Brown
9 siblings, 1 reply; 21+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:15 UTC (permalink / raw)
To: linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
The current mute_steam() implementation affects all paths instead of
only those in use by the DAI.
For example, playing to 2 DAIs simultaneously with mixing, stopping
one will mute the other.
Rework to use the same logic as hw_params() to mute only the relevant paths.
(also, use "rx->main_clk_users[j] > 0" instead of dsm_reg, which is
equivalent. I also don't think the clock enable should be in this function,
but that's a change for another patch)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
sound/soc/codecs/lpass-rx-macro.c | 74 +++++++++++++++----------------
1 file changed, 35 insertions(+), 39 deletions(-)
diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index a8fc842cc94ef..d7e51f02a9115 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -1905,52 +1905,48 @@ static int rx_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
{
struct snd_soc_component *component = dai->component;
struct rx_macro *rx = snd_soc_component_get_drvdata(component);
- uint16_t j, reg, mix_reg, dsm_reg;
- u16 int_mux_cfg0, int_mux_cfg1;
+ u32 port, j, reg, mix_reg, int_mux_cfg0, int_mux_cfg1;
+ u32 mask, val;
u8 int_mux_cfg0_val, int_mux_cfg1_val;
- switch (dai->id) {
- case RX_MACRO_AIF1_PB:
- case RX_MACRO_AIF2_PB:
- case RX_MACRO_AIF3_PB:
- case RX_MACRO_AIF4_PB:
- for (j = 0; j < INTERP_MAX; j++) {
- reg = CDC_RX_RXn_RX_PATH_CTL(rx, j);
- mix_reg = CDC_RX_RXn_RX_PATH_MIX_CTL(rx, j);
- dsm_reg = CDC_RX_RXn_RX_PATH_DSM_CTL(rx, j);
-
- if (mute) {
- snd_soc_component_update_bits(component, reg,
- CDC_RX_PATH_PGA_MUTE_MASK,
- CDC_RX_PATH_PGA_MUTE_ENABLE);
- snd_soc_component_update_bits(component, mix_reg,
- CDC_RX_PATH_PGA_MUTE_MASK,
- CDC_RX_PATH_PGA_MUTE_ENABLE);
- } else {
- snd_soc_component_update_bits(component, reg,
- CDC_RX_PATH_PGA_MUTE_MASK, 0x0);
- snd_soc_component_update_bits(component, mix_reg,
- CDC_RX_PATH_PGA_MUTE_MASK, 0x0);
+ if (stream != SNDRV_PCM_STREAM_PLAYBACK)
+ return 0;
+
+ for (j = 0; j < INTERP_MAX; j++) {
+ reg = CDC_RX_RXn_RX_PATH_CTL(rx, j);
+ mix_reg = CDC_RX_RXn_RX_PATH_MIX_CTL(rx, j);
+
+ mask = CDC_RX_PATH_PGA_MUTE_MASK;
+ val = 0;
+ if (mute)
+ val |= CDC_RX_PATH_PGA_MUTE_ENABLE;
+ if (rx->main_clk_users[j] > 0) {
+ mask |= CDC_RX_PATH_CLK_EN_MASK;
+ val |= CDC_RX_PATH_CLK_ENABLE;
+ }
+
+ int_mux_cfg0 = CDC_RX_INP_MUX_RX_INT0_CFG0 + j * 8;
+ int_mux_cfg1 = int_mux_cfg0 + 4;
+ int_mux_cfg0_val = snd_soc_component_read(component, int_mux_cfg0);
+ int_mux_cfg1_val = snd_soc_component_read(component, int_mux_cfg1);
+
+ for_each_set_bit(port, &rx->active_ch_mask[dai->id], RX_MACRO_PORTS_MAX) {
+ if (((int_mux_cfg0_val & 0x0f) == port + INTn_1_INP_SEL_RX0) ||
+ ((int_mux_cfg0_val >> 4) == port + INTn_1_INP_SEL_RX0) ||
+ ((int_mux_cfg1_val >> 4) == port + INTn_1_INP_SEL_RX0)) {
+ snd_soc_component_update_bits(component, reg, mask, val);
}
- int_mux_cfg0 = CDC_RX_INP_MUX_RX_INT0_CFG0 + j * 8;
- int_mux_cfg1 = int_mux_cfg0 + 4;
- int_mux_cfg0_val = snd_soc_component_read(component, int_mux_cfg0);
- int_mux_cfg1_val = snd_soc_component_read(component, int_mux_cfg1);
-
- if (snd_soc_component_read(component, dsm_reg) & 0x01) {
- if (int_mux_cfg0_val || (int_mux_cfg1_val & 0xF0))
- snd_soc_component_update_bits(component, reg, 0x20, 0x20);
- if (int_mux_cfg1_val & 0x0F) {
- snd_soc_component_update_bits(component, reg, 0x20, 0x20);
- snd_soc_component_update_bits(component, mix_reg, 0x20,
- 0x20);
+ if ((int_mux_cfg1_val & 0x0f) == port + INTn_2_INP_SEL_RX0) {
+ snd_soc_component_update_bits(component, mix_reg, mask, val);
+ /* main clock needs to be enabled for mix to be useful: */
+ if (rx->main_clk_users[j] > 0) {
+ snd_soc_component_update_bits(component, reg,
+ CDC_RX_PATH_CLK_EN_MASK,
+ CDC_RX_PATH_CLK_ENABLE);
}
}
}
- break;
- default:
- break;
}
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 9/9] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths
2025-11-17 5:15 ` [PATCH 9/9] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths Jonathan Marek
@ 2025-11-19 15:33 ` Srinivas Kandagatla
0 siblings, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:33 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> The current mute_steam() implementation affects all paths instead of
> only those in use by the DAI.
>
> For example, playing to 2 DAIs simultaneously with mixing, stopping
> one will mute the other.
>
> Rework to use the same logic as hw_params() to mute only the relevant paths.
> (also, use "rx->main_clk_users[j] > 0" instead of dsm_reg, which is
> equivalent. I also don't think the clock enable should be in this function,
> but that's a change for another patch)
I agree, we can move the clk to a widget.
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
patch looks sane to me,
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> sound/soc/codecs/lpass-rx-macro.c | 74 +++++++++++++++----------------
> 1 file changed, 35 insertions(+), 39 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
> index a8fc842cc94ef..d7e51f02a9115 100644
> --- a/sound/soc/codecs/lpass-rx-macro.c
> +++ b/sound/soc/codecs/lpass-rx-macro.c
> @@ -1905,52 +1905,48 @@ static int rx_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
> {
> struct snd_soc_component *component = dai->component;
> struct rx_macro *rx = snd_soc_component_get_drvdata(component);
> - uint16_t j, reg, mix_reg, dsm_reg;
> - u16 int_mux_cfg0, int_mux_cfg1;
> + u32 port, j, reg, mix_reg, int_mux_cfg0, int_mux_cfg1;
> + u32 mask, val;
> u8 int_mux_cfg0_val, int_mux_cfg1_val;
>
> - switch (dai->id) {
> - case RX_MACRO_AIF1_PB:
> - case RX_MACRO_AIF2_PB:
> - case RX_MACRO_AIF3_PB:
> - case RX_MACRO_AIF4_PB:
> - for (j = 0; j < INTERP_MAX; j++) {
> - reg = CDC_RX_RXn_RX_PATH_CTL(rx, j);
> - mix_reg = CDC_RX_RXn_RX_PATH_MIX_CTL(rx, j);
> - dsm_reg = CDC_RX_RXn_RX_PATH_DSM_CTL(rx, j);
> -
> - if (mute) {
> - snd_soc_component_update_bits(component, reg,
> - CDC_RX_PATH_PGA_MUTE_MASK,
> - CDC_RX_PATH_PGA_MUTE_ENABLE);
> - snd_soc_component_update_bits(component, mix_reg,
> - CDC_RX_PATH_PGA_MUTE_MASK,
> - CDC_RX_PATH_PGA_MUTE_ENABLE);
> - } else {
> - snd_soc_component_update_bits(component, reg,
> - CDC_RX_PATH_PGA_MUTE_MASK, 0x0);
> - snd_soc_component_update_bits(component, mix_reg,
> - CDC_RX_PATH_PGA_MUTE_MASK, 0x0);
> + if (stream != SNDRV_PCM_STREAM_PLAYBACK)
> + return 0;
> +
> + for (j = 0; j < INTERP_MAX; j++) {
> + reg = CDC_RX_RXn_RX_PATH_CTL(rx, j);
> + mix_reg = CDC_RX_RXn_RX_PATH_MIX_CTL(rx, j);
> +
> + mask = CDC_RX_PATH_PGA_MUTE_MASK;
> + val = 0;
> + if (mute)
> + val |= CDC_RX_PATH_PGA_MUTE_ENABLE;
> + if (rx->main_clk_users[j] > 0) {
> + mask |= CDC_RX_PATH_CLK_EN_MASK;
> + val |= CDC_RX_PATH_CLK_ENABLE;
> + }
> +
> + int_mux_cfg0 = CDC_RX_INP_MUX_RX_INT0_CFG0 + j * 8;
> + int_mux_cfg1 = int_mux_cfg0 + 4;
> + int_mux_cfg0_val = snd_soc_component_read(component, int_mux_cfg0);
> + int_mux_cfg1_val = snd_soc_component_read(component, int_mux_cfg1);
> +
> + for_each_set_bit(port, &rx->active_ch_mask[dai->id], RX_MACRO_PORTS_MAX) {
> + if (((int_mux_cfg0_val & 0x0f) == port + INTn_1_INP_SEL_RX0) ||
> + ((int_mux_cfg0_val >> 4) == port + INTn_1_INP_SEL_RX0) ||
> + ((int_mux_cfg1_val >> 4) == port + INTn_1_INP_SEL_RX0)) {
> + snd_soc_component_update_bits(component, reg, mask, val);
> }
>
> - int_mux_cfg0 = CDC_RX_INP_MUX_RX_INT0_CFG0 + j * 8;
> - int_mux_cfg1 = int_mux_cfg0 + 4;
> - int_mux_cfg0_val = snd_soc_component_read(component, int_mux_cfg0);
> - int_mux_cfg1_val = snd_soc_component_read(component, int_mux_cfg1);
> -
> - if (snd_soc_component_read(component, dsm_reg) & 0x01) {
> - if (int_mux_cfg0_val || (int_mux_cfg1_val & 0xF0))
> - snd_soc_component_update_bits(component, reg, 0x20, 0x20);
> - if (int_mux_cfg1_val & 0x0F) {
> - snd_soc_component_update_bits(component, reg, 0x20, 0x20);
> - snd_soc_component_update_bits(component, mix_reg, 0x20,
> - 0x20);
> + if ((int_mux_cfg1_val & 0x0f) == port + INTn_2_INP_SEL_RX0) {
> + snd_soc_component_update_bits(component, mix_reg, mask, val);
> + /* main clock needs to be enabled for mix to be useful: */
> + if (rx->main_clk_users[j] > 0) {
> + snd_soc_component_update_bits(component, reg,
> + CDC_RX_PATH_CLK_EN_MASK,
> + CDC_RX_PATH_CLK_ENABLE);
> }
> }
> }
> - break;
> - default:
> - break;
> }
> return 0;
> }
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 8/9] ASoC: codecs: lpass-wsa-macro: remove unused WSA_MACRO_RX_MIX enum
2025-11-17 5:15 ` [PATCH 8/9] ASoC: codecs: lpass-wsa-macro: remove unused WSA_MACRO_RX_MIX enum Jonathan Marek
@ 2025-11-19 15:33 ` Srinivas Kandagatla
0 siblings, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:33 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> Minor cleanup.
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
lgtm
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> sound/soc/codecs/lpass-wsa-macro.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index f02153108c275..694ee3ceda986 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -297,8 +297,7 @@ enum {
> enum {
> WSA_MACRO_RX0 = 0,
> WSA_MACRO_RX1,
> - WSA_MACRO_RX_MIX,
> - WSA_MACRO_RX_MIX0 = WSA_MACRO_RX_MIX,
> + WSA_MACRO_RX_MIX0,
> WSA_MACRO_RX_MIX1,
> WSA_MACRO_RX4,
> WSA_MACRO_RX5,
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/9] ASoC: codecs: lpass-wsa-macro: add RX4 and RX5
2025-11-17 5:15 ` [PATCH 7/9] ASoC: codecs: lpass-wsa-macro: add RX4 and RX5 Jonathan Marek
@ 2025-11-19 15:33 ` Srinivas Kandagatla
2025-11-19 17:13 ` Jonathan Marek
0 siblings, 1 reply; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:33 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> This allows playback using the WSA_2CH AIF, which feeds RX4 and RX5 on both
> WSA and WSA2.
Which SoC have you verified this on?
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
> sound/soc/codecs/lpass-wsa-macro.c | 48 ++++++++++++++++++++++++++++--
> 1 file changed, 46 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index e2e78ff6dd54e..f02153108c275 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -300,6 +300,8 @@ enum {
> WSA_MACRO_RX_MIX,
> WSA_MACRO_RX_MIX0 = WSA_MACRO_RX_MIX,
> WSA_MACRO_RX_MIX1,
While you are at it, can you add RX2 and RX3, its same for both
rx_primary and rx_mix
> + WSA_MACRO_RX4,
> + WSA_MACRO_RX5,
> WSA_MACRO_RX_MAX,
> };
>
> @@ -2228,6 +2230,10 @@ static const struct snd_kcontrol_new rx_mux[WSA_MACRO_RX_MAX] = {
> wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
> SOC_DAPM_ENUM_EXT("WSA RX_MIX1 Mux", rx_mux_enum,
> wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
> + SOC_DAPM_ENUM_EXT("WSA RX4 Mux", rx_mux_enum,
> + wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
> + SOC_DAPM_ENUM_EXT("WSA RX5 Mux", rx_mux_enum,
> + wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
> };
>
> static int wsa_macro_vi_feed_mixer_get(struct snd_kcontrol *kcontrol,
> @@ -2410,6 +2416,10 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets_v2_5[] = {
> SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux_v2_5),
> SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux_v2_5),
> SND_SOC_DAPM_MUX("WSA_RX1 MIX INP", SND_SOC_NOPM, 0, 0, &rx1_mix_mux_v2_5),
> + SND_SOC_DAPM_MIXER("WSA RX4", SND_SOC_NOPM, 0, 0, NULL, 0),
> + SND_SOC_DAPM_MIXER("WSA RX5", SND_SOC_NOPM, 0, 0, NULL, 0),
> + SND_SOC_DAPM_MUX("WSA RX4 MUX", SND_SOC_NOPM, WSA_MACRO_RX4, 0, &rx_mux[WSA_MACRO_RX4]),
> + SND_SOC_DAPM_MUX("WSA RX5 MUX", SND_SOC_NOPM, WSA_MACRO_RX5, 0, &rx_mux[WSA_MACRO_RX5]),
> };
>
> static const struct snd_soc_dapm_route wsa_audio_map[] = {
> @@ -2529,6 +2539,31 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
> {"WSA_SPK2 OUT", NULL, "WSA_MCLK"},
> };
>
> +static const struct snd_soc_dapm_route wsa_audio_map_v2_5[] = {
> + {"WSA RX4 MUX", "AIF1_PB", "WSA AIF1 PB"},
> + {"WSA RX5 MUX", "AIF1_PB", "WSA AIF1 PB"},
> + {"WSA RX4 MUX", "AIF_MIX1_PB", "WSA AIF_MIX1 PB"},
> + {"WSA RX5 MUX", "AIF_MIX1_PB", "WSA AIF_MIX1 PB"},
> + {"WSA RX4", NULL, "WSA RX4 MUX"},
> + {"WSA RX5", NULL, "WSA RX5 MUX"},
> + {"WSA_RX0 INP0", "RX4", "WSA RX4"},
> + {"WSA_RX0 INP0", "RX5", "WSA RX5"},
> + {"WSA_RX0 INP1", "RX4", "WSA RX4"},
> + {"WSA_RX0 INP1", "RX5", "WSA RX5"},
> + {"WSA_RX0 INP2", "RX4", "WSA RX4"},
> + {"WSA_RX0 INP2", "RX5", "WSA RX5"},
> + {"WSA_RX0 MIX INP", "RX4", "WSA RX4"},
> + {"WSA_RX0 MIX INP", "RX5", "WSA RX5"},
> + {"WSA_RX1 INP0", "RX4", "WSA RX4"},
> + {"WSA_RX1 INP0", "RX5", "WSA RX5"},
> + {"WSA_RX1 INP1", "RX4", "WSA RX4"},
> + {"WSA_RX1 INP1", "RX5", "WSA RX5"},
> + {"WSA_RX1 INP2", "RX4", "WSA RX4"},
> + {"WSA_RX1 INP2", "RX5", "WSA RX5"},
> + {"WSA_RX1 MIX INP", "RX4", "WSA RX4"},
> + {"WSA_RX1 MIX INP", "RX5", "WSA RX5"},
> +};
> +
> static int wsa_swrm_clock(struct wsa_macro *wsa, bool enable)
> {
> struct regmap *regmap = wsa->regmap;
> @@ -2562,7 +2597,9 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
> struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(comp);
> struct wsa_macro *wsa = snd_soc_component_get_drvdata(comp);
> const struct snd_soc_dapm_widget *widgets;
> - unsigned int num_widgets;
> + const struct snd_soc_dapm_route *routes;
> + unsigned int num_widgets, num_routes;
> + int ret;
>
> snd_soc_component_init_regmap(comp, wsa->regmap);
>
> @@ -2587,6 +2624,7 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
> case LPASS_CODEC_VERSION_2_1:
> widgets = wsa_macro_dapm_widgets_v2_1;
> num_widgets = ARRAY_SIZE(wsa_macro_dapm_widgets_v2_1);
> + num_routes = 0;
> break;
> case LPASS_CODEC_VERSION_2_5:
> case LPASS_CODEC_VERSION_2_6:
> @@ -2595,12 +2633,18 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
> case LPASS_CODEC_VERSION_2_9:
> widgets = wsa_macro_dapm_widgets_v2_5;
> num_widgets = ARRAY_SIZE(wsa_macro_dapm_widgets_v2_5);
> + routes = wsa_audio_map_v2_5;
> + num_routes = ARRAY_SIZE(wsa_audio_map_v2_5);
> break;
> default:
> return -EINVAL;
> }
>
> - return snd_soc_dapm_new_controls(dapm, widgets, num_widgets);
> + ret = snd_soc_dapm_new_controls(dapm, widgets, num_widgets);
> + if (ret)
> + return ret;
> +
> + return snd_soc_dapm_add_routes(dapm, routes, num_routes);
> }
>
> static int swclk_gate_enable(struct clk_hw *hw)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 5/9] ASoC: codecs: lpass-wsa-macro: add volume controls for mix path
2025-11-17 5:15 ` [PATCH 5/9] ASoC: codecs: lpass-wsa-macro: add volume controls for mix path Jonathan Marek
@ 2025-11-19 15:34 ` Srinivas Kandagatla
0 siblings, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:34 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> This allows changing the mix gain registers from the default value.
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
#on T14s
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> sound/soc/codecs/lpass-wsa-macro.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 27c8c060cab19..2a814a5d2d1f0 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -2248,6 +2248,10 @@ static const struct snd_kcontrol_new wsa_macro_snd_controls[] = {
> -84, 40, digital_gain),
> SOC_SINGLE_S8_TLV("WSA_RX1 Digital Volume", CDC_WSA_RX1_RX_VOL_CTL,
> -84, 40, digital_gain),
> + SOC_SINGLE_S8_TLV("WSA_RX0_MIX Digital Volume", CDC_WSA_RX0_RX_VOL_MIX_CTL,
> + -84, 40, digital_gain),
> + SOC_SINGLE_S8_TLV("WSA_RX1_MIX Digital Volume", CDC_WSA_RX1_RX_VOL_MIX_CTL,
> + -84, 40, digital_gain),
>
> SOC_SINGLE("WSA_RX0 Digital Mute", CDC_WSA_RX0_RX_PATH_CTL, 4, 1, 0),
> SOC_SINGLE("WSA_RX1 Digital Mute", CDC_WSA_RX1_RX_PATH_CTL, 4, 1, 0),
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 6/9] ASoC: codecs: lpass-wsa-macro: remove main path event
2025-11-17 5:15 ` [PATCH 6/9] ASoC: codecs: lpass-wsa-macro: remove main path event Jonathan Marek
@ 2025-11-19 15:34 ` Srinivas Kandagatla
0 siblings, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:34 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> The event enables the main path clock when the mux is set to DEC0/DEC1.
> My patch ("ASoC: codecs: lpass-wsa-macro: fix path clock dependencies")
> makes it depend on the main path clock, so this event is now redundant.
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
#on T14s
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> sound/soc/codecs/lpass-wsa-macro.c | 59 +-----------------------------
> 1 file changed, 2 insertions(+), 57 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 2a814a5d2d1f0..e2e78ff6dd54e 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -1726,59 +1726,6 @@ static int wsa_macro_config_softclip(struct snd_soc_component *component,
> return 0;
> }
>
> -static bool wsa_macro_adie_lb(struct snd_soc_component *component,
> - int interp_idx)
> -{
> - struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
> - u16 int_mux_cfg0, int_mux_cfg1;
> - u8 int_n_inp0, int_n_inp1, int_n_inp2;
> -
> - int_mux_cfg0 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG0 + interp_idx * 8;
> - int_mux_cfg1 = int_mux_cfg0 + 4;
> -
> - int_n_inp0 = snd_soc_component_read_field(component, int_mux_cfg0,
> - wsa->reg_layout->rx_intx_1_mix_inp0_sel_mask);
> - if (int_n_inp0 == INTn_1_INP_SEL_DEC0 ||
> - int_n_inp0 == INTn_1_INP_SEL_DEC1)
> - return true;
> -
> - int_n_inp1 = snd_soc_component_read_field(component, int_mux_cfg0,
> - wsa->reg_layout->rx_intx_1_mix_inp1_sel_mask);
> - if (int_n_inp1 == INTn_1_INP_SEL_DEC0 ||
> - int_n_inp1 == INTn_1_INP_SEL_DEC1)
> - return true;
> -
> - int_n_inp2 = snd_soc_component_read_field(component, int_mux_cfg1,
> - wsa->reg_layout->rx_intx_1_mix_inp2_sel_mask);
> - if (int_n_inp2 == INTn_1_INP_SEL_DEC0 ||
> - int_n_inp2 == INTn_1_INP_SEL_DEC1)
> - return true;
> -
> - return false;
> -}
> -
> -static int wsa_macro_enable_main_path(struct snd_soc_dapm_widget *w,
> - struct snd_kcontrol *kcontrol,
> - int event)
> -{
> - struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> - u16 reg;
> -
> - reg = CDC_WSA_RX0_RX_PATH_CTL + WSA_MACRO_RX_PATH_OFFSET * w->shift;
> - switch (event) {
> - case SND_SOC_DAPM_PRE_PMU:
> - if (wsa_macro_adie_lb(component, w->shift)) {
> - snd_soc_component_update_bits(component, reg,
> - CDC_WSA_RX_PATH_CLK_EN_MASK,
> - CDC_WSA_RX_PATH_CLK_ENABLE);
> - }
> - break;
> - default:
> - break;
> - }
> - return 0;
> -}
> -
> static int wsa_macro_interp_get_primary_reg(u16 reg, u16 *ind)
> {
> u16 prim_int_reg = 0;
> @@ -2395,10 +2342,8 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets[] = {
> SND_SOC_DAPM_MIXER("WSA RX_MIX0", SND_SOC_NOPM, 0, 0, NULL, 0),
> SND_SOC_DAPM_MIXER("WSA RX_MIX1", SND_SOC_NOPM, 0, 0, NULL, 0),
>
> - SND_SOC_DAPM_MIXER_E("WSA_RX INT0 MIX", SND_SOC_NOPM, 0, 0, NULL, 0,
> - wsa_macro_enable_main_path, SND_SOC_DAPM_PRE_PMU),
> - SND_SOC_DAPM_MIXER_E("WSA_RX INT1 MIX", SND_SOC_NOPM, 1, 0, NULL, 0,
> - wsa_macro_enable_main_path, SND_SOC_DAPM_PRE_PMU),
> + SND_SOC_DAPM_MIXER("WSA_RX INT0 MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
> + SND_SOC_DAPM_MIXER("WSA_RX INT1 MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
>
> SND_SOC_DAPM_MIXER("WSA_RX INT0 SEC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
> SND_SOC_DAPM_MIXER("WSA_RX INT1 SEC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 4/9] ASoC: codecs: lpass-wsa-macro: fix path clock dependencies
2025-11-17 5:15 ` [PATCH 4/9] ASoC: codecs: lpass-wsa-macro: fix path clock dependencies Jonathan Marek
@ 2025-11-19 15:34 ` Srinivas Kandagatla
0 siblings, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:34 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> "WSA_RX0_CLK",etc. are path clocks, but "WSA RX0",etc. are ports, and there
> isn't a correspondence between the ports and paths.
> For example "WSA RX0" port could be used by the "RX1 MIX" path.
> The problem becomes obvious when RX4,etc. ports are added.
>
> Enabling the path clocks should depend on the path being enabled.
>
> With this fix, the main path clock will be enabled whenever the path is
> active: previously using the mix ports only would only activate the mix
> path clock and no audio would play.
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
#on T14s
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> ---
> sound/soc/codecs/lpass-wsa-macro.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 06570e474c850..27c8c060cab19 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -2496,10 +2496,8 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
> {"WSA RX_MIX0", NULL, "WSA RX_MIX0 MUX"},
> {"WSA RX_MIX1", NULL, "WSA RX_MIX1 MUX"},
>
> - {"WSA RX0", NULL, "WSA_RX0_CLK"},
> - {"WSA RX1", NULL, "WSA_RX1_CLK"},
> - {"WSA RX_MIX0", NULL, "WSA_RX_MIX0_CLK"},
> - {"WSA RX_MIX1", NULL, "WSA_RX_MIX1_CLK"},
> + {"WSA_RX INT0 MIX", NULL, "WSA_RX0_CLK"},
> + {"WSA_RX INT1 MIX", NULL, "WSA_RX1_CLK"},
>
> {"WSA_RX0 INP0", "RX0", "WSA RX0"},
> {"WSA_RX0 INP0", "RX1", "WSA RX1"},
> @@ -2529,6 +2527,8 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
> {"WSA_RX0 MIX INP", "RX1", "WSA RX1"},
> {"WSA_RX0 MIX INP", "RX_MIX0", "WSA RX_MIX0"},
> {"WSA_RX0 MIX INP", "RX_MIX1", "WSA RX_MIX1"},
> + {"WSA_RX0 MIX INP", NULL, "WSA_RX0_CLK"},
> + {"WSA_RX0 MIX INP", NULL, "WSA_RX_MIX0_CLK"},
> {"WSA_RX INT0 SEC MIX", NULL, "WSA_RX0 MIX INP"},
>
> {"WSA_RX INT0 SEC MIX", NULL, "WSA_RX INT0 MIX"},
> @@ -2568,6 +2568,8 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
> {"WSA_RX1 MIX INP", "RX1", "WSA RX1"},
> {"WSA_RX1 MIX INP", "RX_MIX0", "WSA RX_MIX0"},
> {"WSA_RX1 MIX INP", "RX_MIX1", "WSA RX_MIX1"},
> + {"WSA_RX1 MIX INP", NULL, "WSA_RX1_CLK"},
> + {"WSA_RX1 MIX INP", NULL, "WSA_RX_MIX1_CLK"},
> {"WSA_RX INT1 SEC MIX", NULL, "WSA_RX1 MIX INP"},
>
> {"WSA_RX INT1 SEC MIX", NULL, "WSA_RX INT1 MIX"},
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 3/9] ASoC: codecs: lpass-wsa-macro: remove mix path event
2025-11-17 5:15 ` [PATCH 3/9] ASoC: codecs: lpass-wsa-macro: remove mix path event Jonathan Marek
@ 2025-11-19 15:34 ` Srinivas Kandagatla
0 siblings, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:34 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> All it does it disable the mix path clk bit, but this is already managed by
> the WSA_RX_MIX0_CLK/WSA_RX_MIX1_CLK supplies.
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
#on T14s
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> sound/soc/codecs/lpass-wsa-macro.c | 46 +++---------------------------
> 1 file changed, 4 insertions(+), 42 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 6f16d54aee401..06570e474c850 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -1563,36 +1563,6 @@ static int wsa_macro_enable_vi_feedback(struct snd_soc_dapm_widget *w,
> return 0;
> }
>
> -static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
> - struct snd_kcontrol *kcontrol, int event)
> -{
> - struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> - u16 path_reg;
> -
> - switch (w->shift) {
> - case WSA_MACRO_RX_MIX0:
> - path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL;
> - break;
> - case WSA_MACRO_RX_MIX1:
> - path_reg = CDC_WSA_RX1_RX_PATH_MIX_CTL;
> - break;
> - default:
> - return 0;
> - }
> -
> - switch (event) {
> - case SND_SOC_DAPM_POST_PMU:
> - break;
> - case SND_SOC_DAPM_POST_PMD:
> - snd_soc_component_update_bits(component, path_reg,
> - CDC_WSA_RX_PATH_MIX_CLK_EN_MASK,
> - CDC_WSA_RX_PATH_MIX_CLK_DISABLE);
> - break;
> - }
> -
> - return 0;
> -}
> -
> static void wsa_macro_hd2_control(struct snd_soc_component *component,
> u16 reg, int event)
> {
> @@ -2475,30 +2445,22 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets_v2_1[] = {
> SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux_v2_1),
> SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux_v2_1),
> SND_SOC_DAPM_MUX("WSA_RX0 INP2", SND_SOC_NOPM, 0, 0, &rx0_prim_inp2_mux_v2_1),
> - SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX0,
> - 0, &rx0_mix_mux_v2_1, wsa_macro_enable_mix_path,
> - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
> + SND_SOC_DAPM_MUX("WSA_RX0 MIX INP", SND_SOC_NOPM, 0, 0, &rx0_mix_mux_v2_1),
> SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux_v2_1),
> SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux_v2_1),
> SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux_v2_1),
> - SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX1,
> - 0, &rx1_mix_mux_v2_1, wsa_macro_enable_mix_path,
> - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
> + SND_SOC_DAPM_MUX("WSA_RX1 MIX INP", SND_SOC_NOPM, 0, 0, &rx1_mix_mux_v2_1),
> };
>
> static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets_v2_5[] = {
> SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux_v2_5),
> SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux_v2_5),
> SND_SOC_DAPM_MUX("WSA_RX0 INP2", SND_SOC_NOPM, 0, 0, &rx0_prim_inp2_mux_v2_5),
> - SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX0,
> - 0, &rx0_mix_mux_v2_5, wsa_macro_enable_mix_path,
> - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
> + SND_SOC_DAPM_MUX("WSA_RX0 MIX INP", SND_SOC_NOPM, 0, 0, &rx0_mix_mux_v2_5),
> SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux_v2_5),
> SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux_v2_5),
> SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux_v2_5),
> - SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX1,
> - 0, &rx1_mix_mux_v2_5, wsa_macro_enable_mix_path,
> - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
> + SND_SOC_DAPM_MUX("WSA_RX1 MIX INP", SND_SOC_NOPM, 0, 0, &rx1_mix_mux_v2_5),
> };
>
> static const struct snd_soc_dapm_route wsa_audio_map[] = {
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
` (7 preceding siblings ...)
2025-11-17 5:15 ` [PATCH 9/9] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths Jonathan Marek
@ 2025-11-19 15:35 ` Srinivas Kandagatla
2025-11-20 9:40 ` (subset) " Mark Brown
9 siblings, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:35 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> WSA_MACRO_RX0 is 0 and WSA_MACRO_RX_MIX1 is (WSA_MACRO_RX_MAX-1), which
> means it is not possible for the bounds check to fail.
>
> Removing the WSA_MACRO_RX_MIX1 limit is needed to add support for other
> ports (RX4, RX5, etc.), in which case the valid range depends on the HW
> version: rely on the driver only setting valid ports in active_ch_mask
> instead (already the case).
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
> sound/soc/codecs/lpass-wsa-macro.c | 11 -----------
> 1 file changed, 11 deletions(-)
>
Thanks for Cleaning these invalid checks.
Its convenient to have a cover letter for this series, which makes easy
for giving Rb and Tb's,
Consider this next time when you send more than one patch.
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
#on T14s
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 38faa9074ca3e..6e54c1beac8f9 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -1168,12 +1168,6 @@ static int wsa_macro_set_prim_interpolator_rate(struct snd_soc_dai *dai,
>
> for_each_set_bit(port, &wsa->active_ch_mask[dai->id], WSA_MACRO_RX_MAX) {
> int_1_mix1_inp = port;
> - if ((int_1_mix1_inp < WSA_MACRO_RX0) || (int_1_mix1_inp > WSA_MACRO_RX_MIX1)) {
> - dev_err(component->dev, "%s: Invalid RX port, Dai ID is %d\n",
> - __func__, dai->id);
> - return -EINVAL;
> - }
> -
> int_mux_cfg0 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG0;
>
> /*
> @@ -1220,11 +1214,6 @@ static int wsa_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai,
>
> for_each_set_bit(port, &wsa->active_ch_mask[dai->id], WSA_MACRO_RX_MAX) {
> int_2_inp = port;
> - if ((int_2_inp < WSA_MACRO_RX0) || (int_2_inp > WSA_MACRO_RX_MIX1)) {
> - dev_err(component->dev, "%s: Invalid RX port, Dai ID is %d\n",
> - __func__, dai->id);
> - return -EINVAL;
> - }
>
> int_mux_cfg1 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG1;
> for (j = 0; j < NUM_INTERPOLATORS; j++) {
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence
2025-11-17 5:15 ` [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence Jonathan Marek
@ 2025-11-19 15:36 ` Srinivas Kandagatla
2025-11-19 15:36 ` Srinivas Kandagatla
1 sibling, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:36 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> Reading and writing the same value to this register does nothing.
>
> Looking at downstream driver it seems there was meant to be an offset added
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
#on T14s
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> ---
> sound/soc/codecs/lpass-wsa-macro.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 6e54c1beac8f9..6f16d54aee401 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -1567,17 +1567,14 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
> struct snd_kcontrol *kcontrol, int event)
> {
> struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> - u16 path_reg, gain_reg;
> - int val;
> + u16 path_reg;
>
> switch (w->shift) {
> case WSA_MACRO_RX_MIX0:
> path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL;
> - gain_reg = CDC_WSA_RX0_RX_VOL_MIX_CTL;
> break;
> case WSA_MACRO_RX_MIX1:
> path_reg = CDC_WSA_RX1_RX_PATH_MIX_CTL;
> - gain_reg = CDC_WSA_RX1_RX_VOL_MIX_CTL;
> break;
> default:
> return 0;
> @@ -1585,8 +1582,6 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
>
> switch (event) {
> case SND_SOC_DAPM_POST_PMU:
> - val = snd_soc_component_read(component, gain_reg);
> - snd_soc_component_write(component, gain_reg, val);
> break;
> case SND_SOC_DAPM_POST_PMD:
> snd_soc_component_update_bits(component, path_reg,
> @@ -1931,7 +1926,6 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
> struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> u16 gain_reg;
> u16 reg;
> - int val;
> struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
>
> if (w->shift == WSA_MACRO_COMP1) {
> @@ -1971,8 +1965,6 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
> CDC_WSA_RX_PGA_HALF_DB_MASK,
> CDC_WSA_RX_PGA_HALF_DB_ENABLE);
> }
> - val = snd_soc_component_read(component, gain_reg);
> - snd_soc_component_write(component, gain_reg, val);
> wsa_macro_config_ear_spkr_gain(component, wsa,
> event, gain_reg);
> break;
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence
2025-11-17 5:15 ` [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence Jonathan Marek
2025-11-19 15:36 ` Srinivas Kandagatla
@ 2025-11-19 15:36 ` Srinivas Kandagatla
1 sibling, 0 replies; 21+ messages in thread
From: Srinivas Kandagatla @ 2025-11-19 15:36 UTC (permalink / raw)
To: Jonathan Marek, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/17/25 5:15 AM, Jonathan Marek wrote:
> Reading and writing the same value to this register does nothing.
>
> Looking at downstream driver it seems there was meant to be an offset added
>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
#on T14s
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>> ---
> sound/soc/codecs/lpass-wsa-macro.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 6e54c1beac8f9..6f16d54aee401 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -1567,17 +1567,14 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
> struct snd_kcontrol *kcontrol, int event)
> {
> struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> - u16 path_reg, gain_reg;
> - int val;
> + u16 path_reg;
>
> switch (w->shift) {
> case WSA_MACRO_RX_MIX0:
> path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL;
> - gain_reg = CDC_WSA_RX0_RX_VOL_MIX_CTL;
> break;
> case WSA_MACRO_RX_MIX1:
> path_reg = CDC_WSA_RX1_RX_PATH_MIX_CTL;
> - gain_reg = CDC_WSA_RX1_RX_VOL_MIX_CTL;
> break;
> default:
> return 0;
> @@ -1585,8 +1582,6 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
>
> switch (event) {
> case SND_SOC_DAPM_POST_PMU:
> - val = snd_soc_component_read(component, gain_reg);
> - snd_soc_component_write(component, gain_reg, val);
> break;
> case SND_SOC_DAPM_POST_PMD:
> snd_soc_component_update_bits(component, path_reg,
> @@ -1931,7 +1926,6 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
> struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> u16 gain_reg;
> u16 reg;
> - int val;
> struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
>
> if (w->shift == WSA_MACRO_COMP1) {
> @@ -1971,8 +1965,6 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
> CDC_WSA_RX_PGA_HALF_DB_MASK,
> CDC_WSA_RX_PGA_HALF_DB_ENABLE);
> }
> - val = snd_soc_component_read(component, gain_reg);
> - snd_soc_component_write(component, gain_reg, val);
> wsa_macro_config_ear_spkr_gain(component, wsa,
> event, gain_reg);
> break;
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/9] ASoC: codecs: lpass-wsa-macro: add RX4 and RX5
2025-11-19 15:33 ` Srinivas Kandagatla
@ 2025-11-19 17:13 ` Jonathan Marek
0 siblings, 0 replies; 21+ messages in thread
From: Jonathan Marek @ 2025-11-19 17:13 UTC (permalink / raw)
To: Srinivas Kandagatla, linux-arm-msm
Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, open list:QCOM AUDIO (ASoC) DRIVERS, open list
On 11/19/25 10:33 AM, Srinivas Kandagatla wrote:
>
>
> On 11/17/25 5:15 AM, Jonathan Marek wrote:
>> This allows playback using the WSA_2CH AIF, which feeds RX4 and RX5 on both
>> WSA and WSA2.
>
> Which SoC have you verified this on?
>
I am testing with x1e and sm8650 devices.
>> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
>> ---
>
>> sound/soc/codecs/lpass-wsa-macro.c | 48 ++++++++++++++++++++++++++++--
>> 1 file changed, 46 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
>> index e2e78ff6dd54e..f02153108c275 100644
>> --- a/sound/soc/codecs/lpass-wsa-macro.c
>> +++ b/sound/soc/codecs/lpass-wsa-macro.c
>> @@ -300,6 +300,8 @@ enum {
>> WSA_MACRO_RX_MIX,
>> WSA_MACRO_RX_MIX0 = WSA_MACRO_RX_MIX,
>> WSA_MACRO_RX_MIX1,
>
> While you are at it, can you add RX2 and RX3, its same for both
> rx_primary and rx_mix
>
RX2 is RX_MIX0 and RX3 is RX_MIX1 (different names for the same thing).
I can add RX6, RX7, RX8 (if I can test and verify that they work), I
didn't try to add them because the downstream driver doesn't support them.
>> + WSA_MACRO_RX4,
>> + WSA_MACRO_RX5,
>> WSA_MACRO_RX_MAX,
>> };
>>
>> @@ -2228,6 +2230,10 @@ static const struct snd_kcontrol_new rx_mux[WSA_MACRO_RX_MAX] = {
>> wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
>> SOC_DAPM_ENUM_EXT("WSA RX_MIX1 Mux", rx_mux_enum,
>> wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
>> + SOC_DAPM_ENUM_EXT("WSA RX4 Mux", rx_mux_enum,
>> + wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
>> + SOC_DAPM_ENUM_EXT("WSA RX5 Mux", rx_mux_enum,
>> + wsa_macro_rx_mux_get, wsa_macro_rx_mux_put),
>> };
>>
>> static int wsa_macro_vi_feed_mixer_get(struct snd_kcontrol *kcontrol,
>> @@ -2410,6 +2416,10 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets_v2_5[] = {
>> SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux_v2_5),
>> SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux_v2_5),
>> SND_SOC_DAPM_MUX("WSA_RX1 MIX INP", SND_SOC_NOPM, 0, 0, &rx1_mix_mux_v2_5),
>> + SND_SOC_DAPM_MIXER("WSA RX4", SND_SOC_NOPM, 0, 0, NULL, 0),
>> + SND_SOC_DAPM_MIXER("WSA RX5", SND_SOC_NOPM, 0, 0, NULL, 0),
>> + SND_SOC_DAPM_MUX("WSA RX4 MUX", SND_SOC_NOPM, WSA_MACRO_RX4, 0, &rx_mux[WSA_MACRO_RX4]),
>> + SND_SOC_DAPM_MUX("WSA RX5 MUX", SND_SOC_NOPM, WSA_MACRO_RX5, 0, &rx_mux[WSA_MACRO_RX5]),
>> };
>>
>> static const struct snd_soc_dapm_route wsa_audio_map[] = {
>> @@ -2529,6 +2539,31 @@ static const struct snd_soc_dapm_route wsa_audio_map[] = {
>> {"WSA_SPK2 OUT", NULL, "WSA_MCLK"},
>> };
>>
>> +static const struct snd_soc_dapm_route wsa_audio_map_v2_5[] = {
>> + {"WSA RX4 MUX", "AIF1_PB", "WSA AIF1 PB"},
>> + {"WSA RX5 MUX", "AIF1_PB", "WSA AIF1 PB"},
>> + {"WSA RX4 MUX", "AIF_MIX1_PB", "WSA AIF_MIX1 PB"},
>> + {"WSA RX5 MUX", "AIF_MIX1_PB", "WSA AIF_MIX1 PB"},
>> + {"WSA RX4", NULL, "WSA RX4 MUX"},
>> + {"WSA RX5", NULL, "WSA RX5 MUX"},
>> + {"WSA_RX0 INP0", "RX4", "WSA RX4"},
>> + {"WSA_RX0 INP0", "RX5", "WSA RX5"},
>> + {"WSA_RX0 INP1", "RX4", "WSA RX4"},
>> + {"WSA_RX0 INP1", "RX5", "WSA RX5"},
>> + {"WSA_RX0 INP2", "RX4", "WSA RX4"},
>> + {"WSA_RX0 INP2", "RX5", "WSA RX5"},
>> + {"WSA_RX0 MIX INP", "RX4", "WSA RX4"},
>> + {"WSA_RX0 MIX INP", "RX5", "WSA RX5"},
>> + {"WSA_RX1 INP0", "RX4", "WSA RX4"},
>> + {"WSA_RX1 INP0", "RX5", "WSA RX5"},
>> + {"WSA_RX1 INP1", "RX4", "WSA RX4"},
>> + {"WSA_RX1 INP1", "RX5", "WSA RX5"},
>> + {"WSA_RX1 INP2", "RX4", "WSA RX4"},
>> + {"WSA_RX1 INP2", "RX5", "WSA RX5"},
>> + {"WSA_RX1 MIX INP", "RX4", "WSA RX4"},
>> + {"WSA_RX1 MIX INP", "RX5", "WSA RX5"},
>> +};
>> +
>> static int wsa_swrm_clock(struct wsa_macro *wsa, bool enable)
>> {
>> struct regmap *regmap = wsa->regmap;
>> @@ -2562,7 +2597,9 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
>> struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(comp);
>> struct wsa_macro *wsa = snd_soc_component_get_drvdata(comp);
>> const struct snd_soc_dapm_widget *widgets;
>> - unsigned int num_widgets;
>> + const struct snd_soc_dapm_route *routes;
>> + unsigned int num_widgets, num_routes;
>> + int ret;
>>
>> snd_soc_component_init_regmap(comp, wsa->regmap);
>>
>> @@ -2587,6 +2624,7 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
>> case LPASS_CODEC_VERSION_2_1:
>> widgets = wsa_macro_dapm_widgets_v2_1;
>> num_widgets = ARRAY_SIZE(wsa_macro_dapm_widgets_v2_1);
>> + num_routes = 0;
>> break;
>> case LPASS_CODEC_VERSION_2_5:
>> case LPASS_CODEC_VERSION_2_6:
>> @@ -2595,12 +2633,18 @@ static int wsa_macro_component_probe(struct snd_soc_component *comp)
>> case LPASS_CODEC_VERSION_2_9:
>> widgets = wsa_macro_dapm_widgets_v2_5;
>> num_widgets = ARRAY_SIZE(wsa_macro_dapm_widgets_v2_5);
>> + routes = wsa_audio_map_v2_5;
>> + num_routes = ARRAY_SIZE(wsa_audio_map_v2_5);
>> break;
>> default:
>> return -EINVAL;
>> }
>>
>> - return snd_soc_dapm_new_controls(dapm, widgets, num_widgets);
>> + ret = snd_soc_dapm_new_controls(dapm, widgets, num_widgets);
>> + if (ret)
>> + return ret;
>> +
>> + return snd_soc_dapm_add_routes(dapm, routes, num_routes);
>> }
>>
>> static int swclk_gate_enable(struct clk_hw *hw)
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: (subset) [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
` (8 preceding siblings ...)
2025-11-19 15:35 ` [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Srinivas Kandagatla
@ 2025-11-20 9:40 ` Mark Brown
9 siblings, 0 replies; 21+ messages in thread
From: Mark Brown @ 2025-11-20 9:40 UTC (permalink / raw)
To: linux-arm-msm, Jonathan Marek
Cc: Srinivas Kandagatla, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
linux-sound, linux-kernel
On Mon, 17 Nov 2025 00:15:13 -0500, Jonathan Marek wrote:
> WSA_MACRO_RX0 is 0 and WSA_MACRO_RX_MIX1 is (WSA_MACRO_RX_MAX-1), which
> means it is not possible for the bounds check to fail.
>
> Removing the WSA_MACRO_RX_MIX1 limit is needed to add support for other
> ports (RX4, RX5, etc.), in which case the valid range depends on the HW
> version: rely on the driver only setting valid ports in active_ch_mask
> instead (already the case).
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check
commit: 38fc5addd2a0e51ba750c1a401efe7e3c84a2916
[2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence
commit: 902f497a1ff5d275d2f48c2422d8a9eaa2174dee
[3/9] ASoC: codecs: lpass-wsa-macro: remove mix path event
commit: c47f28ef62cb03de1e5a97844a90eda0415da233
[4/9] ASoC: codecs: lpass-wsa-macro: fix path clock dependencies
commit: 3ea1b0dbc684191b2e0b5697356a74571ab28155
[5/9] ASoC: codecs: lpass-wsa-macro: add volume controls for mix path
commit: da49a21b3fe9fbee7be0418916c43f27ed91ad0a
[6/9] ASoC: codecs: lpass-wsa-macro: remove main path event
commit: 7ec95f46759ba0843a2695decba3cea028cb84ea
[8/9] ASoC: codecs: lpass-wsa-macro: remove unused WSA_MACRO_RX_MIX enum
commit: 50c28498e9fd6784dea82378d509572d118111f9
[9/9] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths
commit: bdf96e9135a0cf53a853a19c30fa11131a744062
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2025-11-20 9:40 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 5:15 [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Jonathan Marek
2025-11-17 5:15 ` [PATCH 2/9] ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence Jonathan Marek
2025-11-19 15:36 ` Srinivas Kandagatla
2025-11-19 15:36 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 3/9] ASoC: codecs: lpass-wsa-macro: remove mix path event Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 4/9] ASoC: codecs: lpass-wsa-macro: fix path clock dependencies Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 5/9] ASoC: codecs: lpass-wsa-macro: add volume controls for mix path Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 6/9] ASoC: codecs: lpass-wsa-macro: remove main path event Jonathan Marek
2025-11-19 15:34 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 7/9] ASoC: codecs: lpass-wsa-macro: add RX4 and RX5 Jonathan Marek
2025-11-19 15:33 ` Srinivas Kandagatla
2025-11-19 17:13 ` Jonathan Marek
2025-11-17 5:15 ` [PATCH 8/9] ASoC: codecs: lpass-wsa-macro: remove unused WSA_MACRO_RX_MIX enum Jonathan Marek
2025-11-19 15:33 ` Srinivas Kandagatla
2025-11-17 5:15 ` [PATCH 9/9] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths Jonathan Marek
2025-11-19 15:33 ` Srinivas Kandagatla
2025-11-19 15:35 ` [PATCH 1/9] ASoC: codecs: lpass-wsa-macro: remove unnecessary bounds check Srinivas Kandagatla
2025-11-20 9:40 ` (subset) " Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox