linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] IIO: st_sensors_i2c: improve device enumeration
@ 2018-06-29 10:30 Nikolaus Voss
  2018-06-29  8:10 ` [PATCH 1/3] IIO: st_accel_i2c.c: Use fallback if DT/ACPI enum failed Nikolaus Voss
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Nikolaus Voss @ 2018-06-29 10:30 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Lorenzo Bianconi, Linus Walleij,
	Xiongfeng Wang
  Cc: linux-iio, linux-kernel

When trying to instantiate a st_accel_i2c device from an ACPI based
system, I ran into some problems:

For my device, there is no ACPI match table entry, so rather than
creating /allocating a new ACPI HID for the device, I wanted to use an
existing DT table compatible entry via creating an ACPI_DT_NAMESPACE_HID
/PRP0001 HID ACPI entry (see Documentation/acpi/enumeration.txt).

This did not work because st_accel_i2c.c bails out if there is a ACPI
node but no ACPI table match instead of looking for a match from one of
the fallback mechanisms (patch 1).

Patch 2 removes an error message when a ACPI node exists but no table
entry is found (this doesn't need to be fatal because of the fallback).

Patch 3 syncs the strings in the I2C device table (which is used by the
I2C core for fallback matching) with the DT compatible strings, so a
PRP0001 entry can use the same compatible strings as a corresponding
DT entry. As far as I can see, the old I2C table strings aren't used
in mainline, so renaming them should be safe.

Nikolaus Voss (3):
  IIO: st_accel_i2c.c: Use fallback if DT/ACPI enum failed
  IIO: st_sensors_i2c.c: Don't print error on failed ACPI match
  IIO: st_accel.h: sync DT and I2C device ID table strings

 drivers/iio/accel/st_accel.h                  | 32 +++++++++----------
 drivers/iio/accel/st_accel_i2c.c              | 21 ++++++------
 .../iio/common/st_sensors/st_sensors_i2c.c    |  5 ++-
 3 files changed, 30 insertions(+), 28 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2018-07-03  8:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-29 10:30 [PATCH 0/3] IIO: st_sensors_i2c: improve device enumeration Nikolaus Voss
2018-06-29  8:10 ` [PATCH 1/3] IIO: st_accel_i2c.c: Use fallback if DT/ACPI enum failed Nikolaus Voss
2018-06-30 15:28   ` Jonathan Cameron
2018-07-02  6:53     ` Nikolaus Voss
2018-07-02 13:05       ` Jonathan Cameron
2018-06-29  8:19 ` [PATCH 2/3] IIO: st_sensors_i2c.c: Don't print error on failed ACPI match Nikolaus Voss
2018-06-29  8:45 ` [PATCH 3/3] IIO: st_accel.h: sync DT and I2C device ID table strings Nikolaus Voss
2018-06-30 15:33   ` Jonathan Cameron
2018-07-02  7:32     ` Nikolaus Voss
2018-06-29 20:19 ` [PATCH 0/3] IIO: st_sensors_i2c: improve device enumeration Andy Shevchenko
2018-07-02  6:41   ` Nikolaus Voss
2018-07-02 16:14     ` Andy Shevchenko
2018-07-03  8:18       ` Nikolaus Voss

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).