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

Geert Uytterhoeven geert at linux-m68k.org
Mon Jun 12 13:00:01 UTC 2023


Hi Wolfram,

On Mon, Jun 12, 2023 at 2:48 PM Wolfram Sang <wsa at kernel.org> wrote:
> > > 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?
>
> Maybe I am confusing something now, but if the RTC _needs_ to be
> enabled, then why we don't do it unconditionally?

1. DT describes the hardware, which listens to two addresses, so the
   device node should have two entries in the reg property.
2. The RTC is enabled by instantiating an i2c ancillary device, and lets the
   isl1208 driver bind against it.

> > > 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.
>
> I mean the driver should scan for the DT node. Not on the bus. But a
> phandle is probably safer.
>
> > 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...
>
> I see. I'll let it sink in some more.

Perhaps we should first think through what an ancillary device really
is.  My understanding is that it is used to talk to secondary addresses
of a multi-address I2C slave device.

What's different here compared to e.g. adv748x?
  - RAA215300 has a PMIC and an RTC, and there exists a separate
    RTC driver for a similar part (which is thus Linux-specific,
    not DT-specific!),
  - I don't know much about adv748x, but I understand there is a
    single driver talking to all subcomponents.
    What if in the future we e.g. would want to spin off part of it
    in a subdriver, as a subcomponent appeared in an unrelated device?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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


More information about the dri-devel mailing list