All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] iio: hid-sensor: add module alias for autoload
@ 2013-07-10  8:31 Alexander Holler
  2013-07-10  8:31 ` [PATCH 1/4] iio: hid-sensor-accel-3d: " Alexander Holler
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Alexander Holler @ 2013-07-10  8:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-iio, Jonathan Cameron, Srinivas Pandruvada

Hello,

I'm not sure if it was by intention that none of the hid-sensor drivers
were loaded automatically. But I assume it was not by intention.

Therefor I've added a module alias to every hid-sensor driver by adding
a MODULE_DEVICE_TABLE.

This has another benefit: it makes it possible to use a normale driver name.

Therefor I've changed all driver names to KBUILD_MODNAME instead of
HID-SENSOR-2000xx as the later isn't very descriptive when starring at
kernel messages.

Regards,

Alexander Holler


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

* [PATCH 1/4] iio: hid-sensor-accel-3d: add module alias for autoload
  2013-07-10  8:31 [PATCH 0/4] iio: hid-sensor: add module alias for autoload Alexander Holler
@ 2013-07-10  8:31 ` Alexander Holler
  2013-07-10  8:31 ` [PATCH 2/4] iio: hid-sensor-gyro-3d: " Alexander Holler
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Alexander Holler @ 2013-07-10  8:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-iio, Jonathan Cameron, Srinivas Pandruvada, Alexander Holler

Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.

This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
 drivers/iio/accel/hid-sensor-accel-3d.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index bbcbd71..275c5d7 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -30,10 +30,6 @@
 #include <linux/iio/triggered_buffer.h>
 #include "../common/hid-sensors/hid-sensor-trigger.h"
 
-/*Format: HID-SENSOR-usage_id_in_hex*/
-/*Usage ID from spec for Accelerometer-3D: 0x200073*/
-#define DRIVER_NAME "HID-SENSOR-200073"
-
 enum accel_3d_channel {
 	CHANNEL_SCAN_INDEX_X,
 	CHANNEL_SCAN_INDEX_Y,
@@ -389,9 +385,19 @@ static int hid_accel_3d_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct platform_device_id hid_accel_3d_ids[] = {
+	{
+		/* Format: HID-SENSOR-usage_id_in_hex_lowercase */
+		.name = "HID-SENSOR-200073",
+	},
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, hid_accel_3d_ids);
+
 static struct platform_driver hid_accel_3d_platform_driver = {
+	.id_table = hid_accel_3d_ids,
 	.driver = {
-		.name	= DRIVER_NAME,
+		.name	= KBUILD_MODNAME,
 		.owner	= THIS_MODULE,
 	},
 	.probe		= hid_accel_3d_probe,
-- 
1.8.1.5


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

* [PATCH 2/4] iio: hid-sensor-gyro-3d: add module alias for autoload
  2013-07-10  8:31 [PATCH 0/4] iio: hid-sensor: add module alias for autoload Alexander Holler
  2013-07-10  8:31 ` [PATCH 1/4] iio: hid-sensor-accel-3d: " Alexander Holler
