linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Banajit Goswami <bgoswami@quicinc.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 9/9] ASoC: codecs: lpass-wsa-macro: add support for SM8550
Date: Sat, 11 Mar 2023 11:28:20 +0000	[thread overview]
Message-ID: <e99b2c89-c9c4-8d79-d14e-221ff106798f@linaro.org> (raw)
In-Reply-To: <20230310132201.322148-10-krzysztof.kozlowski@linaro.org>



On 10/03/2023 13:22, Krzysztof Kozlowski wrote:
> Add support for the WSA macro codec on Qualcomm SM8550.  SM8550 does not
> use NPL clock, thus add flags allowing to skip it.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   sound/soc/codecs/lpass-wsa-macro.c | 38 +++++++++++++++++++++++-------
>   1 file changed, 30 insertions(+), 8 deletions(-)
> 
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index ba7480f3831e..5155362de111 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -246,6 +246,9 @@
>   #define WSA_MACRO_EC_MIX_TX1_MASK 0x18
>   #define WSA_MACRO_MAX_DMA_CH_PER_PORT 0x2
>   
> +/* NPL clock is expected */
> +#define WSA_MACRO_FLAG_HAS_NPL_CLOCK		BIT(0)
> +


Same nit as 3/9

Once done,

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

--srini

>   enum {
>   	WSA_MACRO_GAIN_OFFSET_M1P5_DB,
>   	WSA_MACRO_GAIN_OFFSET_0_DB,
> @@ -2346,7 +2349,10 @@ static int wsa_macro_register_mclk_output(struct wsa_macro *wsa)
>   	struct clk_init_data init;
>   	int ret;
>   
> -	parent_clk_name = __clk_get_name(wsa->npl);
> +	if (wsa->npl)
> +		parent_clk_name = __clk_get_name(wsa->npl);
> +	else
> +		parent_clk_name = __clk_get_name(wsa->mclk);
>   
>   	init.name = "mclk";
>   	of_property_read_string(dev_of_node(dev), "clock-output-names",
> @@ -2379,9 +2385,12 @@ static int wsa_macro_probe(struct platform_device *pdev)
>   {
>   	struct device *dev = &pdev->dev;
>   	struct wsa_macro *wsa;
> +	kernel_ulong_t flags;
>   	void __iomem *base;
>   	int ret;
>   
> +	flags = (kernel_ulong_t)device_get_match_data(dev);
> +
>   	wsa = devm_kzalloc(dev, sizeof(*wsa), GFP_KERNEL);
>   	if (!wsa)
>   		return -ENOMEM;
> @@ -2398,9 +2407,11 @@ static int wsa_macro_probe(struct platform_device *pdev)
>   	if (IS_ERR(wsa->mclk))
>   		return PTR_ERR(wsa->mclk);
>   
> -	wsa->npl = devm_clk_get(dev, "npl");
> -	if (IS_ERR(wsa->npl))
> -		return PTR_ERR(wsa->npl);
> +	if (flags & WSA_MACRO_FLAG_HAS_NPL_CLOCK) {
> +		wsa->npl = devm_clk_get(dev, "npl");
> +		if (IS_ERR(wsa->npl))
> +			return PTR_ERR(wsa->npl);
> +	}
>   
>   	wsa->fsgen = devm_clk_get(dev, "fsgen");
>   	if (IS_ERR(wsa->fsgen))
> @@ -2553,10 +2564,21 @@ static const struct dev_pm_ops wsa_macro_pm_ops = {
>   };
>   
>   static const struct of_device_id wsa_macro_dt_match[] = {
> -	{.compatible = "qcom,sc7280-lpass-wsa-macro"},
> -	{.compatible = "qcom,sm8250-lpass-wsa-macro"},
> -	{.compatible = "qcom,sm8450-lpass-wsa-macro"},
> -	{.compatible = "qcom,sc8280xp-lpass-wsa-macro" },
> +	{
> +		.compatible = "qcom,sc7280-lpass-wsa-macro",
> +		.data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK,
> +	}, {
> +		.compatible = "qcom,sm8250-lpass-wsa-macro",
> +		.data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK,
> +	}, {
> +		.compatible = "qcom,sm8450-lpass-wsa-macro",
> +		.data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK,
> +	}, {
> +		.compatible = "qcom,sm8550-lpass-wsa-macro",
> +	}, {
> +		.compatible = "qcom,sc8280xp-lpass-wsa-macro",
> +		.data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK,
> +	},
>   	{}
>   };
>   MODULE_DEVICE_TABLE(of, wsa_macro_dt_match);

  reply	other threads:[~2023-03-11 11:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 13:21 [PATCH 0/9] ASoC: add audio digital codecs for Qualcomm SM8550 Krzysztof Kozlowski
2023-03-10 13:21 ` [PATCH 1/9] ASoC: dt-bindings: qcom,lpass-rx-macro: narrow clocks per variants Krzysztof Kozlowski
2023-03-10 13:21 ` [PATCH 2/9] ASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8550 RX macro Krzysztof Kozlowski
2023-03-10 13:21 ` [PATCH 3/9] ASoC: codecs: lpass-rx-macro: add support for SM8550 Krzysztof Kozlowski
2023-03-11 11:23   ` Srinivas Kandagatla
2023-03-11 11:27     ` Krzysztof Kozlowski
2023-03-10 13:21 ` [PATCH 4/9] ASoC: dt-bindings: qcom,lpass-tx-macro: narrow clocks per variants Krzysztof Kozlowski
2023-03-10 13:21 ` [PATCH 5/9] ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8550 TX macro Krzysztof Kozlowski
2023-03-10 13:21 ` [PATCH 6/9] ASoC: codecs: lpass-tx-macro: add support for SM8550 Krzysztof Kozlowski
2023-03-11 11:24   ` Srinivas Kandagatla
2023-03-10 13:21 ` [PATCH 7/9] ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro Krzysztof Kozlowski
2023-03-10 13:22 ` [PATCH 8/9] ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro Krzysztof Kozlowski
2023-03-10 13:22 ` [PATCH 9/9] ASoC: codecs: lpass-wsa-macro: add support for SM8550 Krzysztof Kozlowski
2023-03-11 11:28   ` Srinivas Kandagatla [this message]
2023-03-10 14:35 ` [PATCH 0/9] ASoC: add audio digital codecs for Qualcomm SM8550 Krzysztof Kozlowski

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=e99b2c89-c9c4-8d79-d14e-221ff106798f@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=agross@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andersson@kernel.org \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).