All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] soundwire: qcom: disable stop clock on 1.3.0 and below
@ 2024-04-13  6:42 Anton Bambura
  2024-04-13  6:42 ` [PATCH v1 1/1] " Anton Bambura
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Bambura @ 2024-04-13  6:42 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Bard Liao, Pierre-Louis Bossart, Sanyog Kale,
	Srinivas Kandagatla
  Cc: linux-arm-msm, alsa-devel, linux-kernel

This patch fixes audio on sdm845 + wcd9340 with soundwire. The affected
devices are AYN Odin and Lenovo Yoga C630.

If this gets applied it should also be backported to stable and 6.6.x LTS.

Anton Bambura (1):
  soundwire: qcom: disable stop clock on 1.3.0 and below

 drivers/soundwire/qcom.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/1] soundwire: qcom: disable stop clock on 1.3.0 and below
  2024-04-13  6:42 [PATCH v1 0/1] soundwire: qcom: disable stop clock on 1.3.0 and below Anton Bambura
@ 2024-04-13  6:42 ` Anton Bambura
  2024-04-13  7:14   ` Steev Klimaszewski
  2024-04-17 11:42   ` Srinivas Kandagatla
  0 siblings, 2 replies; 5+ messages in thread
From: Anton Bambura @ 2024-04-13  6:42 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Bard Liao, Pierre-Louis Bossart, Sanyog Kale,
	Srinivas Kandagatla
  Cc: linux-arm-msm, alsa-devel, linux-kernel

This patch returns back the behavior of disabling stop clock on soundwire
1.3.0 and below which seems to have been altered by accident which
results in broken audio on sdm845 + wcd9340. For example, on AYN Odin and
Lenovo Yoga C630 devices.

Fixes: 4830bfa2c812 ("soundwire: qcom: set clk stop need reset flag at runtime")
Signed-off-by: Anton Bambura <jenneron@postmarketos.org>
---
 drivers/soundwire/qcom.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index a1e2d6c98186..bc03484a28e8 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -628,6 +628,9 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus)
 			}
 		}
 
+		if (ctrl->version <= SWRM_VERSION_1_3_0)
+			ctrl->clock_stop_not_supported = true;
+
 		if (!found) {
 			qcom_swrm_set_slave_dev_num(bus, NULL, i);
 			sdw_slave_add(bus, &id, NULL);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] soundwire: qcom: disable stop clock on 1.3.0 and below
  2024-04-13  6:42 ` [PATCH v1 1/1] " Anton Bambura
@ 2024-04-13  7:14   ` Steev Klimaszewski
  2024-04-17 11:42   ` Srinivas Kandagatla
  1 sibling, 0 replies; 5+ messages in thread
From: Steev Klimaszewski @ 2024-04-13  7:14 UTC (permalink / raw)
  To: Anton Bambura
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Bard Liao, Pierre-Louis Bossart, Sanyog Kale,
	Srinivas Kandagatla, linux-arm-msm, alsa-devel, linux-kernel

Thank you!

On Sat, Apr 13, 2024 at 1:43 AM Anton Bambura <jenneron@postmarketos.org> wrote:
>
> This patch returns back the behavior of disabling stop clock on soundwire
> 1.3.0 and below which seems to have been altered by accident which
> results in broken audio on sdm845 + wcd9340. For example, on AYN Odin and
> Lenovo Yoga C630 devices.
>
> Fixes: 4830bfa2c812 ("soundwire: qcom: set clk stop need reset flag at runtime")
> Signed-off-by: Anton Bambura <jenneron@postmarketos.org>
> ---
>  drivers/soundwire/qcom.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index a1e2d6c98186..bc03484a28e8 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -628,6 +628,9 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus)
>                         }
>                 }
>
> +               if (ctrl->version <= SWRM_VERSION_1_3_0)
> +                       ctrl->clock_stop_not_supported = true;
> +
>                 if (!found) {
>                         qcom_swrm_set_slave_dev_num(bus, NULL, i);
>                         sdw_slave_add(bus, &id, NULL);
> --
> 2.43.0
>
>
Tested on the Lenovo Yoga C630
Tested-by: Steev Klimaszewski <steev@kali.org>

-- steev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] soundwire: qcom: disable stop clock on 1.3.0 and below
  2024-04-13  6:42 ` [PATCH v1 1/1] " Anton Bambura
  2024-04-13  7:14   ` Steev Klimaszewski
@ 2024-04-17 11:42   ` Srinivas Kandagatla
  2024-04-19  5:46     ` Steev Klimaszewski
  1 sibling, 1 reply; 5+ messages in thread
From: Srinivas Kandagatla @ 2024-04-17 11:42 UTC (permalink / raw)
  To: Anton Bambura, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Vinod Koul, Bard Liao, Pierre-Louis Bossart, Sanyog Kale
  Cc: linux-arm-msm, alsa-devel, linux-kernel



On 13/04/2024 07:42, Anton Bambura wrote:
> This patch returns back the behavior of disabling stop clock on soundwire
> 1.3.0 and below which seems to have been altered by accident which
> results in broken audio on sdm845 + wcd9340. For example, on AYN Odin and
> Lenovo Yoga C630 devices.
> 
> Fixes: 4830bfa2c812 ("soundwire: qcom: set clk stop need reset flag at runtime")
> Signed-off-by: Anton Bambura <jenneron@postmarketos.org>
> ---
>   drivers/soundwire/qcom.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index a1e2d6c98186..bc03484a28e8 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -628,6 +628,9 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus)
>   			}
>   		}
>   
> +		if (ctrl->version <= SWRM_VERSION_1_3_0)
> +			ctrl->clock_stop_not_supported = true;
> +

This is not the right fix, this can be determined from codec 
clk_stop_mode1 flag.

can you try this patch:

----------------------------->cut<-----------------------------
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date: Wed, 17 Apr 2024 12:38:49 +0100
Subject: [PATCH] ASoC: codecs: wsa881x: set clk_stop_mode1 flag

WSA881x codecs do not retain the state while clock is stopped, so mark
this with clk_stop_mode1 flag.

Fixes: a0aab9e1404a ("ASoC: codecs: add wsa881x amplifier support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
  sound/soc/codecs/wsa881x.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index 3c025dabaf7a..1253695bebd8 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -1155,6 +1155,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
  	pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0);
  	pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
  	pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
+	pdev->prop.clk_stop_mode1 = true;
  	gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val);

  	wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);
-- 
2.21.0
----------------------------->cut<-----------------------------


thanks,
Srini

>   		if (!found) {
>   			qcom_swrm_set_slave_dev_num(bus, NULL, i);
>   			sdw_slave_add(bus, &id, NULL);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] soundwire: qcom: disable stop clock on 1.3.0 and below
  2024-04-17 11:42   ` Srinivas Kandagatla
