Re: [PATCH 1/6] firmware: arm_scmi: Simplify enable/disable Clock operations

From: Stephen Boyd
Date: Tue Aug 22 2023 - 16:17:21 EST


Quoting Cristian Marussi (2023-08-11 09:14:41)
> Add a param to Clock enable/disable operation to ask for atomic operation
> and remove _atomic version of such operations.

Why?

>
> No functional change.
>
> CC: Michael Turquette <mturquette@xxxxxxxxxxxx>
> CC: Stephen Boyd <sboyd@xxxxxxxxxx>
> CC: linux-clk@xxxxxxxxxxxxxxx
> Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
> ---
> drivers/clk/clk-scmi.c | 8 ++++----
> drivers/firmware/arm_scmi/clock.c | 24 ++++++------------------
> include/linux/scmi_protocol.h | 9 ++++-----
> 3 files changed, 14 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
> index 2c7a830ce308..ff003083e592 100644
> --- a/drivers/clk/clk-scmi.c
> +++ b/drivers/clk/clk-scmi.c
> @@ -78,28 +78,28 @@ static int scmi_clk_enable(struct clk_hw *hw)
> {
> struct scmi_clk *clk = to_scmi_clk(hw);
>
> - return scmi_proto_clk_ops->enable(clk->ph, clk->id);
> + return scmi_proto_clk_ops->enable(clk->ph, clk->id, false);
> }
>
> static void scmi_clk_disable(struct clk_hw *hw)
> {
> struct scmi_clk *clk = to_scmi_clk(hw);
>
> - scmi_proto_clk_ops->disable(clk->ph, clk->id);
> + scmi_proto_clk_ops->disable(clk->ph, clk->id, false);

I enjoyed how it was before because I don't know what 'false' means
without looking at the ops now.

> }
>
> static int scmi_clk_atomic_enable(struct clk_hw *hw)
> {
> struct scmi_clk *clk = to_scmi_clk(hw);
>
> - return scmi_proto_clk_ops->enable_atomic(clk->ph, clk->id);
> + return scmi_proto_clk_ops->enable(clk->ph, clk->id, true);
> }
>
> static void scmi_clk_atomic_disable(struct clk_hw *hw)
> {
> struct scmi_clk *clk = to_scmi_clk(hw);
>
> - scmi_proto_clk_ops->disable_atomic(clk->ph, clk->id);
> + scmi_proto_clk_ops->disable(clk->ph, clk->id, true);
> }
>
> /*