linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] i2c: scan ACPI enumerated I2C mux channels
@ 2015-08-13 23:59 Dustin Byford
  2015-08-13 23:59 ` [RFC PATCH 1/1] i2c: acpi: " Dustin Byford
                   ` (5 more replies)
  0 siblings, 6 replies; 57+ messages in thread
From: Dustin Byford @ 2015-08-13 23:59 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, linux-kernel


I would like to add support for scanning I2C devices connected to ACPI
OF compatible muxes described in ASL like this:

Device (MUX0)
{
    Name (_ADR, 0x70)
    Name (_HID, "PRP0001")
    Name (_CRS, ResourceTemplate()
    {
        I2cSerialBus (0x70, ControllerInitiated, I2C_SPEED,
                      AddressingMode7Bit, "^^SMB2", 0x00,
                      ResourceConsumer,,)
    })
    Name (_DSD, Package ()
    {
        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
        Package () {
            Package (2) { "compatible", "nxp,pca9548" },
        }
    })

    // MUX channels
    Device (CH00) { Name (_ADR, 0x0) }
}

Scope(MUX0.CH00)
{
    Device (TMP0) {
        /* Temp sensor ASL, for example. */
    }
}

It seems like a reasonable way to describe a common I2C component and
kernel support is almost there.

I had to:

1) Find and set an ACPI companion for the "virtual" I2C adapters created
   for each mux channel.

2) Make sure to scan adap.dev when registering devices under each mux
   channel.

At first, I was confused about why adap.dev->parent is used in
acpi_i2c_register_devices().  I found b34bb1ee from 4/2013 (ACPI / I2C:
Use parent's ACPI_HANDLE()), which offers an explanation.

This patch works well, but I'm not sure about the code to just fall back
to using adap.dev when adap.dev->parent doesn't have an ACPI companion.
Is there a more explicit check I can make to determine if the adapter
represents a mux channel?

Any feedback would be welcome.  Thanks,

   --Dustin

Dustin Byford (1):
  i2c: acpi: scan ACPI enumerated I2C mux channels

 drivers/i2c/i2c-core.c | 10 ++++++++++
 drivers/i2c/i2c-mux.c  |  8 ++++++++
 2 files changed, 18 insertions(+)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 57+ messages in thread

end of thread, other threads:[~2015-10-25 15:15 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13 23:59 [RFC PATCH 0/1] i2c: scan ACPI enumerated I2C mux channels Dustin Byford
2015-08-13 23:59 ` [RFC PATCH 1/1] i2c: acpi: " Dustin Byford
2015-08-14 19:31 ` [RFC v2 0/1] " Dustin Byford
2015-08-14 19:31   ` [RFC v2 1/1] " Dustin Byford
2015-10-09 21:42     ` Wolfram Sang
2015-10-09 21:50       ` Dustin Byford
2015-10-09 21:51         ` Wolfram Sang
2015-08-15 20:22   ` [RFC v2 0/1] " Wolfram Sang
2015-08-17 12:03   ` Mika Westerberg
2015-08-17 19:00     ` Dustin Byford
2015-10-10  0:41   ` [PATCH 0/2] " Dustin Byford
2015-10-10  0:41     ` [PATCH 1/2] i2c: scan entire ACPI namespace for I2C connections Dustin Byford
2015-10-12 10:46       ` Mika Westerberg
2015-10-12 11:20         ` Andy Shevchenko
2015-10-12 17:00           ` Dustin Byford
2015-10-12 19:01       ` Rafael J. Wysocki
2015-10-12 18:57         ` Dustin Byford
2015-10-10  0:41     ` [PATCH 2/2] i2c: add ACPI support for I2C mux ports Dustin Byford
2015-10-10  1:03       ` kbuild test robot
2015-10-12 10:50       ` Mika Westerberg
2015-10-12 18:32         ` Dustin Byford
2015-10-13 11:32           ` Mika Westerberg
2015-10-19  9:01 ` [PATCH v2 0/1] i2c: acpi: scan ACPI enumerated I2C mux channels Dustin Byford
2015-10-19 22:28 ` [PATCH v3 " Dustin Byford
2015-10-19 22:29   ` [PATCH v3 1/1] i2c: add ACPI support for I2C mux ports Dustin Byford
2015-10-20  9:16     ` Andy Shevchenko
2015-10-20 12:51     ` Mika Westerberg
2015-10-20 17:49       ` Dustin Byford
2015-10-20 23:13         ` Rafael J. Wysocki
2015-10-21  8:12         ` Mika Westerberg
2015-10-21  8:21           ` Dustin Byford
2015-10-21  8:34             ` Mika Westerberg
2015-10-21  8:52               ` Dustin Byford
2015-10-21  9:08                 ` Mika Westerberg
2015-10-21  9:25                   ` Dustin Byford
2015-10-21 22:39                     ` Rafael J. Wysocki
2015-10-22  9:27                       ` Dustin Byford
2015-10-20 23:12       ` Rafael J. Wysocki
2015-10-21  8:02         ` Mika Westerberg
2015-10-22  9:17 ` [PATCH v4 0/2] i2c: acpi: scan ACPI enumerated I2C mux channels Dustin Byford
2015-10-22  9:17   ` [PATCH v4 1/2] acpi: add acpi_preset_companion() stub Dustin Byford
2015-10-23  8:33     ` Mika Westerberg
2015-10-25 13:40     ` Rafael J. Wysocki
2015-10-25 15:01       ` Rafael J. Wysocki
2015-10-22  9:17   ` [PATCH v4 2/2] i2c: add ACPI support for I2C mux ports Dustin Byford
2015-10-23  8:40     ` Mika Westerberg
2015-10-23 10:16       ` Wolfram Sang
2015-10-23 13:13         ` Mika Westerberg
2015-10-23 13:40           ` Mika Westerberg
2015-10-23 13:55             ` Jarkko Nikula
2015-10-23 19:27 ` [PATCH v5 0/2] i2c: acpi: scan ACPI enumerated I2C mux channels Dustin Byford
2015-10-23 19:27   ` [PATCH v5 1/2] acpi: add acpi_preset_companion() stub Dustin Byford
2015-10-24 16:41     ` Wolfram Sang
2015-10-25 15:00       ` Rafael J. Wysocki
2015-10-23 19:27   ` [PATCH v5 2/2] i2c: add ACPI support for I2C mux ports Dustin Byford
2015-10-25 14:53   ` [PATCH v5 0/2] i2c: acpi: scan ACPI enumerated I2C mux channels Wolfram Sang
2015-10-25 15:15     ` Dustin Byford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).