@ 2024-04-19  5:46     ` Steev Klimaszewski
  0 siblings, 0 replies; 5+ messages in thread
From: Steev Klimaszewski @ 2024-04-19  5:46 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Anton Bambura, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Vinod Koul, Bard Liao, Pierre-Louis Bossart, Sanyog Kale,
	linux-arm-msm, alsa-devel, linux-kernel

Hi Srini,

On Wed, Apr 17, 2024 at 6:43 AM Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> This is not the right fix, this can be determined from codec
> clk_stop_mode1 flag.
>
> can you try this patch:
>
> ----------------------------->cut<-----------------------------
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Date: Wed, 17 Apr 2024 12:38:49 +0100
> Subject: [PATCH] ASoC: codecs: wsa881x: set clk_stop_mode1 flag
>
> WSA881x codecs do not retain the state while clock is stopped, so mark
> this with clk_stop_mode1 flag.
>
> Fixes: a0aab9e1404a ("ASoC: codecs: add wsa881x amplifier support")
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>   sound/soc/codecs/wsa881x.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
> index 3c025dabaf7a..1253695bebd8 100644
> --- a/sound/soc/codecs/wsa881x.c
> +++ b/sound/soc/codecs/wsa881x.c
> @@ -1155,6 +1155,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
>         pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0);
>         pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
>         pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
> +       pdev->prop.clk_stop_mode1 = true;
>         gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val);
>
>         wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);
> --
> 2.21.0
> ----------------------------->cut<-----------------------------
>
>
> thanks,
> Srini
>
> >               if (!found) {
> >                       qcom_swrm_set_slave_dev_num(bus, NULL, i);
> >                       sdw_slave_add(bus, &id, NULL);
>

I tested it here on my c630 and can confirm that your patch does fix
the audio as well.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-19  5:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-13  6:42 [PATCH v1 0/1] soundwire: qcom: disable stop clock on 1.3.0 and below Anton Bambura
2024-04-13  6:42 ` [PATCH v1 1/1] " Anton Bambura
2024-04-13  7:14   ` Steev Klimaszewski
2024-04-17 11:42   ` Srinivas Kandagatla
2024-04-19  5:46     ` Steev Klimaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.