@ 2013-07-10  8:31 ` Alexander Holler
  2013-07-12 21:49   ` Srinivas Pandruvada
  2013-07-10  8:31 ` [PATCH 3/4] iio: hid-sensor-als: " Alexander Holler
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Alexander Holler @ 2013-07-10  8:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-iio, Jonathan Cameron, Srinivas Pandruvada, Alexander Holler

Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.

This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
 drivers/iio/gyro/hid-sensor-gyro-3d.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index bc943dd..9cc8aa1 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -30,10 +30,6 @@
 #include <linux/iio/triggered_buffer.h>
 #include "../common/hid-sensors/hid-sensor-trigger.h"
 
-/*Format: HID-SENSOR-usage_id_in_hex*/
-/*Usage ID from spec for Gyro-3D: 0x200076*/
-#define DRIVER_NAME "HID-SENSOR-200076"
-
 enum gyro_3d_channel {
 	CHANNEL_SCAN_INDEX_X,
 	CHANNEL_SCAN_INDEX_Y,
@@ -389,9 +385,19 @@ static int hid_gyro_3d_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct platform_device_id hid_gyro_3d_ids[] = {
+	{
+		/* Format: HID-SENSOR-usage_id_in_hex_lowercase */
+		.name = "HID-SENSOR-200076",
+	},
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, hid_gyro_3d_ids);
+
 static struct platform_driver hid_gyro_3d_platform_driver = {
+	.id_table = hid_gyro_3d_ids,
 	.driver = {
-		.name	= DRIVER_NAME,
+		.name	= KBUILD_MODNAME,
 		.owner	= THIS_MODULE,
 	},
 	.probe		= hid_gyro_3d_probe,
-- 
1.8.1.5


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

* [PATCH 3/4] iio: hid-sensor-als: add module alias for autoload
  2013-07-10  8:31 [PATCH 0/4] iio: hid-sensor: add module alias for autoload Alexander Holler
  2013-07-10  8:31 ` [PATCH 1/4] iio: hid-sensor-accel-3d: " Alexander Holler
  2013-07-10  8:31 ` [PATCH 2/4] iio: hid-sensor-gyro-3d: " Alexander Holler
@ 2013-07-10  8:31 ` Alexander Holler
  2013-07-12 21:49   ` Srinivas Pandruvada
  2013-07-10  8:32 ` [PATCH 4/4] iio: hid-sensor-magn-3d: " Alexander Holler
  2013-07-10 15:27 ` [PATCH 0/4] iio: hid-sensor: " Srinivas Pandruvada
  4 siblings, 1 reply; 16+ messages in thread
From: Alexander Holler @ 2013-07-10  8:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-iio, Jonathan Cameron, Srinivas Pandruvada, Alexander Holler

Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.

This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
 drivers/iio/light/hid-sensor-als.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index cdc2cad..9adfef0 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -30,10 +30,6 @@
 #include <linux/iio/triggered_buffer.h>
 #include "../common/hid-sensors/hid-sensor-trigger.h"
 
-/*Format: HID-SENSOR-usage_id_in_hex*/
-/*Usage ID from spec for Ambiant-Light: 0x200041*/
-#define DRIVER_NAME "HID-SENSOR-200041"
-
 #define CHANNEL_SCAN_INDEX_ILLUM 0
 
 struct als_state {
@@ -355,9 +351,19 @@ static int hid_als_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct platform_device_id hid_als_ids[] = {
+	{
+		/* Format: HID-SENSOR-usage_id_in_hex_lowercase */
+		.name = "HID-SENSOR-200041",
+	},
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, hid_als_ids);
+
 static struct platform_driver hid_als_platform_driver = {
+	.id_table = hid_als_ids,
 	.driver = {
-		.name	= DRIVER_NAME,
+		.name	= KBUILD_MODNAME,
 		.owner	= THIS_MODULE,
 	},
 	.probe		= hid_als_probe,
-- 
1.8.1.5


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

* [PATCH 4/4] iio: hid-sensor-magn-3d: add module alias for autoload
  2013-07-10  8:31 [PATCH 0/4] iio: hid-sensor: add module alias for autoload Alexander Holler
                   ` (2 preceding siblings ...)
  2013-07-10  8:31 ` [PATCH 3/4] iio: hid-sensor-als: " Alexander Holler
@ 2013-07-10  8:32 ` Alexander Holler
  2013-07-12 21:49   ` Srinivas Pandruvada
  2013-07-10 15:27 ` [PATCH 0/4] iio: hid-sensor: " Srinivas Pandruvada
  4 siblings, 1 reply; 16+ messages in thread
From: Alexander Holler @ 2013-07-10  8:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-iio, Jonathan Cameron, Srinivas Pandruvada, Alexander Holler

Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.

This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
 drivers/iio/magnetometer/hid-sensor-magn-3d.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index 99f4e49..e71127a 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -30,10 +30,6 @@
 #include <linux/iio/triggered_buffer.h>
 #include "../common/hid-sensors/hid-sensor-trigger.h"
 
