devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>,
	agross@kernel.org, bjorn.andersson@linaro.org,
	lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org,
	quic_plai@quicinc.com, bgoswami@codeaurora.org, perex@perex.cz,
	tiwai@suse.com, rohitkr@codeaurora.org,
	linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	swboyd@chromium.org, judyhsiao@chromium.org,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org
Cc: Venkata Prasad Potturu <quic_potturu@quicinc.com>
Subject: Re: [PATCH v6 7/7] pinctrl: qcom: Update clock voting as optional
Date: Wed, 16 Feb 2022 15:38:02 +0000	[thread overview]
Message-ID: <09b00fe9-1770-1723-3c4c-6c494da87e8d@linaro.org> (raw)
In-Reply-To: <b663f63f-4a5a-3a2a-9be7-fa7258ce93c5@quicinc.com>



On 16/02/2022 14:41, Srinivasa Rao Mandadapu wrote:
> 
> On 2/16/2022 7:50 PM, Srinivas Kandagatla wrote:
> Thanks for Your Time Srini!!!
>>
>> On 14/02/2022 15:19, Srinivasa Rao Mandadapu wrote:
>>> Update bulk clock voting to optional voting as ADSP bypass platform 
>>> doesn't
>>> need macro and decodec clocks, these are maintained as power domains and
>>> operated from lpass audio core cc.
>>>
>>> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
>>> Co-developed-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
>>> Signed-off-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
>>> ---
>>>   drivers/pinctrl/qcom/pinctrl-lpass-lpi.c        | 16 +++++++++-------
>>>   drivers/pinctrl/qcom/pinctrl-lpass-lpi.h        |  1 +
>>>   drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c |  1 +
>>>   3 files changed, 11 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c 
>>> b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>>> index 8a82fd9..103f0a6c 100644
>>> --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>>> +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>>> @@ -407,13 +407,15 @@ int lpi_pinctrl_probe(struct platform_device 
>>> *pdev)
>>>           return dev_err_probe(dev, PTR_ERR(pctrl->slew_base),
>>>                        "Slew resource not provided\n");
>>>   -    ret = devm_clk_bulk_get(dev, MAX_LPI_NUM_CLKS, pctrl->clks);
>>> -    if (ret)
>>> -        return dev_err_probe(dev, ret, "Can't get clocks\n");
>>> -
>>> -    ret = clk_bulk_prepare_enable(MAX_LPI_NUM_CLKS, pctrl->clks);
>>> -    if (ret)
>>> -        return dev_err_probe(dev, ret, "Can't enable clocks\n");
>>> +    if (!data->is_clk_optional) {
>>> +        ret = devm_clk_bulk_get(dev, MAX_LPI_NUM_CLKS, pctrl->clks);
>>> +        if (ret)
>>> +            return dev_err_probe(dev, ret, "Can't get clocks\n");
>>> +
>>> +        ret = clk_bulk_prepare_enable(MAX_LPI_NUM_CLKS, pctrl->clks);
>>> +        if (ret)
>>> +            return dev_err_probe(dev, ret, "Can't enable clocks\n");
>>> +    }
>>>         pctrl->desc.pctlops = &lpi_gpio_pinctrl_ops;
>>>       pctrl->desc.pmxops = &lpi_gpio_pinmux_ops;
>>> diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h 
>>> b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
>>> index a511d72..c1079bf 100644
>>> --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
>>> +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
>>> @@ -77,6 +77,7 @@ struct lpi_pinctrl_variant_data {
>>>       int ngroups;
>>>       const struct lpi_function *functions;
>>>       int nfunctions;
>>> +    int is_clk_optional;
>>>   };
>>>     int lpi_pinctrl_probe(struct platform_device *pdev);
>>> diff --git a/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c 
>>> b/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
>>> index 5bf30d97..4277e31 100644
>>> --- a/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
>>> +++ b/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
>>> @@ -143,6 +143,7 @@ static const struct lpi_pinctrl_variant_data 
>>> sc7280_lpi_data = {
>>>       .ngroups = ARRAY_SIZE(sc7280_groups),
>>>       .functions = sc7280_functions,
>>>       .nfunctions = ARRAY_SIZE(sc7280_functions),
>>> +    .is_clk_optional = 1,
>>
>> This is forcefully set assuming that sc7280 is always used in ADSP 
>> bypass mode. Which is not correct.
>>
>> Can't you use devm_clk_bulk_get_optional instead?
> 
> Yes. Agreed. Initially used devm_clk_bulk_get_optional, but Bjorn 
> suggested for conditional check instead of optional.
> 
> Again Shall we go for optional clock voting?

That means that the condition has to be dynamic based on the platform 
using DSP or not. Which is impossible to deduce without some help from DT.

I would prefer to stay with optional clock unless Bjorn has some strong 
objection on not using int.

--srini

> 
>>
>> --srini
>>
>>>   };
>>>     static const struct of_device_id lpi_pinctrl_of_match[] = {

  reply	other threads:[~2022-02-16 15:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 15:19 [PATCH v6 0/7] Add pin control support for lpass sc7280 Srinivasa Rao Mandadapu
2022-02-14 15:19 ` [PATCH v6 1/7] dt-bindings: pinctrl: qcom: Update lpass lpi file name to SoC specific Srinivasa Rao Mandadapu
2022-02-17 23:03   ` Rob Herring
2022-02-19  2:32   ` Stephen Boyd
2022-02-14 15:19 ` [PATCH v6 2/7] dt-bindings: pinctrl: qcom: Add sc7280 lpass lpi pinctrl bindings Srinivasa Rao Mandadapu
2022-02-19  2:34   ` Stephen Boyd
2022-02-14 15:19 ` [PATCH v6 3/7] pinctrl: qcom: Update macro name to LPI specific Srinivasa Rao Mandadapu
2022-02-19  2:36   ` Stephen Boyd
2022-02-19 18:20     ` Srinivasa Rao Mandadapu (Temp)
2022-02-14 15:19 ` [PATCH v6 4/7] pinctrl: qcom: Update lpi pin group structure Srinivasa Rao Mandadapu
2022-02-19  2:38   ` Stephen Boyd
2022-02-19 18:24     ` Srinivasa Rao Mandadapu (Temp)
2022-02-14 15:19 ` [PATCH v6 5/7] pinctrl: qcom: Extract chip specific LPASS LPI code Srinivasa Rao Mandadapu
2022-02-16 14:20   ` Srinivas Kandagatla
2022-02-19  2:42   ` Stephen Boyd
2022-02-19 18:30     ` Srinivasa Rao Mandadapu (Temp)
2022-02-19  2:43   ` Stephen Boyd
2022-02-19 18:32     ` Srinivasa Rao Mandadapu (Temp)
2022-02-23  7:00       ` Srinivasa Rao Mandadapu
2022-02-14 15:19 ` [PATCH v6 6/7] pinctrl: qcom: Add SC7280 lpass pin configuration Srinivasa Rao Mandadapu
2022-02-16 14:19   ` Srinivas Kandagatla
2022-02-19  2:43   ` Stephen Boyd
2022-02-19 18:34     ` Srinivasa Rao Mandadapu (Temp)
2022-02-14 15:19 ` [PATCH v6 7/7] pinctrl: qcom: Update clock voting as optional Srinivasa Rao Mandadapu
2022-02-16 14:20   ` Srinivas Kandagatla
2022-02-16 14:41     ` Srinivasa Rao Mandadapu
2022-02-16 15:38       ` Srinivas Kandagatla [this message]
2022-02-19  2:46         ` Stephen Boyd
2022-02-19 18:36           ` Srinivasa Rao Mandadapu (Temp)
2022-02-16 14:20 ` [PATCH v6 0/7] Add pin control support for lpass sc7280 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=09b00fe9-1770-1723-3c4c-6c494da87e8d@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=agross@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=judyhsiao@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=quic_plai@quicinc.com \
    --cc=quic_potturu@quicinc.com \
    --cc=quic_srivasam@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=rohitkr@codeaurora.org \
    --cc=swboyd@chromium.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).