[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZqO1sd2PP525g3U0@bogus>
Date: Fri, 26 Jul 2024 15:41:53 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: Cristian Marussi <cristian.marussi@....com>
Cc: Dhruva Gole <d-gole@...com>, "Peng Fan (OSS)" <peng.fan@....nxp.com>,
mturquette@...libre.com, sboyd@...nel.org,
linux-clk@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, arm-scmi@...r.kernel.org,
Sudeep Holla <sudeep.holla@....com>, Peng Fan <peng.fan@....com>
Subject: Re: [PATCH V2] clk: scmi: add is_prepared hook
On Fri, Jul 26, 2024 at 03:11:08PM +0100, Cristian Marussi wrote:
> On Fri, Jul 26, 2024 at 07:14:14PM +0530, Dhruva Gole wrote:
> > On Jul 26, 2024 at 21:10:07 +0800, Peng Fan (OSS) wrote:
> > > From: Peng Fan <peng.fan@....com>
> > >
> > > Some clks maybe default enabled by hardware, so add is_prepared hook
> > > for non-atomic clk_ops to get the status of the clk. Then when disabling
> > > unused clks, those unused clks but default hardware on clks could be
> > > in off state to save power.
> > >
> > > Signed-off-by: Peng Fan <peng.fan@....com>
> > > ---
> > >
> > > V2:
> > > Provider helper __scmi_clk_is_enabled for atomic and non-atomic usage
> > > Move is_prepared hook out of SCMI_CLK_STATE_CTRL_SUPPORTED
> > >
> > > drivers/clk/clk-scmi.c | 16 ++++++++++++++--
> > > 1 file changed, 14 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
> > > index d86a02563f6c..15510c2ff21c 100644
> > > --- a/drivers/clk/clk-scmi.c
> > > +++ b/drivers/clk/clk-scmi.c
> > > @@ -156,13 +156,13 @@ static void scmi_clk_atomic_disable(struct clk_hw *hw)
> > > scmi_proto_clk_ops->disable(clk->ph, clk->id, ATOMIC);
> > > }
> > >
> > > -static int scmi_clk_atomic_is_enabled(struct clk_hw *hw)
> > > +static int __scmi_clk_is_enabled(struct clk_hw *hw, bool atomic)
> >
> > I think we can combine other atomic/non atomic in the same way no?
> > Let me know if I should send a follow up patch based on this to make
> > __scmi_clk_enable(hw,atomic) and __scmi_clk_disable(hw,atomic)
>
> I dont think that it is worth unifying also the disable/enable atomic and
> non_atomic versions because if you look at their implementations they are
> indeed already wrappers around the state_get()....this new is_prepared/is_enabled
> were more 'thick' and so there was a lot of duplicated code.
>
+1, was planning to respond with similar message. Just jumped now as you
made it easier for me 😁.
--
Regards,
Sudeep
Powered by blists - more mailing lists