-/*Format: HID-SENSOR-usage_id_in_hex*/
-/*Usage ID from spec for Magnetometer-3D: 0x200083*/
-#define DRIVER_NAME "HID-SENSOR-200083"
-
 enum magn_3d_channel {
 	CHANNEL_SCAN_INDEX_X,
 	CHANNEL_SCAN_INDEX_Y,
@@ -390,9 +386,19 @@ static int hid_magn_3d_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct platform_device_id hid_magn_3d_ids[] = {
+	{
+		/* Format: HID-SENSOR-usage_id_in_hex_lowercase */
+		.name = "HID-SENSOR-200083",
+	},
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, hid_magn_3d_ids);
+
 static struct platform_driver hid_magn_3d_platform_driver = {
+	.id_table = hid_magn_3d_ids,
 	.driver = {
-		.name	= DRIVER_NAME,
+		.name	= KBUILD_MODNAME,
 		.owner	= THIS_MODULE,
 	},
 	.probe		= hid_magn_3d_probe,
-- 
1.8.1.5


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

* Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-10  8:31 [PATCH 0/4] iio: hid-sensor: add module alias for autoload Alexander Holler
                   ` (3 preceding siblings ...)
  2013-07-10  8:32 ` [PATCH 4/4] iio: hid-sensor-magn-3d: " Alexander Holler
@ 2013-07-10 15:27 ` Srinivas Pandruvada
  2013-07-10 15:58   ` Alexander Holler
  4 siblings, 1 reply; 16+ messages in thread
From: Srinivas Pandruvada @ 2013-07-10 15:27 UTC (permalink / raw)
  To: Alexander Holler
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Srinivas Pandruvada

Hi,

There was no intention to prevent auto loading. Did you get chance to 
test these changes?

Thanks,
Srinivas

On 07/10/2013 01:31 AM, Alexander Holler wrote:
> Hello,
>
> I'm not sure if it was by intention that none of the hid-sensor drivers
> were loaded automatically. But I assume it was not by intention.
>
> Therefor I've added a module alias to every hid-sensor driver by adding
> a MODULE_DEVICE_TABLE.
>
> This has another benefit: it makes it possible to use a normale driver name.
>
> Therefor I've changed all driver names to KBUILD_MODNAME instead of
> HID-SENSOR-2000xx as the later isn't very descriptive when starring at
> kernel messages.
>
> Regards,
>
> Alexander Holler
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


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

* Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-10 15:27 ` [PATCH 0/4] iio: hid-sensor: " Srinivas Pandruvada
@ 2013-07-10 15:58   ` Alexander Holler
  2013-07-11 17:27     ` Srinivas Pandruvada
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Holler @ 2013-07-10 15:58 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Srinivas Pandruvada

Am 10.07.2013 17:27, schrieb Srinivas Pandruvada:
> Hi,
>
> There was no intention to prevent auto loading. Did you get chance to
> test these changes?

Sure, I always test patches before I send them out.

Ok, I haven't tested the changes with the iio HID drivers (I don't have 
any commercial HID sensor hub, so I've just compile tested these patches 
here, double reading them), but I've tested the similiar changes with a 
patch for rtc-hid-sensor-time I've send out yesterday. (sorry, no link, 
lkml.org seems dead, just search for "rtc-hid-sensor-time: add module 
alias")

It works just fine. An example output is now

Jul  9 19:27:21 dockstar3 kernel: [    5.124444] rtc_hid_sensor_time 
HID-SENSOR-2000a0.0: milliseconds supported
Jul  9 19:27:21 dockstar3 kernel: [    5.132864] rtc_hid_sensor_time 
HID-SENSOR-2000a0.0: rtc core: setting system clock to 2013-07-09 
17:26:51:328000 UTC (1373390811)
Jul  9 19:27:21 dockstar3 kernel: [    5.146105] rtc_hid_sensor_time 
HID-SENSOR-2000a0.0: rtc core: registered hid-sensor-time as rtc0

Before the output was e.g.

HID-SENSOR-2000a0 HID-SENSOR-2000a0.0: rtc core: registered 
hid-sensor-time as rtc0

instead of the above with the descriptive rtc_hid_sensor_time.

Automatic loading of modules works too and it works on ARM, Intel and 
AMD as module or static linked. ;)

Regards,

Alexander Holler

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

* Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-10 15:58   ` Alexander Holler
@ 2013-07-11 17:27     ` Srinivas Pandruvada
  2013-07-12  7:21       ` Alexander Holler
  0 siblings, 1 reply; 16+ messages in thread
From: Srinivas Pandruvada @ 2013-07-11 17:27 UTC (permalink / raw)
  To: Alexander Holler
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Srinivas Pandruvada



On 07/10/2013 08:58 AM, Alexander Holler wrote:
> Am 10.07.2013 17:27, schrieb Srinivas Pandruvada:
>> Hi,
>>
>> There was no intention to prevent auto loading. Did you get chance to
>> test these changes?
>
> Sure, I always test patches before I send them out.
>
> Ok, I haven't tested the changes with the iio HID drivers (I don't 
> have any commercial HID sensor hub, so I've just compile tested these 
> patches here, double reading them), but I've tested the similiar 
> changes with a patch for rtc-hid-sensor-time I've send out yesterday. 
> (sorry, no link, lkml.org seems dead, just search for 
> "rtc-hid-sensor-time: add module alias")
>
> It works just fine. An example output is now
>
> Jul  9 19:27:21 dockstar3 kernel: [    5.124444] rtc_hid_sensor_time 
> HID-SENSOR-2000a0.0: milliseconds supported
> Jul  9 19:27:21 dockstar3 kernel: [    5.132864] rtc_hid_sensor_time 
> HID-SENSOR-2000a0.0: rtc core: setting system clock to 2013-07-09 
> 17:26:51:328000 UTC (1373390811)
> Jul  9 19:27:21 dockstar3 kernel: [    5.146105] rtc_hid_sensor_time 
> HID-SENSOR-2000a0.0: rtc core: registered hid-sensor-time as rtc0
>
> Before the output was e.g.
>
> HID-SENSOR-2000a0 HID-SENSOR-2000a0.0: rtc core: registered 
> hid-sensor-time as rtc0
>
> instead of the above with the descriptive rtc_hid_sensor_time.
<Agreed. This is better. >
> Automatic loading of modules works too and it works on ARM, Intel and 
> AMD as module or static linked. ;)
>
> Regards,
>
> Alexander Holler
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


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

* Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-11 17:27     ` Srinivas Pandruvada
@ 2013-07-12  7:21       ` Alexander Holler
  2013-07-12 18:44         ` Jonathan Cameron
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Holler @ 2013-07-12  7:21 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Srinivas Pandruvada

Am 11.07.2013 19:27, schrieb Srinivas Pandruvada:
>
>
> On 07/10/2013 08:58 AM, Alexander Holler wrote:
>> Am 10.07.2013 17:27, schrieb Srinivas Pandruvada:
>>> Hi,
>>>
>>> There was no intention to prevent auto loading. Did you get chance to
>>> test these changes?
>>
>> Sure, I always test patches before I send them out.
>>
>> Ok, I haven't tested the changes with the iio HID drivers (I don't
>> have any commercial HID sensor hub, so I've just compile tested these
>> patches here, double reading them), but I've tested the similiar
>> changes with a patch for rtc-hid-sensor-time I've send out yesterday.
>> (sorry, no link, lkml.org seems dead, just search for
>> "rtc-hid-sensor-time: add module alias")
>>
>> It works just fine. An example output is now
>>
>> Jul  9 19:27:21 dockstar3 kernel: [    5.124444] rtc_hid_sensor_time
>> HID-SENSOR-2000a0.0: milliseconds supported
>> Jul  9 19:27:21 dockstar3 kernel: [    5.132864] rtc_hid_sensor_time
>> HID-SENSOR-2000a0.0: rtc core: setting system clock to 2013-07-09
>> 17:26:51:328000 UTC (1373390811)
>> Jul  9 19:27:21 dockstar3 kernel: [    5.146105] rtc_hid_sensor_time
>> HID-SENSOR-2000a0.0: rtc core: registered hid-sensor-time as rtc0
>>
>> Before the output was e.g.
>>
>> HID-SENSOR-2000a0 HID-SENSOR-2000a0.0: rtc core: registered
>> hid-sensor-time as rtc0
>>
>> instead of the above with the descriptive rtc_hid_sensor_time.
> <Agreed. This is better. >
>> Automatic loading of modules works too and it works on ARM, Intel and
>> AMD as module or static linked. ;)

Do you have tested the patches with a real device? I assume you have one. ;)

Regards,

Alexander Holler


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

* Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-12  7:21       ` Alexander Holler
@ 2013-07-12 18:44         ` Jonathan Cameron
  2013-07-12 18:46           ` Pandruvada, Srinivas
  2013-07-12 21:46           ` Pandruvada, Srinivas
  0 siblings, 2 replies; 16+ messages in thread
From: Jonathan Cameron @ 2013-07-12 18:44 UTC (permalink / raw)
  To: Alexander Holler
  Cc: Srinivas Pandruvada, linux-kernel, linux-iio, Jonathan Cameron,
	Srinivas Pandruvada

On 07/12/2013 08:21 AM, Alexander Holler wrote:
> Am 11.07.2013 19:27, schrieb Srinivas Pandruvada:
>>
>>
>> On 07/10/2013 08:58 AM, Alexander Holler wrote:
>>> Am 10.07.2013 17:27, schrieb Srinivas Pandruvada:
>>>> Hi,
>>>>
>>>> There was no intention to prevent auto loading. Did you get chance to
>>>> test these changes?
>>>
>>> Sure, I always test patches before I send them out.
>>>
>>> Ok, I haven't tested the changes with the iio HID drivers (I don't
>>> have any commercial HID sensor hub, so I've just compile tested these
>>> patches here, double reading them), but I've tested the similiar
>>> changes with a patch for rtc-hid-sensor-time I've send out yesterday.
>>> (sorry, no link, lkml.org seems dead, just search for
>>> "rtc-hid-sensor-time: add module alias")
>>>
>>> It works just fine. An example output is now
>>>
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.124444] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: milliseconds supported
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.132864] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: rtc core: setting system clock to 2013-07-09
>>> 17:26:51:328000 UTC (1373390811)
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.146105] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: rtc core: registered hid-sensor-time as rtc0
>>>
>>> Before the output was e.g.
>>>
>>> HID-SENSOR-2000a0 HID-SENSOR-2000a0.0: rtc core: registered
>>> hid-sensor-time as rtc0
>>>
>>> instead of the above with the descriptive rtc_hid_sensor_time.
>> <Agreed. This is better. >
>>> Automatic loading of modules works too and it works on ARM, Intel and
>>> AMD as module or static linked. ;)
> 
> Do you have tested the patches with a real device? I assume you have one. ;)
> 
> Regards,
> 
> Alexander Holler

Just so you two know. Given this discussion, I'll be lazy about these and
wait for an Ack from Srinivas before taking these.  Look fine to me, but
nice to have confirmation as you say with the actual hardware!

Jonathan

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

* RE: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-12 18:44         ` Jonathan Cameron
@ 2013-07-12 18:46           ` Pandruvada, Srinivas
  2013-07-12 21:46           ` Pandruvada, Srinivas
  1 sibling, 0 replies; 16+ messages in thread
From: Pandruvada, Srinivas @ 2013-07-12 18:46 UTC (permalink / raw)
  To: Jonathan Cameron, Alexander Holler
  Cc: Srinivas Pandruvada, linux-kernel, linux-iio, Jonathan Cameron

Looks fine, but will test on actual hardware in couple of days.

Thanks,
Srinivas

-----Original Message-----
From: Jonathan Cameron [mailto:jic23@kernel.org] 
Sent: Friday, July 12, 2013 11:45 AM
To: Alexander Holler
Cc: Srinivas Pandruvada; linux-kernel@vger.kernel.org; linux-iio@vger.kernel.org; Jonathan Cameron; Pandruvada, Srinivas
Subject: Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload

On 07/12/2013 08:21 AM, Alexander Holler wrote:
> Am 11.07.2013 19:27, schrieb Srinivas Pandruvada:
>>
>>
>> On 07/10/2013 08:58 AM, Alexander Holler wrote:
>>> Am 10.07.2013 17:27, schrieb Srinivas Pandruvada:
>>>> Hi,
>>>>
>>>> There was no intention to prevent auto loading. Did you get chance 
>>>> to test these changes?
>>>
>>> Sure, I always test patches before I send them out.
>>>
>>> Ok, I haven't tested the changes with the iio HID drivers (I don't 
>>> have any commercial HID sensor hub, so I've just compile tested 
>>> these patches here, double reading them), but I've tested the 
>>> similiar changes with a patch for rtc-hid-sensor-time I've send out yesterday.
>>> (sorry, no link, lkml.org seems dead, just search for
>>> "rtc-hid-sensor-time: add module alias")
>>>
>>> It works just fine. An example output is now
>>>
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.124444] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: milliseconds supported
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.132864] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: rtc core: setting system clock to 2013-07-09
>>> 17:26:51:328000 UTC (1373390811)
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.146105] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: rtc core: registered hid-sensor-time as rtc0
>>>
>>> Before the output was e.g.
>>>
>>> HID-SENSOR-2000a0 HID-SENSOR-2000a0.0: rtc core: registered 
>>> hid-sensor-time as rtc0
>>>
>>> instead of the above with the descriptive rtc_hid_sensor_time.
>> <Agreed. This is better. >
>>> Automatic loading of modules works too and it works on ARM, Intel 
>>> and AMD as module or static linked. ;)
> 
> Do you have tested the patches with a real device? I assume you have 
> one. ;)
> 
> Regards,
> 
> Alexander Holler

Just so you two know. Given this discussion, I'll be lazy about these and wait for an Ack from Srinivas before taking these.  Look fine to me, but nice to have confirmation as you say with the actual hardware!

Jonathan

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

* RE: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-12 18:44         ` Jonathan Cameron
  2013-07-12 18:46           ` Pandruvada, Srinivas
@ 2013-07-12 21:46           ` Pandruvada, Srinivas
  2013-07-13 13:29             ` Jonathan Cameron
  1 sibling, 1 reply; 16+ messages in thread
From: Pandruvada, Srinivas @ 2013-07-12 21:46 UTC (permalink / raw)
  To: Jonathan Cameron, Alexander Holler
  Cc: Srinivas Pandruvada, linux-kernel, linux-iio, Jonathan Cameron

Tested and ready to go.

Thanks,
Srinivas


-----Original Message-----
From: Jonathan Cameron [mailto:jic23@kernel.org] 
Sent: Friday, July 12, 2013 11:45 AM
To: Alexander Holler
Cc: Srinivas Pandruvada; linux-kernel@vger.kernel.org; linux-iio@vger.kernel.org; Jonathan Cameron; Pandruvada, Srinivas
Subject: Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload

On 07/12/2013 08:21 AM, Alexander Holler wrote:
> Am 11.07.2013 19:27, schrieb Srinivas Pandruvada:
>>
>>
>> On 07/10/2013 08:58 AM, Alexander Holler wrote:
>>> Am 10.07.2013 17:27, schrieb Srinivas Pandruvada:
>>>> Hi,
>>>>
>>>> There was no intention to prevent auto loading. Did you get chance 
>>>> to test these changes?
>>>
>>> Sure, I always test patches before I send them out.
>>>
>>> Ok, I haven't tested the changes with the iio HID drivers (I don't 
>>> have any commercial HID sensor hub, so I've just compile tested 
>>> these patches here, double reading them), but I've tested the 
>>> similiar changes with a patch for rtc-hid-sensor-time I've send out yesterday.
>>> (sorry, no link, lkml.org seems dead, just search for
>>> "rtc-hid-sensor-time: add module alias")
>>>
>>> It works just fine. An example output is now
>>>
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.124444] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: milliseconds supported
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.132864] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: rtc core: setting system clock to 2013-07-09
>>> 17:26:51:328000 UTC (1373390811)
>>> Jul  9 19:27:21 dockstar3 kernel: [    5.146105] rtc_hid_sensor_time
>>> HID-SENSOR-2000a0.0: rtc core: registered hid-sensor-time as rtc0
>>>
>>> Before the output was e.g.
>>>
>>> HID-SENSOR-2000a0 HID-SENSOR-2000a0.0: rtc core: registered 
>>> hid-sensor-time as rtc0
>>>
>>> instead of the above with the descriptive rtc_hid_sensor_time.
>> <Agreed. This is better. >
>>> Automatic loading of modules works too and it works on ARM, Intel 
>>> and AMD as module or static linked. ;)
> 
> Do you have tested the patches with a real device? I assume you have 
> one. ;)
> 
> Regards,
> 
> Alexander Holler

Just so you two know. Given this discussion, I'll be lazy about these and wait for an Ack from Srinivas before taking these.  Look fine to me, but nice to have confirmation as you say with the actual hardware!

Jonathan

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

* Re: [PATCH 2/4] iio: hid-sensor-gyro-3d: add module alias for autoload
  2013-07-10  8:31 ` [PATCH 2/4] iio: hid-sensor-gyro-3d: " Alexander Holler
@ 2013-07-12 21:49   ` Srinivas Pandruvada
  0 siblings, 0 replies; 16+ messages in thread
From: Srinivas Pandruvada @ 2013-07-12 21:49 UTC (permalink / raw)
  To: Alexander Holler
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Srinivas Pandruvada

Tested. You can add my ack.

Acked-by:Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com>


