From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>,
Srinivas Kandagatla <srini@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/6] ASoC: qcom: lpass-rx-macro: Add shikra compatible
Date: Mon, 14 Sep 2026 12:41:49 +0100 [thread overview]
Message-ID: <16850fda-e68f-4ef4-bdd5-9ad77ac51195@oss.qualcomm.com> (raw)
In-Reply-To: <20260910-add_shikra_support-v2-4-fdd2129c696c@oss.qualcomm.com>
On 9/10/26 10:46 AM, Mohammad Rafi Shaik wrote:
> Add shikra RX macro compatible data and hook it into the existing
> LPASS codec v4.1 flow.
>
> The RX macro register layout of LPASS codec v4.1 matches the v2.5+
> layout, so reuse the existing v2.5 register access helpers, controls
> and widgets for it.
>
> v4.1 additionally requires the FS counter to be bypassed before it is
> enabled during MCLK enable. This is a property of the codec version and
> not of the board, so key it off the version detected by the VA macro
> rather than off match data.
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
> ---
> sound/soc/codecs/lpass-rx-macro.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
> index 2e74ec1a5..83372123c 100644
> --- a/sound/soc/codecs/lpass-rx-macro.c
> +++ b/sound/soc/codecs/lpass-rx-macro.c
> @@ -60,6 +60,7 @@
> #define CDC_RX_FS_MCLK_CNT_ENABLE BIT(0)
> #define CDC_RX_FS_MCLK_CNT_CLR_MASK BIT(1)
> #define CDC_RX_FS_MCLK_CNT_CLR BIT(1)
> +#define CDC_RX_FS_CNT_BYPASS BIT(7)
> #define CDC_RX_CLK_RST_CTRL_SWR_CONTROL (0x0108)
> #define CDC_RX_SWR_CLK_EN_MASK BIT(0)
> #define CDC_RX_SWR_RESET_MASK BIT(1)
> @@ -1613,6 +1614,7 @@ static bool rx_is_rw_register(struct device *dev, unsigned int reg)
> case LPASS_CODEC_VERSION_2_6:
> case LPASS_CODEC_VERSION_2_7:
> case LPASS_CODEC_VERSION_2_8:
> + case LPASS_CODEC_VERSION_4_1:
> return rx_2_5_is_rw_register(dev, reg);
> default:
> break;
> @@ -2045,6 +2047,16 @@ static int rx_macro_mclk_enable(struct rx_macro *rx, bool mclk_enable)
> CDC_RX_CLK_MCLK2_ENABLE);
> regmap_update_bits(regmap, CDC_RX_CLK_RST_CTRL_FS_CNT_CONTROL,
> CDC_RX_FS_MCLK_CNT_CLR_MASK, 0x00);
> +
> + /*
> + * From LPASS codec v4.1 onwards the FS counter has to be
> + * bypassed before it is enabled, otherwise the fsgen
> + * output does not come up.
> + */
> + if (rx->codec_version >= LPASS_CODEC_VERSION_4_1)
this pattern match is fragile,
> + regmap_set_bits(regmap, CDC_RX_CLK_RST_CTRL_FS_CNT_CONTROL,
> + CDC_RX_FS_CNT_BYPASS);
Please use this as a flag.
> +
> regmap_update_bits(regmap, CDC_RX_CLK_RST_CTRL_FS_CNT_CONTROL,
> CDC_RX_FS_MCLK_CNT_EN_MASK,
> CDC_RX_FS_MCLK_CNT_ENABLE);
> @@ -3652,6 +3664,7 @@ static int rx_macro_component_probe(struct snd_soc_component *component)
> case LPASS_CODEC_VERSION_2_6:
> case LPASS_CODEC_VERSION_2_7:
> case LPASS_CODEC_VERSION_2_8:
> + case LPASS_CODEC_VERSION_4_1:
> controls = rx_macro_2_5_snd_controls;
> num_controls = ARRAY_SIZE(rx_macro_2_5_snd_controls);
> widgets = rx_macro_2_5_dapm_widgets;
> @@ -3837,6 +3850,7 @@ static int rx_macro_probe(struct platform_device *pdev)
> case LPASS_CODEC_VERSION_2_6:
> case LPASS_CODEC_VERSION_2_7:
> case LPASS_CODEC_VERSION_2_8:
> + case LPASS_CODEC_VERSION_4_1:
> rx->rxn_reg_stride = 0xc0;
> rx->rxn_reg_stride2 = 0x0;
> def_count = ARRAY_SIZE(rx_defaults) + ARRAY_SIZE(rx_2_5_defaults);
> @@ -3949,6 +3963,9 @@ static const struct of_device_id rx_macro_dt_match[] = {
> }, {
> .compatible = "qcom,sc8280xp-lpass-rx-macro",
> .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK,
> + }, {
> + .compatible = "qcom,shikra-lpass-rx-macro",
> + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK,
> },
> { }
> };
>
next prev parent reply other threads:[~2026-09-14 11:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 9:46 [PATCH v2 0/6] ASoC: qcom: Add shikra LPASS RX/VA macro support Mohammad Rafi Shaik
2026-09-10 9:46 ` [PATCH v2 1/6] ASoC: dt-bindings: qcom: Add Shikra RX and VA macro compatibles Mohammad Rafi Shaik
2026-09-13 8:48 ` Krzysztof Kozlowski
2026-09-13 8:49 ` Krzysztof Kozlowski
2026-09-15 12:38 ` Mohammad Rafi Shaik
2026-09-10 9:46 ` [PATCH v2 2/6] ASoC: qcom: lpass-macro-common: Add missing v2.9 version string Mohammad Rafi Shaik
2026-09-14 11:43 ` Srinivas Kandagatla
2026-09-10 9:46 ` [PATCH v2 3/6] ASoC: qcom: lpass-macro-common: Add LPASS codec version 4.1 Mohammad Rafi Shaik
2026-09-13 8:46 ` Krzysztof Kozlowski
2026-09-15 12:41 ` Mohammad Rafi Shaik
2026-09-10 9:46 ` [PATCH v2 4/6] ASoC: qcom: lpass-rx-macro: Add shikra compatible Mohammad Rafi Shaik
2026-09-14 11:41 ` Srinivas Kandagatla [this message]
2026-09-15 12:50 ` Mohammad Rafi Shaik
2026-09-10 9:46 ` [PATCH v2 5/6] ASoC: qcom: lpass-va-macro: " Mohammad Rafi Shaik
2026-09-14 11:47 ` Srinivas Kandagatla
2026-09-15 12:55 ` Mohammad Rafi Shaik
2026-09-10 9:46 ` [PATCH v2 6/6] ASoC: qcom: lpass-va-macro: Add SoundWire microphone mux support Mohammad Rafi Shaik
2026-09-14 12:45 ` Srinivas Kandagatla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16850fda-e68f-4ef4-bdd5-9ad77ac51195@oss.qualcomm.com \
--to=srinivas.kandagatla@oss.qualcomm.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mohammad.rafi.shaik@oss.qualcomm.com \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=srini@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®