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,

On Mon, Jun 12, 2023 at 2:48 PM Wolfram Sang <wsa@xxxxxxxxxx> 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@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 DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux