Re: [PATCH] ARM: dts: r7s72100: fix sdhi clock define

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

 




Hi Chris,

CC Woflram

On Fri, Jan 13, 2017 at 6:56 PM, Chris Brandt <Chris.Brandt@xxxxxxxxxxx> wrote:
> On Friday, January 13, 2017, Geert Uytterhoeven wrote:
>> > In sh_mobile_sdhi.c, can we change sh_mobile_sdhi_probe() so that if
>> > there are 2 clocks specified (in DT or platform data), it
>> > automatically enables the 2nd clock (forever) and just uses the 1st
>> clock as the on/off clock?
>>
>> Of course the driver can handle the second interrupt, if you update the
>> binding, and add support code for that...
>
> Of course my idea is that I would only have to update the bindings for
> RZ/A1...not any other device.
>
> My only question is, today sh_mobile_sdhi.c uses this:
>
>    priv->clk = devm_clk_get(&pdev->dev, NULL);
>
> to get the clock. But if there is a 2nd clock...how do I know the
> string id name to look to replace NULL with??

That should be specified in the bindings. "NULL" will get you the first clock.

> Or...for the RZ/A1 dtsi, should I just give the 2 clocks names:
>
>                 clocks = <&mstp12_clks R7S72100_CLK_SDHI00,
>                                 &mstp12_clks R7S72100_CLK_SDHI01>;
>                 clock-names = "core", "cd";

Something like that.
If devm_clk_get(&pdev->dev, "core") fails, you can assume a single clock
and retry with NULL.

> and then in the code do:
>
>         struct *cd_clk;
>         cd_clk = devm_clk_get(&pdev->dev, "cd");
>         if (cd_clk) {
>                 clk_prepare_enable(cd_clk);
>         }
>
>   (this simple 1-line fix patch is getting a lot more complicated)

Disclaimer: I don't know how/if the SDHI core manages clocks, and may
interfere. Adding Wolfram.

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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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