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

Biju Das biju.das.jz at bp.renesas.com
Wed Jun 7 10:58:46 UTC 2023


Hi Wolfram,

> Subject: Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API
> 
> Hi all,
> 
> sorry for not being able to chime in earlier.
> 
> > In Biju's particular use case, the i2c device responds to two
> > addresses, which is the standard i2c ancillary use case.  However,
> > what's special
> 
> Not quite. ancillary is used when a *driver* needs to take care of two
> addresses. We already have devices bundling two features into the same
> chip. I recall at least RTC + EEPROM somewhere. And so far, we have been
> handling this by creating two nodes in DT and have proper binding docs.
> I think this is cleaner. First, you can see in DT already what the
> compound device really consists of. In this case, which RTC and RTC driver
> is exactly needed. Second, the code added here adds complexity to the I2C
> core with another layer of inderection for dummy devices.

FYI, please see [1] and [2] 

As per DT maintainers, most of PMICs are described with one node, even though RTC is on separate
address. According to them the DT schema allows multiple addresses for children.
But currently we lacks implementation for that. The enhancement to this API allows that.

[1]
https://lore.kernel.org/linux-renesas-soc/bce6cbcd-b693-4027-7d17-8e582b8fa2f9@linaro.org/

and 
[2]
https://lore.kernel.org/linux-renesas-soc/CAMuHMdVrH5R4mAjm1c9zRqiGhNsfT7Y13xxaV-v05T-MCJ6=RQ@mail.gmail.com/

Cheers,
Biju


> 
> > As some resources are shared (knowledge about the clocks), splitting
> > this in two distinct devices in DT (which is what Biju's initial patch
> > series did) would need phandles to link both nodes together.
> >
> > Do you have a better idea how to represent this?
> 
> Not sure if I understood this chip correctly, but maybe: The PMIC driver
> exposes a clock gate which can be consumed by the RTC driver?
> 
> Happy hacking,
> 
>    Wolfram



More information about the dri-devel mailing list