Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API

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

 



Hi Wolfram, Laurent,

On Mon, Jun 12, 2023 at 2:36 PM Wolfram Sang <wsa@xxxxxxxxxx> wrote:
> > DT-Maintainers suggestion:
> > [1]
> > raa215300: pmic@12 {
> >       compatible = "renesas,raa215300";

If you go for separate nodes: "renesas,raa215300-pmic".

> >       reg = <0x12>, <0x6f>;
> >       reg-names = "main", "rtc";
> >
> >       clocks = <&x2>;
> >       clock-names = "xin";
> >       /* Add Optional shared IRQ resource and share it to child and handle it both in parent and child */
> > };
>
> Would this binding allow to not use the RTC if the second reg is
> missing? What are the advantages of not enabling RTC? Saving power?

It doesn't work if there is no clock?

> > Laurent/Wolfram suggestion to split it into two nodes and get rid of this patch:
> > [2]
> >       raa215300: pmic @12 {
> >               compatible = "renesas,raa215300";
> >               reg = <0x12>;
> >
> >               /* Add Optional shared IRQ */
> >               renesas,raa215300-rtc = <&rtc_raa215300>; /* Parse the handle and Enable RTC , if present.*/
>
> Thinking more about this: DT is hardware description, so the RTC should
> always be described in DT. If the RTC is actually activated is more a
> configuration thing, or? Brainstorming: maybe the PMIC driver could try
> to find the node with reg == 0x6f and see if firmware has enabled it or
> not?

I guess the RTC part would acknowledge anyway?
It is always present, it is just part of the RAA215300.

> >       };
> >
> >       rtc_raa215300: rtc@6f {
> >               compatible = "renesas,raa215300-isl1208";

If you go for separate nodes:  "renesas,raa215300-rtc".

> >               reg = <0x6f>;
> >
> >               /* Add Optional shared IRQ */
> >               clocks = <&x2>;
> >               clock-names = "xin";
> >               renesas,raa215300-pmic = <&pmic>; /* Parse the handle to get PMIC version to check Oscillator bit is inverted or not */
> >       };
>
> I have been scratching my head around this and wondered about one thing.
> The RTC driver needs to know if the oscillator bit is inverted. AFAIU
> this depends on the version of the PMIC (which includes the RTC). So,
> can't we simply encode the version in the compatible string?
>
> >               compatible = "renesas,raa215300-isl1208-01";
> >               compatible = "renesas,raa215300-isl1208-a0";
>
> I dunno the exact versions, but you probably get the idea.

Sure, you can put that in DT.  But it's a pity you have to do that,
as the device (the PMIC part) does know the revision...
That's why I suggested to let the PMIC part instantiate an i2c ancillary
device...

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]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux