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

Geert Uytterhoeven geert at linux-m68k.org
Tue Jun 13 07:25:15 UTC 2023


Hi Wolfram,

On Mon, Jun 12, 2023 at 10:43 PM Wolfram Sang <wsa at kernel.org> wrote:
> > 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.
>
> As I mentioned somewhere before, this is not the case. Ancillary devices
> are when one *driver* handles more than one address. Everything else has
> been handled differently in the past (for  all the uses I am aware of).
>
> Yet, I have another idea which is so simple that I wonder if it maybe
> has already been discussed so far?
>
> * have two regs in the bindings
> * use the second reg with i2c_new_client_device to instantiate the
>   RTC sibling. 'struct i2c_board_info', which is one parameter, should
>   have enough options to pass data, e.g it has a software_node.
>
> Should work or did I miss something here?

That should work, mostly (i2c_new_dummy_device() also calls
i2c_new_client_device()).  And as i2c_board_info has an of_node
member (something I had missed before!), the new I2C device
can access the clocks in the DT node using the standard way.

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