[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230322030218.7xjrsgt3abqft2y7@ripper>
Date: Tue, 21 Mar 2023 20:02:18 -0700
From: Bjorn Andersson <andersson@...nel.org>
To: Konrad Dybcio <konrad.dybcio@...aro.org>
Cc: Andy Gross <agross@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
linux-arm-msm@...r.kernel.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
devicetree@...r.kernel.org, Shawn Guo <shawn.guo@...aro.org>
Subject: Re: [PATCH RFT v2 02/14] clk: qcom: smd-rpm: Add .is_enabled hook
On Wed, Mar 08, 2023 at 10:35:18PM +0100, Konrad Dybcio wrote:
> From: Shawn Guo <shawn.guo@...aro.org>
>
> The RPM clock enabling state can be found with 'enabled' in struct
> clk_smd_rpm. Add .is_enabled hook so that clk_summary in debugfs can
> show a correct enabling state for RPM clocks.
>
I don't think .is_enabled should be implemented for clocks where the
actual state can't be queried.
E.g. should a clock which is is_enabled = false be unprepared during
disable_unused? It's already disabled...
Regards,
Bjorn
> Signed-off-by: Shawn Guo <shawn.guo@...aro.org>
> [Konrad: rebase]
> Signed-off-by: Konrad Dybcio <konrad.dybcio@...aro.org>
> ---
> drivers/clk/qcom/clk-smd-rpm.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
> index 198886c1b6c8..ecacfbc4a16c 100644
> --- a/drivers/clk/qcom/clk-smd-rpm.c
> +++ b/drivers/clk/qcom/clk-smd-rpm.c
> @@ -424,18 +424,27 @@ static int clk_smd_rpm_enable_scaling(struct qcom_smd_rpm *rpm)
> return 0;
> }
>
> +static int clk_smd_rpm_is_enabled(struct clk_hw *hw)
> +{
> + struct clk_smd_rpm *r = to_clk_smd_rpm(hw);
> +
> + return r->enabled;
> +}
> +
> static const struct clk_ops clk_smd_rpm_ops = {
> .prepare = clk_smd_rpm_prepare,
> .unprepare = clk_smd_rpm_unprepare,
> .set_rate = clk_smd_rpm_set_rate,
> .round_rate = clk_smd_rpm_round_rate,
> .recalc_rate = clk_smd_rpm_recalc_rate,
> + .is_enabled = clk_smd_rpm_is_enabled,
> };
>
> static const struct clk_ops clk_smd_rpm_branch_ops = {
> .prepare = clk_smd_rpm_prepare,
> .unprepare = clk_smd_rpm_unprepare,
> .recalc_rate = clk_smd_rpm_recalc_rate,
> + .is_enabled = clk_smd_rpm_is_enabled,
> };
>
> DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000);
>
> --
> 2.39.2
>
Powered by blists - more mailing lists