Re: [PATCH v13 05/13] clk: ingenic: Add driver for the TCU clocks

From: Stephen Boyd
Date: Tue Jun 25 2019 - 19:28:24 EST


Quoting Paul Cercueil (2019-06-25 15:37:07)
> >
> > Do you need to get the clk by name? Or can that clk be "known" to the
> > TCU somehow so we can already have a direct clk pointer?
>
> This clock is provided by a separate driver, so I have to obtain the
> clock pointer from devicetree.

Ok.

> >> +}
> >> +
> >> +static int __maybe_unused tcu_pm_suspend(void)
> >> +{
> >> + struct ingenic_tcu *tcu = ingenic_tcu;
> >> +
> >> + if (tcu->clk)
> >> + clk_disable(tcu->clk);
> >
> > Do you need to unprepare? Or it just isn't possible because this is
> > called from syscore and thus we can't sleep?
>
> I thought that clk_disable() was enough. We don't actually need to
> unprepare, do we? And yes, as you pointed out, this call cannot sleep.

Yeah unprepare isn't necessary, but it will be different on different
platforms. This is a highly platform specific driver though so I suspect
this is all fine.