Re: [PATCH v1 2/4] clk: qcom: gdsc: Add support for clock voting from GDSC

Stephen Boyd
2021-11-02T21:58:08Z

Quoting Taniya Das (2021-11-02 02:56:51)
> In the cases where the clock is required to be enabled before the genpd
> enable add support for the same.

Please describe more. One sentence is not enough here.

>
> Signed-off-by: Taniya Das <tdas@codeaurora.org>
> ---
> drivers/clk/qcom/gdsc.c | 45 +++++++++++++++++++++++++++++++++++++++------
> drivers/clk/qcom/gdsc.h | 3 +++
> 2 files changed, 42 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
> index 7e1dd8c..1caca32 100644
> --- a/drivers/clk/qcom/gdsc.c
> +++ b/drivers/clk/qcom/gdsc.c
> @@ -478,6 +499,18 @@ int gdsc_register(struct gdsc_desc *desc,
> return PTR_ERR(scs[i]->rsupply);
> }
>
> + for (i = 0; i < num; i++) {
> + if (!scs[i])
> + continue;
> +
> + scs[i]->clk = devm_clk_get(dev, scs[i]->clk_name);
> + if (IS_ERR(scs[i]->clk))
> + return PTR_ERR(scs[i]->clk);
> + ret = clk_prepare(scs[i]->clk);

Why do we keep it prepared forever? And don't we have support for
writing directly into cxc registers?

> + if (ret)
> + return ret;
> + }
> +
> data->num_domains = num;
> for (i = 0; i < num; i++) {
> if (!scs[i])