[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1dfef5d380b3a5f920620fbf491280f9.sboyd@kernel.org>
Date: Thu, 12 Oct 2023 13:51:00 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Varadarajan Narayanan <quic_varada@...cinc.com>, agross@...nel.org,
andersson@...nel.org, conor+dt@...nel.org,
devicetree@...r.kernel.org, ilia.lin@...nel.org,
konrad.dybcio@...aro.org, krzysztof.kozlowski+dt@...aro.org,
linux-arm-msm@...r.kernel.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
mturquette@...libre.com, quic_kathirav@...cinc.com,
rafael@...nel.org, robh+dt@...nel.org, viresh.kumar@...aro.org
Cc: Varadarajan Narayanan <quic_varada@...cinc.com>
Subject: Re: [PATCH v2 4/8] clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll
Quoting Varadarajan Narayanan (2023-10-12 02:26:20)
> diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c
> index 4e13a08..c05c2b2 100644
> --- a/drivers/clk/qcom/apss-ipq6018.c
> +++ b/drivers/clk/qcom/apss-ipq6018.c
> @@ -84,15 +87,63 @@ static const struct qcom_cc_desc apss_ipq6018_desc = {
> .num_clks = ARRAY_SIZE(apss_ipq6018_clks),
> };
>
> +static int cpu_clk_notifier_fn(struct notifier_block *nb, unsigned long action,
> + void *data)
> +{
> + struct clk_hw *hw;
> + u8 index;
> + int err;
> +
> + if (action == PRE_RATE_CHANGE)
> + index = P_GPLL0;
> + else if ((action == POST_RATE_CHANGE) || (action == ABORT_RATE_CHANGE))
This has too many parenthesis.
> + index = P_APSS_PLL_EARLY;
> + else
> + return 0;
Maybe 'return NOTIFY_OK' instead?
> +
> + hw = &apcs_alias0_clk_src.clkr.hw;
> + err = clk_rcg2_mux_closest_ops.set_parent(hw, index);
> +
> + return notifier_from_errno(err);
> +}
> +
> +static struct notifier_block cpu_clk_notifier = {
Instead of a static global can this be allocated with kzalloc?
> + .notifier_call = cpu_clk_notifier_fn,
> +};
> +
> static int apss_ipq6018_probe(struct platform_device *pdev)
Powered by blists - more mailing lists