lkml.org 
[lkml]   [2022]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 2/3] drivers: bus: simple-pm-bus: Use clocks
Hi Liu,

On Thu, Aug 4, 2022 at 8:10 AM Liu Ying <victor.liu@nxp.com> wrote:
> Simple Power-Managed bus controller may need functional clock(s)
> to be enabled before child devices connected to the bus can be
> accessed. Get the clock(s) as a bulk and enable/disable the
> clock(s) when the bus is being power managed.
>
> One example is that Freescale i.MX8qxp pixel link MSI bus controller
> needs MSI clock and AHB clock to be enabled before accessing child
> devices.
>
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> ---
> v1->v3:
> * No change.

Thanks for your patch!

> --- a/drivers/bus/simple-pm-bus.c
> +++ b/drivers/bus/simple-pm-bus.c

> @@ -72,6 +89,42 @@ static int simple_pm_bus_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static int simple_pm_bus_runtime_suspend(struct device *dev)
> +{
> + struct simple_pm_bus *bus = dev_get_drvdata(dev);
> +
> + if (!bus)
> + return 0;

Can this really happen?

> +
> + clk_bulk_disable_unprepare(bus->num_clks, bus->clks);
> +
> + return 0;
> +}
> +
> +static int simple_pm_bus_runtime_resume(struct device *dev)
> +{
> + struct simple_pm_bus *bus = dev_get_drvdata(dev);
> + int ret;
> +
> + if (!bus)
> + return 0;

Likewise.

> +
> + ret = clk_bulk_prepare_enable(bus->num_clks, bus->clks);
> + if (ret) {
> + dev_err(dev, "failed to enable clocks: %d\n", ret);
> + return ret;
> + }
> +
> + return 0;
> +}

The rest LGTM, so
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

\
 
 \ /
  Last update: 2022-08-12 11:50    [W:0.204 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site