Re: [PATCH 2/2] i2c: add ACPI support for I2C mux ports
From: Mika Westerberg
Date: Tue Oct 13 2015 - 07:34:51 EST
On Mon, Oct 12, 2015 at 11:32:31AM -0700, Dustin Byford wrote:
> I've been trying to consider the options, perhaps you can help my
> understanding. Using the i801 driver as an example, the device is PCI
> and the companion is associated with the PCI dev. The driver creates
> another device for the I2C interface (parented by the PCI device) by
> calling i2c_add_adapter(). The I2C dev has no ACPI companion.
>
> In the case of an I2C mux port, I've used acpi_preset_companion() to
> associate each mux port I2C device with a ACPI node. Unlike the i801,
> which has a single port, these companions are one per channel. It's not
> an option to associate them all with the I2C mux device.
>
> It seems like the options are to:
>
> a) Special case the I2C mux to use the per-port I2C companions as I've
> done here.
>
> b) Move (or copy?) the companion from the i801 PCI dev to the i801 I2C
> dev. Then we would always look in the same place for the companion.
> I think this approach has some advantages, at least it would make
> more sense if an I2C PCI controller had more than one I2C port, but
> I'm not sure that case exists. I didn't pursue this approach because
> it was specifically avoided in change b34bb1ee.
>
>
> What do you think? I'd be happy to try out any ideas you have.
I would favour b) because that follows DT (the I2C host controller
device and I2C adapter share the same DT node as far as I can tell).
Neither of them have similar concept of I2C adapter as we have in Linux
(which is the "virtual" device on top of the I2C host controller).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/