devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, perex@perex.cz,
	tiwai@suse.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] ASoC: codecs: va-macro: add npl clk
Date: Fri, 18 Nov 2022 07:02:34 +0000	[thread overview]
Message-ID: <8cf7f7ae-f2d3-56ad-021e-7cb478032291@linaro.org> (raw)
In-Reply-To: <090831eb-2c7a-56c2-601e-e910431a9403@linaro.org>

Thanks Krzysztof,

On 15/11/2022 14:23, Krzysztof Kozlowski wrote:
> On 15/11/2022 11:55, Srinivas Kandagatla wrote:
>> New versions of VA Macro has soundwire integrated, so handle the soundwire npl
>> clock correctly in the codec driver.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   sound/soc/codecs/lpass-va-macro.c | 41 +++++++++++++++++++++++++++++++
>>   1 file changed, 41 insertions(+)
>>
>> diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
>> index b0b6cf29cba3..d59af6d69c34 100644
>> --- a/sound/soc/codecs/lpass-va-macro.c
>> +++ b/sound/soc/codecs/lpass-va-macro.c
>> @@ -205,6 +205,7 @@ struct va_macro {
>>   	int dec_mode[VA_MACRO_NUM_DECIMATORS];
>>   	struct regmap *regmap;
>>   	struct clk *mclk;
>> +	struct clk *npl;
>>   	struct clk *macro;
>>   	struct clk *dcodec;
>>   	struct clk *fsgen;
>> @@ -1332,6 +1333,9 @@ static int fsgen_gate_enable(struct clk_hw *hw)
>>   	struct regmap *regmap = va->regmap;
>>   	int ret;
>>   
>> +	if (va->has_swr_master)
>> +		clk_prepare_enable(va->mclk);
> 
> No error path?
that is true, i missed this indeed, sending v2 with this and other ret = 
PTR_ERR(va->npl) change.

--srini
> 
>> +
>>   	ret = va_macro_mclk_enable(va, true);
>>   	if (!va->has_swr_master)
>>   		return ret;
>> @@ -1358,6 +1362,8 @@ static void fsgen_gate_disable(struct clk_hw *hw)
>>   			   CDC_VA_SWR_CLK_EN_MASK, 0x0);
>>   
>>   	va_macro_mclk_enable(va, false);
>> +	if (va->has_swr_master)
>> +		clk_disable_unprepare(va->mclk);
>>   }
>>   
>>   static int fsgen_gate_is_enabled(struct clk_hw *hw)
>> @@ -1386,6 +1392,9 @@ static int va_macro_register_fsgen_output(struct va_macro *va)
>>   	struct clk_init_data init;
>>   	int ret;
>>   
>> +	if (va->has_swr_master)
>> +		parent = va->npl;
>> +
>>   	parent_clk_name = __clk_get_name(parent);
>>   
>>   	of_property_read_string(np, "clock-output-names", &clk_name);
>> @@ -1512,6 +1521,14 @@ static int va_macro_probe(struct platform_device *pdev)
>>   	/* mclk rate */
>>   	clk_set_rate(va->mclk, 2 * VA_MACRO_MCLK_FREQ);
>>   
>> +	if (va->has_swr_master) {
>> +		va->npl = devm_clk_get(dev, "npl");
> 
> I think you miss:
> ret = PTR_ERR(va->npl);
> 
>> +		if (IS_ERR(va->npl))
>> +			goto err;
>> +
>> +		clk_set_rate(va->npl, 2 * VA_MACRO_MCLK_FREQ);
>> +	}
>> +
>>   	ret = clk_prepare_enable(va->macro);
>>   	if (ret)
>>   		goto err;
> 
> Best regards,
> Krzysztof
> 

      reply	other threads:[~2022-11-18  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 10:55 [PATCH 0/2] ASoC: codec: lpass-va: add npl clock support Srinivas Kandagatla
2022-11-15 10:55 ` [PATCH 1/2] ASoC: dt-bindings: lpass-va: add npl clock for new VA macro Srinivas Kandagatla
2022-11-15 14:21   ` Krzysztof Kozlowski
2022-11-18  6:56     ` Srinivas Kandagatla
2022-11-15 10:55 ` [PATCH 2/2] ASoC: codecs: va-macro: add npl clk Srinivas Kandagatla
2022-11-15 14:23   ` Krzysztof Kozlowski
2022-11-18  7:02     ` Srinivas Kandagatla [this message]

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=8cf7f7ae-f2d3-56ad-021e-7cb478032291@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --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).