linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] IIO: st_sensors_i2c: improve device enumeration
@ 2018-07-03  6:34 Nikolaus Voss
  2018-07-03  5:41 ` [PATCH v2 1/2] IIO: st_accel_i2c.c: Simplify access to driver data Nikolaus Voss
  2018-07-03  6:06 ` [PATCH v2 2/2] IIO: st_accel_i2c.c: Use probe_new() instead of probe() Nikolaus Voss
  0 siblings, 2 replies; 25+ messages in thread
From: Nikolaus Voss @ 2018-07-03  6:34 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Lorenzo Bianconi, Linus Walleij,
	Xiongfeng Wang, Andy Shevchenko, nv
  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. Use device_get_match_data API to get the
right driver data.

acpi_device_get_match_data() currently doesn't return DT compatible
matches. A separate patch is submitted to fix this.

v2:
  - use device_get_match_data API as suggested by Andy Shevchenko
  - removed syncing DT/I2C table names as Jonathan Cameron pointed out
    this would be an ABI change
  - converting from probe() to probe_new() is moved into a separate
    patch (as suggested by Jonathan Cameron)

Nikolaus Voss (2):
  IIO: st_accel_i2c.c: Simplify access to driver data
  IIO: st_accel_i2c.c: Use probe_new() instead of probe()

 drivers/iio/accel/st_accel_i2c.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

-- 
2.17.1


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

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

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-03  6:34 [PATCH v2 0/2] IIO: st_sensors_i2c: improve device enumeration Nikolaus Voss
2018-07-03  5:41 ` [PATCH v2 1/2] IIO: st_accel_i2c.c: Simplify access to driver data Nikolaus Voss
2018-07-03 21:07   ` Andy Shevchenko
2018-07-04  6:56     ` Nikolaus Voss
2018-07-04  9:00       ` Andy Shevchenko
2018-07-03  6:06 ` [PATCH v2 2/2] IIO: st_accel_i2c.c: Use probe_new() instead of probe() Nikolaus Voss
2018-07-03 22:54   ` Andy Shevchenko
2018-07-04  6:37     ` Nikolaus Voss
2018-07-04  8:58       ` Andy Shevchenko
2018-07-04  9:09         ` Nikolaus Voss
2018-07-04  9:16           ` Andy Shevchenko
2018-07-04  9:42             ` Nikolaus Voss
2018-07-04 10:19               ` Andy Shevchenko
2018-07-04 10:49                 ` Javier Martinez Canillas
2018-07-04 11:15                   ` Nikolaus Voss
2018-07-04 11:26                     ` Javier Martinez Canillas
2018-07-04 11:32                       ` Javier Martinez Canillas
2018-07-04 11:46                       ` Nikolaus Voss
2018-07-04 12:09                         ` Javier Martinez Canillas
2018-07-04 12:31                           ` Nikolaus Voss
2018-07-04 12:37                             ` Javier Martinez Canillas
2018-07-04 13:24                               ` Nikolaus Voss
2018-07-04 13:44                                 ` Javier Martinez Canillas
2018-07-04 16:11                                   ` Andy Shevchenko
2018-07-04 18:53                                     ` Javier Martinez Canillas

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