linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/27] Export I2C and OF module aliases in missing drivers
@ 2015-07-30 16:18 Javier Martinez Canillas
  2015-07-30 16:18 ` [PATCH 01/27] mfd: stw481x: Export I2C module alias information Javier Martinez Canillas
                   ` (27 more replies)
  0 siblings, 28 replies; 60+ messages in thread
From: Javier Martinez Canillas @ 2015-07-30 16:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, alsa-devel, Mark Brown, linux-iio,
	linux-fbdev, linux-i2c, linux-leds, Alexandre Belloni,
	Chanwoo Choi, Tomi Valkeinen, lm-sensors, Sebastian Reichel,
	linux-input, Greg Kroah-Hartman, Jean Delvare, Jonathan Cameron,
	linux-media, rtc-linux, linux-pm, Mauro Carvalho Chehab,
	Guenter Roeck, Benjamin Herrenschmidt, Wolfram Sang, Takashi Iwai,
	Liam Girdwood, Sjoerd Simons, Lee Jones, Bryan Wu, linux-omap,
	Sakari Ailus, linux-usb, linux-spi, Dmitry Torokhov,
	Tony Lindgren, MyungJoo Ham, linuxppc-dev

Hello,

Short version:

This series add the missing MODULE_DEVICE_TABLE() for OF and I2C tables
to export that information so modules have the correct aliases built-in
and autoloading works correctly.

Longer version:

Currently it's mandatory for I2C drivers to have an I2C device ID table
regardless if the device was registered using platform data or OF. This
is because the I2C core needs an I2C device ID table for two reasons:

1) Match the I2C client with a I2C device ID so a struct i2c_device_id
   is passed to the I2C driver probe() function.

2) Export the module aliases from the I2C device ID table so userspace
   can auto-load the correct module. This is because i2c_device_uevent
   always reports a MODALIAS of the form i2c:<client->name>.

Lee Jones posted a patch series [0] to solve 1) by allowing the I2C
drivers to have a probe() function that does not get a i2c_device_id.

The problem is that his series didn't take into account 2) so if that
was merged and the I2C ID table is removed from all the drivers that
don't needed it, module auto-loading will break for those.

But even now there are many I2C drivers were module auto-loading is
not working because of the fact that the I2C core always reports the
MODALIAS as i2c:<client->name> and many developers didn't expect this.

I've identified I2C drivers with 3 types of different issues:

a) Those that have an i2c_table but are not exported. The match works
   and the correct i2c_device_id is passed on probe but since the ID
   table is not exported, module auto-load won't work.

b) Those that have a of_table but are not exported. This is currently
   not an issue since even when the of_table is used to match the dev
   with the driver, an OF modalias is not reported by the I2C core.
   But if the I2C core is changed to report the MODALIAS of the form
   of:N*T*C as it's made by other subsystems, then module auto-load
   will break for these drivers.

c) Those that don't have a of_table but should since are OF drivers
   with DT bindings doc for them. Since the I2C core does not report
   a OF modalias and since i2c_device_match() fallbacks to match the
   device part of the compatible string with the I2C device ID table,
   many OF drivers don't have an of_table to match. After all having
   a I2C device ID table is mandatory so it works without a of_table.

So, in order to not make mandatory to have a I2C device ID table, at
least a) and b) needs to be addressed, this series does that.

c) should be fixed too since it seems wrong that a driver with a DT
binding document, does not have a OF table and export it to modules.

Also stripping the vendor part from the compatible string to match
with the I2C devices ID table and reporting only the device name to
user-space doesn't seem to be correct. I've identified at least two
drivers that have the same name on their I2C device ID table so the
manufacturer prefix is important. But I've not tried to fix c) yet
since that is not so easy to automate due drivers not having all the
information (i.e: the device name can match a documented compatible
string device part but without the vendor prefix is hard to tell).

I split the changes so the patches in this series are independent and
can be picked individually by subsystem maintainers. Patch #27 changes
the logic of i2c_device_uevent() to report an OF modalias if the device
was registered using OF. But this patch is included in the series only
as an RFC for illustration purposes since changing that without fixing
c) will break module auto-loading for the drivers of devices registered
with OF but that don't have a of_match_table.

Although arguably, those drivers were relying on the assumption that a
MODALIAS=i2c:<foo> would always be reported even for the OF case which
is not the true on other subsystems.

[0]: https://lkml.org/lkml/2014/8/28/283

Best regards,
Javier