On 07/10/2013 01:31 AM, Alexander Holler wrote:
> Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
> load the driver.
>
> This makes it also possible to use the usual driver name instead of
> HID-SENSOR-2000xx which isn't very descriptive in kernel messages.
>
> Signed-off-by: Alexander Holler <holler@ahsoftware.de>
> ---
>   drivers/iio/gyro/hid-sensor-gyro-3d.c | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
> index bc943dd..9cc8aa1 100644
> --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
> +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
> @@ -30,10 +30,6 @@
>   #include <linux/iio/triggered_buffer.h>
>   #include "../common/hid-sensors/hid-sensor-trigger.h"
>   
> -/*Format: HID-SENSOR-usage_id_in_hex*/
> -/*Usage ID from spec for Gyro-3D: 0x200076*/
> -#define DRIVER_NAME "HID-SENSOR-200076"
> -
>   enum gyro_3d_channel {
>   	CHANNEL_SCAN_INDEX_X,
>   	CHANNEL_SCAN_INDEX_Y,
> @@ -389,9 +385,19 @@ static int hid_gyro_3d_remove(struct platform_device *pdev)
>   	return 0;
>   }
>   
> +static struct platform_device_id hid_gyro_3d_ids[] = {
> +	{
> +		/* Format: HID-SENSOR-usage_id_in_hex_lowercase */
> +		.name = "HID-SENSOR-200076",
> +	},
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(platform, hid_gyro_3d_ids);
> +
>   static struct platform_driver hid_gyro_3d_platform_driver = {
> +	.id_table = hid_gyro_3d_ids,
>   	.driver = {
> -		.name	= DRIVER_NAME,
> +		.name	= KBUILD_MODNAME,
>   		.owner	= THIS_MODULE,
>   	},
>   	.probe		= hid_gyro_3d_probe,


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

* Re: [PATCH 3/4] iio: hid-sensor-als: add module alias for autoload
  2013-07-10  8:31 ` [PATCH 3/4] iio: hid-sensor-als: " Alexander Holler
@ 2013-07-12 21:49   ` Srinivas Pandruvada
  0 siblings, 0 replies; 16+ messages in thread
From: Srinivas Pandruvada @ 2013-07-12 21:49 UTC (permalink / raw)
  To: Alexander Holler
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Srinivas Pandruvada

Tested. You can add my ack.

Acked-by:Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com>


On 07/10/2013 01:31 AM, Alexander Holler wrote:
> Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
> load the driver.
>
> This makes it also possible to use the usual driver name instead of
> HID-SENSOR-2000xx which isn't very descriptive in kernel messages.
>
> Signed-off-by: Alexander Holler <holler@ahsoftware.de>
> ---
>   drivers/iio/light/hid-sensor-als.c | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index cdc2cad..9adfef0 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -30,10 +30,6 @@
>   #include <linux/iio/triggered_buffer.h>
>   #include "../common/hid-sensors/hid-sensor-trigger.h"
>   
> -/*Format: HID-SENSOR-usage_id_in_hex*/
> -/*Usage ID from spec for Ambiant-Light: 0x200041*/
> -#define DRIVER_NAME "HID-SENSOR-200041"
> -
>   #define CHANNEL_SCAN_INDEX_ILLUM 0
>   
>   struct als_state {
> @@ -355,9 +351,19 @@ static int hid_als_remove(struct platform_device *pdev)
>   	return 0;
>   }
>   
> +static struct platform_device_id hid_als_ids[] = {
> +	{
> +		/* Format: HID-SENSOR-usage_id_in_hex_lowercase */
> +		.name = "HID-SENSOR-200041",
> +	},
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(platform, hid_als_ids);
> +
>   static struct platform_driver hid_als_platform_driver = {
> +	.id_table = hid_als_ids,
>   	.driver = {
> -		.name	= DRIVER_NAME,
> +		.name	= KBUILD_MODNAME,
>   		.owner	= THIS_MODULE,
>   	},
>   	.probe		= hid_als_probe,


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

* Re: [PATCH 4/4] iio: hid-sensor-magn-3d: add module alias for autoload
  2013-07-10  8:32 ` [PATCH 4/4] iio: hid-sensor-magn-3d: " Alexander Holler
@ 2013-07-12 21:49   ` Srinivas Pandruvada
  0 siblings, 0 replies; 16+ messages in thread
From: Srinivas Pandruvada @ 2013-07-12 21:49 UTC (permalink / raw)
  To: Alexander Holler
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Srinivas Pandruvada

Tested. You can add my ack.

Acked-by:Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com>


On 07/10/2013 01:32 AM, Alexander Holler wrote:
> Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
> load the driver.
>
> This makes it also possible to use the usual driver name instead of
> HID-SENSOR-2000xx which isn't very descriptive in kernel messages.
>
> Signed-off-by: Alexander Holler <holler@ahsoftware.de>
> ---
>   drivers/iio/magnetometer/hid-sensor-magn-3d.c | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> index 99f4e49..e71127a 100644
> --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> @@ -30,10 +30,6 @@
>   #include <linux/iio/triggered_buffer.h>
>   #include "../common/hid-sensors/hid-sensor-trigger.h"
>   
> -/*Format: HID-SENSOR-usage_id_in_hex*/
> -/*Usage ID from spec for Magnetometer-3D: 0x200083*/
> -#define DRIVER_NAME "HID-SENSOR-200083"
> -
>   enum magn_3d_channel {
>   	CHANNEL_SCAN_INDEX_X,
>   	CHANNEL_SCAN_INDEX_Y,
> @@ -390,9 +386,19 @@ static int hid_magn_3d_remove(struct platform_device *pdev)
>   	return 0;
>   }
>   
> +static struct platform_device_id hid_magn_3d_ids[] = {
> +	{
> +		/* Format: HID-SENSOR-usage_id_in_hex_lowercase */
> +		.name = "HID-SENSOR-200083",
> +	},
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(platform, hid_magn_3d_ids);
> +
>   static struct platform_driver hid_magn_3d_platform_driver = {
> +	.id_table = hid_magn_3d_ids,
>   	.driver = {
> -		.name	= DRIVER_NAME,
> +		.name	= KBUILD_MODNAME,
>   		.owner	= THIS_MODULE,
>   	},
>   	.probe		= hid_magn_3d_probe,


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

* Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
  2013-07-12 21:46           ` Pandruvada, Srinivas
@ 2013-07-13 13:29             ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2013-07-13 13:29 UTC (permalink / raw)
  To: Pandruvada, Srinivas
  Cc: Alexander Holler, Srinivas Pandruvada, linux-kernel, linux-iio,
	Jonathan Cameron

Thanks,

All 4 applied to the togreg branch of iio.git

Jonathan

On 07/12/2013 10:46 PM, Pandruvada, Srinivas wrote:
> Tested and ready to go.
> 
> Thanks,
> Srinivas
> 
> 
> -----Original Message-----
> From: Jonathan Cameron [mailto:jic23@kernel.org] 
> Sent: Friday, July 12, 2013 11:45 AM
> To: Alexander Holler
> Cc: Srinivas Pandruvada; linux-kernel@vger.kernel.org; linux-iio@vger.kernel.org; Jonathan Cameron; Pandruvada, Srinivas
> Subject: Re: [PATCH 0/4] iio: hid-sensor: add module alias for autoload
> 
> On 07/12/2013 08:21 AM, Alexander Holler wrote:
>> Am 11.07.2013 19:27, schrieb Srinivas Pandruvada:
>>>
>>>
>>> On 07/10/2013 08:58 AM, Alexander Holler wrote:
>>>> Am 10.07.2013 17:27, schrieb Srinivas Pandruvada:
>>>>> Hi,
>>>>>
>>>>> There was no intention to prevent auto loading. Did you get chance 
>>>>> to test these changes?
>>>>
>>>> Sure, I always test patches before I send them out.
>>>>
>>>> Ok, I haven't tested the changes with the iio HID drivers (I don't 
>>>> have any commercial HID sensor hub, so I've just compile tested 
>>>> these patches here, double reading them), but I've tested the 
>>>> similiar changes with a patch for rtc-hid-sensor-time I've send out yesterday.
>>>> (sorry, no link, lkml.org seems dead, just search for
>>>> "rtc-hid-sensor-time: add module alias")
>>>>
>>>> It works just fine. An example output is now
>>>>
>>>> Jul  9 19:27:21 dockstar3 kernel: [    5.124444] rtc_hid_sensor_time
>>>> HID-SENSOR-2000a0.0: milliseconds supported
>>>> Jul  9 19:27:21 dockstar3 kernel: [    5.132864] rtc_hid_sensor_time
>>>> HID-SENSOR-2000a0.0: rtc core: setting system clock to 2013-07-09
>>>> 17:26:51:328000 UTC (1373390811)
>>>> Jul  9 19:27:21 dockstar3 kernel: [    5.146105] rtc_hid_sensor_time
>>>> HID-SENSOR-2000a0.0: rtc core: registered hid-sensor-time as rtc0
>>>>
>>>> Before the output was e.g.
>>>>
>>>> HID-SENSOR-2000a0 HID-SENSOR-2000a0.0: rtc core: registered 
>>>> hid-sensor-time as rtc0
>>>>
>>>> instead of the above with the descriptive rtc_hid_sensor_time.
>>> <Agreed. This is better. >
>>>> Automatic loading of modules works too and it works on ARM, Intel 
>>>> and AMD as module or static linked. ;)
>>
>> Do you have tested the patches with a real device? I assume you have 
>> one. ;)
>>
>> Regards,
>>
>> Alexander Holler
> 
> Just so you two know. Given this discussion, I'll be lazy about these and wait for an Ack from Srinivas before taking these.  Look fine to me, but nice to have confirmation as you say with the actual hardware!
> 
> Jonathan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2013-07-13 13:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10  8:31 [PATCH 0/4] iio: hid-sensor: add module alias for autoload Alexander Holler
2013-07-10  8:31 ` [PATCH 1/4] iio: hid-sensor-accel-3d: " Alexander Holler
2013-07-10  8:31 ` [PATCH 2/4] iio: hid-sensor-gyro-3d: " Alexander Holler
2013-07-12 21:49   ` Srinivas Pandruvada
2013-07-10  8:31 ` [PATCH 3/4] iio: hid-sensor-als: " Alexander Holler
2013-07-12 21:49   ` Srinivas Pandruvada
2013-07-10  8:32 ` [PATCH 4/4] iio: hid-sensor-magn-3d: " Alexander Holler
2013-07-12 21:49   ` Srinivas Pandruvada
2013-07-10 15:27 ` [PATCH 0/4] iio: hid-sensor: " Srinivas Pandruvada
2013-07-10 15:58   ` Alexander Holler
2013-07-11 17:27     ` Srinivas Pandruvada
2013-07-12  7:21       ` Alexander Holler
2013-07-12 18:44         ` Jonathan Cameron
2013-07-12 18:46           ` Pandruvada, Srinivas
2013-07-12 21:46           ` Pandruvada, Srinivas
2013-07-13 13:29             ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.