* [PATCH 03/27] iio: Export I2C module alias information in missing drivers
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 ` Javier Martinez Canillas
2015-08-02 15:35 ` Jonathan Cameron
2015-07-30 16:18 ` [PATCH 17/27] iio: Export OF " Javier Martinez Canillas
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Javier Martinez Canillas @ 2015-07-30 16:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, linux-iio, Jonathan Cameron
The I2C core always reports the MODALIAS uevent as "i2c:<client name"
regardless if the driver was matched using the I2C id_table or the
of_match_table. So the driver needs to export the I2C table and this
be built into the module or udev won't have the necessary information
to auto load the correct module when the device is added.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/iio/accel/stk8312.c | 1 +
drivers/iio/accel/stk8ba50.c | 1 +
drivers/iio/light/stk3310.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c
index c2bd1444d6da..a553736b6e51 100644
--- a/drivers/iio/accel/stk8312.c
+++ b/drivers/iio/accel/stk8312.c
@@ -662,6 +662,7 @@ static const struct i2c_device_id stk8312_i2c_id[] = {
{"STK8312", 0},
{}
};
+MODULE_DEVICE_TABLE(i2c, stk8312_i2c_id);
static const struct acpi_device_id stk8312_acpi_id[] = {
{"STK8312", 0},
diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c
index 16cee637109b..80f77d8704b5 100644
--- a/drivers/iio/accel/stk8ba50.c
+++ b/drivers/iio/accel/stk8ba50.c
@@ -572,6 +572,7 @@ static const struct i2c_device_id stk8ba50_i2c_id[] = {
{"stk8ba50", 0},
{}
};
+MODULE_DEVICE_TABLE(i2c, stk8ba50_i2c_id);
static const struct acpi_device_id stk8ba50_acpi_id[] = {
{"STK8BA50", 0},
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index 48ff7942fa00..993eb201148e 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -672,6 +672,7 @@ static const struct i2c_device_id stk3310_i2c_id[] = {
{"STK3311", 0},
{}
};
+MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id);
static const struct acpi_device_id stk3310_acpi_id[] = {
{"STK3310", 0},
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 03/27] iio: Export I2C module alias information in missing drivers
2015-07-30 16:18 ` [PATCH 03/27] iio: Export I2C module alias information " Javier Martinez Canillas
@ 2015-08-02 15:35 ` Jonathan Cameron
0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Cameron @ 2015-08-02 15:35 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: linux-iio
On 30/07/15 17:18, Javier Martinez Canillas wrote:
> The I2C core always reports the MODALIAS uevent as "i2c:<client name"
> regardless if the driver was matched using the I2C id_table or the
> of_match_table. So the driver needs to export the I2C table and this
> be built into the module or udev won't have the necessary information
> to auto load the correct module when the device is added.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Applied to the togreg branch of iio.git
Thanks,
Jonathan
>
> ---
>
> drivers/iio/accel/stk8312.c | 1 +
> drivers/iio/accel/stk8ba50.c | 1 +
> drivers/iio/light/stk3310.c | 1 +
> 3 files changed, 3 insertions(+)
>
> diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c
> index c2bd1444d6da..a553736b6e51 100644
> --- a/drivers/iio/accel/stk8312.c
> +++ b/drivers/iio/accel/stk8312.c
> @@ -662,6 +662,7 @@ static const struct i2c_device_id stk8312_i2c_id[] = {
> {"STK8312", 0},
> {}
> };
> +MODULE_DEVICE_TABLE(i2c, stk8312_i2c_id);
>
> static const struct acpi_device_id stk8312_acpi_id[] = {
> {"STK8312", 0},
> diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c
> index 16cee637109b..80f77d8704b5 100644
> --- a/drivers/iio/accel/stk8ba50.c
> +++ b/drivers/iio/accel/stk8ba50.c
> @@ -572,6 +572,7 @@ static const struct i2c_device_id stk8ba50_i2c_id[] = {
> {"stk8ba50", 0},
> {}
> };
> +MODULE_DEVICE_TABLE(i2c, stk8ba50_i2c_id);
>
> static const struct acpi_device_id stk8ba50_acpi_id[] = {
> {"STK8BA50", 0},
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
> index 48ff7942fa00..993eb201148e 100644
> --- a/drivers/iio/light/stk3310.c
> +++ b/drivers/iio/light/stk3310.c
> @@ -672,6 +672,7 @@ static const struct i2c_device_id stk3310_i2c_id[] = {
> {"STK3311", 0},
> {}
> };
> +MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id);
>
> static const struct acpi_device_id stk3310_acpi_id[] = {
> {"STK3310", 0},
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 17/27] iio: Export OF module alias information in missing drivers
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 03/27] iio: Export I2C module alias information " Javier Martinez Canillas
@ 2015-07-30 16:18 ` Javier Martinez Canillas
2015-08-02 15:39 ` Jonathan Cameron
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
3 siblings, 1 reply; 9+ messages in thread
From: Javier Martinez Canillas @ 2015-07-30 16:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, linux-iio, Jonathan Cameron
The I2C core always reports the MODALIAS uevent as "i2c:<client name"
regardless if the driver was matched using the I2C id_table or the
of_match_table. So technically there's no need for a driver to export
the OF table since currently it's not used.
In fact, the I2C device ID table is mandatory for I2C drivers since
a i2c_device_id is passed to the driver's probe function even if the
I2C core used the OF table to match the driver.
And since the I2C core uses different tables, OF-only drivers needs to
have duplicated data that has to be kept in sync and also the dev node
compatible manufacturer prefix is stripped when reporting the MODALIAS.
To avoid the above, the I2C core behavior may be changed in the future
to not require an I2C device table for OF-only drivers and report the
OF module alias. So, it's better to also export the OF table to prevent
breaking module autoloading if that happens.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/iio/accel/mma8452.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 +
5 files changed, 5 insertions(+)
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 13ea1ea23328..b7ad3dce6ff4 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -968,6 +968,7 @@ static const struct of_device_id mma8452_dt_ids[] = {
{ .compatible = "fsl,mma8452" },
{ }
};
+MODULE_DEVICE_TABLE(of, mma8452_dt_ids);
static struct i2c_driver mma8452_driver = {
.driver = {
diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c
index 1c0de2f8885d..d6fd0dace74f 100644
--- a/drivers/iio/light/cm32181.c
+++ b/drivers/iio/light/cm32181.c
@@ -353,6 +353,7 @@ static const struct of_device_id cm32181_of_match[] = {
{ .compatible = "capella,cm32181" },
{ }
};
+MODULE_DEVICE_TABLE(of, cm32181_of_match);
static struct i2c_driver cm32181_driver = {
.driver = {
diff --git a/drivers/iio/light/cm3232.c b/drivers/iio/light/cm3232.c
index 1b508c65877c..fe89b6823217 100644
--- a/drivers/iio/light/cm3232.c
+++ b/drivers/iio/light/cm3232.c
@@ -417,6 +417,7 @@ static const struct of_device_id cm3232_of_match[] = {
{.compatible = "capella,cm3232"},
{}
};
+MODULE_DEVICE_TABLE(of, cm3232_of_match);
static struct i2c_driver cm3232_driver = {
.driver = {
diff --git a/drivers/iio/light/cm36651.c b/drivers/iio/light/cm36651.c
index 2a39e141e90c..c8d7b5ea7e78 100644
--- a/drivers/iio/light/cm36651.c
+++ b/drivers/iio/light/cm36651.c
@@ -731,6 +731,7 @@ static const struct of_device_id cm36651_of_match[] = {
{ .compatible = "capella,cm36651" },
{ }
};
+MODULE_DEVICE_TABLE(of, cm36651_of_match);
static struct i2c_driver cm36651_driver = {
.driver = {
diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c
index 0334a814b5eb..6d41086f7c64 100644
--- a/drivers/iio/light/gp2ap020a00f.c
+++ b/drivers/iio/light/gp2ap020a00f.c
@@ -1634,6 +1634,7 @@ static const struct of_device_id gp2ap020a00f_of_match[] = {
{ .compatible = "sharp,gp2ap020a00f" },
{ }
};
+MODULE_DEVICE_TABLE(of, gp2ap020a00f_of_match);
#endif
static struct i2c_driver gp2ap020a00f_driver = {
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 17/27] iio: Export OF module alias information in missing drivers
2015-07-30 16:18 ` [PATCH 17/27] iio: Export OF " Javier Martinez Canillas
@ 2015-08-02 15:39 ` Jonathan Cameron
0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Cameron @ 2015-08-02 15:39 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: linux-iio
On 30/07/15 17:18, Javier Martinez Canillas wrote:
> The I2C core always reports the MODALIAS uevent as "i2c:<client name"
> regardless if the driver was matched using the I2C id_table or the
> of_match_table. So technically there's no need for a driver to export
> the OF table since currently it's not used.
>
> In fact, the I2C device ID table is mandatory for I2C drivers since
> a i2c_device_id is passed to the driver's probe function even if the
> I2C core used the OF table to match the driver.
>
> And since the I2C core uses different tables, OF-only drivers needs to
> have duplicated data that has to be kept in sync and also the dev node
> compatible manufacturer prefix is stripped when reporting the MODALIAS.
>
> To avoid the above, the I2C core behavior may be changed in the future
> to not require an I2C device table for OF-only drivers and report the
> OF module alias. So, it's better to also export the OF table to prevent
> breaking module autoloading if that happens.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Applied to the togreg branch of iio.git - initially pushed out as testing
for the autobuilders to play with it,
Thanks
Jonathan
>
> ---
>
> drivers/iio/accel/mma8452.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 +
> 5 files changed, 5 insertions(+)
>
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index 13ea1ea23328..b7ad3dce6ff4 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -968,6 +968,7 @@ static const struct of_device_id mma8452_dt_ids[] = {
> { .compatible = "fsl,mma8452" },
> { }
> };
> +MODULE_DEVICE_TABLE(of, mma8452_dt_ids);
>
> static struct i2c_driver mma8452_driver = {
> .driver = {
> diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c
> index 1c0de2f8885d..d6fd0dace74f 100644
> --- a/drivers/iio/light/cm32181.c
> +++ b/drivers/iio/light/cm32181.c
> @@ -353,6 +353,7 @@ static const struct of_device_id cm32181_of_match[] = {
> { .compatible = "capella,cm32181" },
> { }
> };
> +MODULE_DEVICE_TABLE(of, cm32181_of_match);
>
> static struct i2c_driver cm32181_driver = {
> .driver = {
> diff --git a/drivers/iio/light/cm3232.c b/drivers/iio/light/cm3232.c
> index 1b508c65877c..fe89b6823217 100644
> --- a/drivers/iio/light/cm3232.c
> +++ b/drivers/iio/light/cm3232.c
> @@ -417,6 +417,7 @@ static const struct of_device_id cm3232_of_match[] = {
> {.compatible = "capella,cm3232"},
> {}
> };
> +MODULE_DEVICE_TABLE(of, cm3232_of_match);
>
> static struct i2c_driver cm3232_driver = {
> .driver = {
> diff --git a/drivers/iio/light/cm36651.c b/drivers/iio/light/cm36651.c
> index 2a39e141e90c..c8d7b5ea7e78 100644
> --- a/drivers/iio/light/cm36651.c
> +++ b/drivers/iio/light/cm36651.c
> @@ -731,6 +731,7 @@ static const struct of_device_id cm36651_of_match[] = {
> { .compatible = "capella,cm36651" },
> { }
> };
> +MODULE_DEVICE_TABLE(of, cm36651_of_match);
>
> static struct i2c_driver cm36651_driver = {
> .driver = {
> diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c
> index 0334a814b5eb..6d41086f7c64 100644
> --- a/drivers/iio/light/gp2ap020a00f.c
> +++ b/drivers/iio/light/gp2ap020a00f.c
> @@ -1634,6 +1634,7 @@ static const struct of_device_id gp2ap020a00f_of_match[] = {
> { .compatible = "sharp,gp2ap020a00f" },
> { }
> };
> +MODULE_DEVICE_TABLE(of, gp2ap020a00f_of_match);
> #endif
>
> static struct i2c_driver gp2ap020a00f_driver = {
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 27/27] i2c: (RFC, don't apply) report OF style modalias when probing using DT
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 03/27] iio: Export I2C module alias information " Javier Martinez Canillas
2015-07-30 16:18 ` [PATCH 17/27] iio: Export OF " Javier Martinez Canillas
@ 2015-07-30 16:18 ` Javier Martinez Canillas
2015-07-30 16:35 ` [PATCH 00/27] Export I2C and OF module aliases in missing drivers Dmitry Torokhov
3 siblings, 0 replies; 9+ 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, Sebastian Reichel,
Chanwoo Choi, Tomi Valkeinen, lm-sensors, Alexandre Belloni,
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
An I2C driver that supports both OF and legacy platforms, will have
both a OF and I2C ID table. This means that when built as a module,
the aliases will be filled from both tables but currently always an
alias of the form i2c:<deviceId> is reported, e.g:
$ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias
i2c:maxtouch
So if a device is probed by matching its compatible string, udev can
get a MODALIAS uevent env var that doesn't match with one of the valid
aliases so the module won't be auto-loaded.
This patch changes the I2C core to report a OF related MODALIAS uevent
(of:N*T*C) env var instead so the module can be auto-loaded and also
report the correct alias using sysfs:
$ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias
of:NtrackpadT<NULL>Catmel,maxtouch
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/i2c/i2c-core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 92dddfeb3f39..c0668c2ed9da 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -489,6 +489,10 @@ static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env)
struct i2c_client *client = to_i2c_client(dev);
int rc;
+ rc = of_device_uevent_modalias(dev, env);
+ if (rc != -ENODEV)
+ return rc;
+
rc = acpi_device_uevent_modalias(dev, env);
if (rc != -ENODEV)
return rc;
@@ -726,6 +730,10 @@ show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
struct i2c_client *client = to_i2c_client(dev);
int len;
+ len = of_device_get_modalias(dev, buf, PAGE_SIZE - 1);
+ if (len != -ENODEV)
+ return len;
+
len = acpi_device_modalias(dev, buf, PAGE_SIZE -1);
if (len != -ENODEV)
return len;
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 00/27] Export I2C and OF module aliases in missing drivers
2015-07-30 16:18 [PATCH 00/27] Export I2C and OF module aliases in missing drivers Javier Martinez Canillas
` (2 preceding siblings ...)
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 ` Dmitry Torokhov
2015-07-30 16:37 ` Dmitry Torokhov
3 siblings, 1 reply; 9+ messages in thread
From: Dmitry Torokhov @ 2015-07-30 16:35 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, 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, Tony Lindgren, MyungJoo Ham, linuxppc-dev
Hi Javier,
On Thu, Jul 30, 2015 at 06:18:25PM +0200, Javier Martinez Canillas wrote:
> 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>.
Why are we not fixing this? We emit specially carved uevent for
ACPI-based devices, why not the same for OF? Platform bus does this...
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 00/27] Export I2C and OF module aliases in missing drivers
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
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Torokhov @ 2015-07-30 16:37 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, 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, Tony Lindgren, MyungJoo Ham, linuxppc-dev
On Thu, Jul 30, 2015 at 09:35:17AM -0700, Dmitry Torokhov wrote:
> Hi Javier,
>
> On Thu, Jul 30, 2015 at 06:18:25PM +0200, Javier Martinez Canillas wrote:
> > 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>.
>
> Why are we not fixing this? We emit specially carved uevent for
> ACPI-based devices, why not the same for OF? Platform bus does this...
Ah, now I see the 27/27 patch. I think it is exactly what we need. And
probably for SPI bus as well.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 00/27] Export I2C and OF module aliases in missing drivers
2015-07-30 16:37 ` Dmitry Torokhov
@ 2015-07-30 17:13 ` Javier Martinez Canillas
0 siblings, 0 replies; 9+ messages in thread
From: Javier Martinez Canillas @ 2015-07-30 17:13 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-kernel, 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, Tony Lindgren, MyungJoo Ham, linuxppc-dev
Hello Dmitry,
Thanks a lot for your feedback.
On 07/30/2015 06:37 PM, Dmitry Torokhov wrote:
> On Thu, Jul 30, 2015 at 09:35:17AM -0700, Dmitry Torokhov wrote:
>> Hi Javier,
>>
>> On Thu, Jul 30, 2015 at 06:18:25PM +0200, Javier Martinez Canillas wrote:
>>> 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>.
>>
>> Why are we not fixing this? We emit specially carved uevent for
>> ACPI-based devices, why not the same for OF? Platform bus does this...
>
> Ah, now I see the 27/27 patch. I think it is exactly what we need. And
Yes, patch 27/27 is needed but the problem is as I explained before that
there are drivers relying on the current behavior. The item c) in the list
of issues that I mentioned. So those drivers need to be fixed before that
patch is merged...
> probably for SPI bus as well.
>
Yes, I didn't mention SPI because the cover letter became too long
already but it does indeed have the same issue and I discussed this
with Mark already some time ago [0].
Once I2C uevent report is fixed, I plan to do the same for SPI.
> Thanks.
>
[0]: https://lkml.org/lkml/2014/9/11/458
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 9+ messages in thread