Javier Martinez Canillas (27):
  mfd: stw481x: Export I2C module alias information
  spi: xcomm: Export I2C module alias information
  iio: Export I2C module alias information in missing drivers
  [media] Export I2C module alias information in missing drivers
  macintosh: therm_windtunnel: Export I2C module alias information
  misc: eeprom: Export I2C module alias information in missing drivers
  Input: Export I2C module alias information in missing drivers
  power: Export I2C module alias information in missing drivers
  i2c: core: Export I2C module alias information in dummy driver
  backlight: tosa: Export I2C module alias information
  [media] staging: media: lirc: Export I2C module alias information
  usb: phy: isp1301: Export I2C module alias information
  ALSA: ppc: keywest: Export I2C module alias information
  hwmon: (nct7904) Export I2C module alias information
  regulator: fan53555: Export I2C module alias information
  mfd: Export OF module alias information in missing drivers
  iio: Export OF module alias information in missing drivers
  hwmon: (g762) Export OF module alias information
  extcon: Export OF module alias information in missing drivers
  ASoC: Export OF module alias information in missing codec drivers
  rtc: Export OF module alias information in missing drivers
  macintosh: therm_windtunnel: Export OF module alias information
  leds: Export OF module alias information in missing drivers
  [media] smiapp: Export OF module alias information
  Input: touchscreen - Export OF module alias information
  regulator: isl9305: Export OF module alias information
  i2c: (RFC, don't apply) report OF style modalias when probing using DT

 drivers/extcon/extcon-rt8973a.c         | 1 +
 drivers/extcon/extcon-sm5502.c          | 1 +
 drivers/hwmon/g762.c                    | 1 +
 drivers/hwmon/nct7904.c                 | 1 +
 drivers/i2c/i2c-core.c                  | 9 +++++++++
 drivers/iio/accel/mma8452.c             | 1 +
 drivers/iio/accel/stk8312.c             | 1 +
 drivers/iio/accel/stk8ba50.c            | 1 +
 drivers/iio/light/cm32181.c             | 1 +
 drivers/iio/light/cm3232.c              | 1 +
 drivers/iio/light/cm36651.c             | 1 +
 drivers/iio/light/gp2ap020a00f.c        | 1 +
 drivers/iio/light/stk3310.c             | 1 +
 drivers/input/misc/gp2ap002a00f.c       | 1 +
 drivers/input/touchscreen/egalax_ts.c   | 1 +
 drivers/input/touchscreen/goodix.c      | 1 +
 drivers/input/touchscreen/mms114.c      | 1 +
 drivers/leds/leds-pca963x.c             | 1 +
 drivers/leds/leds-tca6507.c             | 1 +
 drivers/macintosh/therm_windtunnel.c    | 2 ++
 drivers/media/i2c/ir-kbd-i2c.c          | 1 +
 drivers/media/i2c/s5k6a3.c              | 1 +
 drivers/media/i2c/smiapp/smiapp-core.c  | 1 +
 drivers/mfd/rt5033.c                    | 1 +
 drivers/mfd/stw481x.c                   | 1 +
 drivers/mfd/tps65217.c                  | 1 +
 drivers/mfd/tps65218.c                  | 1 +
 drivers/misc/eeprom/eeprom.c            | 1 +
 drivers/misc/eeprom/max6875.c           | 1 +
 drivers/power/bq24190_charger.c         | 1 +
 drivers/power/rt5033_battery.c          | 2 +-
 drivers/regulator/fan53555.c            | 1 +
 drivers/regulator/isl9305.c             | 1 +
 drivers/rtc/rtc-ab-b5ze-s3.c            | 1 +
 drivers/rtc/rtc-isl12022.c              | 1 +
 drivers/rtc/rtc-isl12057.c              | 1 +
 drivers/spi/spi-xcomm.c                 | 1 +
 drivers/staging/media/lirc/lirc_zilog.c | 1 +
 drivers/usb/phy/phy-isp1301.c           | 1 +
 drivers/video/backlight/tosa_bl.c       | 1 +
 sound/ppc/keywest.c                     | 1 +
 sound/soc/codecs/da9055.c               | 1 +
 sound/soc/codecs/wm8510.c               | 1 +
 sound/soc/codecs/wm8523.c               | 1 +
 sound/soc/codecs/wm8580.c               | 1 +
 45 files changed, 54 insertions(+), 1 deletion(-)

-- 
2.4.3


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

end of thread, other threads:[~2015-08-25 17:50 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30 16:18 [PATCH 00/27] Export I2C and OF module aliases in missing drivers Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 01/27] mfd: stw481x: Export I2C module alias information Javier Martinez Canillas
2015-08-10 12:48   ` Lee Jones
2015-07-30 16:18 ` [PATCH 02/27] spi: xcomm: " Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 03/27] iio: Export I2C module alias information in missing drivers Javier Martinez Canillas
2015-08-02 15:35   ` Jonathan Cameron
2015-07-30 16:18 ` [PATCH 04/27] [media] " Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 05/27] macintosh: therm_windtunnel: Export I2C module alias information Javier Martinez Canillas
2015-08-18 10:24   ` [05/27] " Michael Ellerman
2015-08-18 10:35     ` Javier Martinez Canillas
2015-08-19  0:51       ` Michael Ellerman
2015-08-19  7:40         ` Javier Martinez Canillas
2015-08-20  8:38   ` Michael Ellerman
2015-07-30 16:18 ` [PATCH 06/27] misc: eeprom: Export I2C module alias information in missing drivers Javier Martinez Canillas
2015-08-03 11:05   ` Jean Delvare
2015-08-03 14:07     ` Javier Martinez Canillas
2015-08-03 16:50       ` Jean Delvare
2015-08-03 19:12         ` Javier Martinez Canillas
2015-08-04  7:19           ` Jean Delvare
2015-08-04  7:21             ` Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 07/27] Input: " Javier Martinez Canillas
2015-07-30 17:39   ` Dmitry Torokhov
2015-07-30 16:18 ` [PATCH 08/27] power: " Javier Martinez Canillas
2015-08-05  3:47   ` Sebastian Reichel
2015-07-30 16:18 ` [PATCH 09/27] i2c: core: Export I2C module alias information in dummy driver Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 10/27] backlight: tosa: Export I2C module alias information Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 11/27] [media] staging: media: lirc: " Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 12/27] usb: phy: isp1301: " Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 13/27] ALSA: ppc: keywest: " Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 14/27] hwmon: (nct7904) " Javier Martinez Canillas
2015-07-31  0:58   ` [lm-sensors] " Guenter Roeck
2015-07-30 16:18 ` [PATCH 15/27] regulator: fan53555: " Javier Martinez Canillas
2015-08-03 11:43   ` Paul Bolle
2015-08-03 14:29     ` Javier Martinez Canillas
2015-08-04 10:08       ` Paul Bolle
2015-08-04 10:33         ` Javier Martinez Canillas
2015-08-03 15:44     ` Mark Brown
2015-07-30 16:18 ` [PATCH 16/27] mfd: Export OF module alias information in missing drivers Javier Martinez Canillas
2015-08-10 12:48   ` Lee Jones
2015-07-30 16:18 ` [PATCH 17/27] iio: " Javier Martinez Canillas
2015-08-02 15:39   ` Jonathan Cameron
2015-07-30 16:18 ` [PATCH 18/27] hwmon: (g762) Export OF module alias information Javier Martinez Canillas
2015-07-31  0:58   ` Guenter Roeck
2015-07-30 16:18 ` [PATCH 19/27] extcon: Export OF module alias information in missing drivers Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 20/27] ASoC: Export OF module alias information in missing codec drivers Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 21/27] rtc: Export OF module alias information in missing drivers Javier Martinez Canillas
2015-08-09 22:59   ` Alexandre Belloni
2015-07-30 16:18 ` [PATCH 22/27] macintosh: therm_windtunnel: Export OF module alias information Javier Martinez Canillas
2015-08-20  8:38   ` [22/27] " Michael Ellerman
2015-07-30 16:18 ` [PATCH 23/27] leds: Export OF module alias information in missing drivers Javier Martinez Canillas
2015-08-04 10:32   ` Jacek Anaszewski
2015-07-30 16:18 ` [PATCH 24/27] [media] smiapp: Export OF module alias information Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 25/27] Input: touchscreen - " Javier Martinez Canillas
2015-07-30 17:40   ` Dmitry Torokhov
2015-07-30 16:18 ` [PATCH 26/27] regulator: isl9305: " Javier Martinez Canillas
2015-08-25 17:50   ` Applied "regulator: isl9305: Export OF module alias information" to the regulator tree Mark Brown
2015-07-30 16:18 ` [PATCH 27/27] i2c: (RFC, don't apply) report OF style modalias when probing using DT Javier Martinez Canillas
2015-07-30 16:35 ` [PATCH 00/27] Export I2C and OF module aliases in missing drivers Dmitry Torokhov
2015-07-30 16:37   ` Dmitry Torokhov
2015-07-30 17:13     ` 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).