All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: qcom: check ADSP version when setting clocks
@ 2023-10-14 17:26 Otto Pflüger
  2023-10-14 17:26 ` [PATCH 1/3] ASoC: qcom: q6core: expose ADSP core firmware version Otto Pflüger
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Otto Pflüger @ 2023-10-14 17:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	alsa-devel, ~postmarketos/upstreaming, Otto Pflüger

The apq8016_sbc driver currently works on APQ8016 and MSM8916 devices. It
should also work on MSM8909 (and newer SoCs like MSM8917 and MSM8953 if
the quinary MI2S line is added); however, newer devices with these SoCs
ship with newer firmware that uses a different interface for controlling
the digital codec and bit clocks, which causes the driver to fail because
it cannot set LPAIF_BIT_CLK.

In order to fix this problem, modify the LPAIF_* clock implementation in
the qdsp6 driver to use the newer clock API if a newer firmware version is
detected. This seems to be a better solution than exposing the firmware
version to other drivers like apq8016_sbc and forcing them to figure out
which clock to use.

On MSM8916, a hack is currently used to control the LPAIF_DIG_CLK directly
through the GCC driver, but on devices with the newer firmware, the
INTERNAL_DIGITAL_CODEC_CORE clock provided by q6afe-clocks in the qdsp6
driver can be used instead. Add a fallback to make this clock work with
the older firmware too, allowing one to specify it as the codec's "mclk"
in the device tree:

  compatible = "qcom,msm8916-wcd-digital-codec";
  clocks = <&xo_board>,
           <&q6afecc LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE
                     LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
  clock-names = "ahbix", "mclk";
  assigned-clocks = <&q6afecc LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE
                              LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
  assigned-clock-rates = <9600000>;

This works both on MSM8916 and on the newer SoCs mentioned above.

Otto Pflüger (3):
  ASoC: qcom: q6core: expose ADSP core firmware version
  ASoC: qcom: q6afe: check ADSP version when setting clocks
  ASoC: qcom: q6afe: remove "port already open" error

 sound/soc/qcom/qdsp6/q6afe.c  | 85 +++++++++++++++++++++++++++++++++--
 sound/soc/qcom/qdsp6/q6core.c | 61 +++++++++++++++++++++++++
 sound/soc/qcom/qdsp6/q6core.h |  9 ++++
 3 files changed, 152 insertions(+), 3 deletions(-)


base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b
-- 
2.39.2

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

end of thread, other threads:[~2023-10-20  7:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-14 17:26 [PATCH 0/3] ASoC: qcom: check ADSP version when setting clocks Otto Pflüger
2023-10-14 17:26 ` [PATCH 1/3] ASoC: qcom: q6core: expose ADSP core firmware version Otto Pflüger
2023-10-16 12:47   ` Mark Brown
2023-10-16 15:55     ` Otto Pflüger
2023-10-14 17:26 ` [PATCH 2/3] ASoC: qcom: q6afe: check ADSP version when setting clocks Otto Pflüger
2023-10-17 13:08   ` Srinivas Kandagatla
2023-10-19 17:27     ` Otto Pflüger
2023-10-14 17:26 ` [PATCH 3/3] ASoC: qcom: q6afe: remove "port already open" error Otto Pflüger

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.