Re: [PATCH v2 3/3] usb: renesas_usbhs: Add multiple clocks management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shimoda-san,

On Fri, Aug 31, 2018 at 12:36 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote:
> R-Car Gen3 needs to enable clocks of both host and peripheral.
> Since [eo]hci-platform disables the reset(s) when the drivers are
> removed, renesas_usbhs driver doesn't work correctly. To fix this
> issue, this patch adds multiple clocks management on this
> renesas_usbhs driver.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c

> @@ -336,11 +337,26 @@ static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable)
>  {
>         struct platform_device *pdev = usbhs_priv_to_pdev(priv);
>         struct device *dev = usbhs_priv_to_dev(priv);
> +       int ret;
>
>         if (enable) {
>                 /* enable PM */
>                 pm_runtime_get_sync(dev);
>
> +               /* enable clks if exist */
> +               if (priv->num_clks) {
> +                       ret = clk_bulk_prepare(priv->num_clks, priv->clks);
> +                       if (!ret) {
> +                               ret = clk_bulk_enable(priv->num_clks,
> +                                                     priv->clks);
> +                               if (ret) {
> +                                       clk_bulk_unprepare(priv->num_clks,
> +                                                          priv->clks);
> +                                       return;
> +                               }
> +                       }

I think you misunderstood my comment: you can replace the calls to
clk_bulk_prepare() and clk_bulk_enable() by a single call to
clk_bulk_prepare_enable().


Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux