diff options
author | Alexander Holler <holler@ahsoftware.de> | 2013-07-10 04:31:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-08-03 13:40:34 -0400 |
commit | a411e735795620f5d260eb883bd80d33b6c7d968 (patch) | |
tree | 38f5ccc29af95e23be03e09026558dbe64c85774 /drivers/iio/gyro | |
parent | 66c721f78f35ecf176efc7a63f775254ce259a82 (diff) |
iio: hid-sensor-gyro-3d: add module alias for autoload
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>
Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r-- | drivers/iio/gyro/hid-sensor-gyro-3d.c | 16 |
1 files 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 bc943dd47da5..9cc8aa1102d7 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c | |||
@@ -30,10 +30,6 @@ | |||
30 | #include <linux/iio/triggered_buffer.h> | 30 | #include <linux/iio/triggered_buffer.h> |
31 | #include "../common/hid-sensors/hid-sensor-trigger.h" | 31 | #include "../common/hid-sensors/hid-sensor-trigger.h" |
32 | 32 | ||
33 | /*Format: HID-SENSOR-usage_id_in_hex*/ | ||
34 | /*Usage ID from spec for Gyro-3D: 0x200076*/ | ||
35 | #define DRIVER_NAME "HID-SENSOR-200076" | ||
36 | |||
37 | enum gyro_3d_channel { | 33 | enum gyro_3d_channel { |
38 | CHANNEL_SCAN_INDEX_X, | 34 | CHANNEL_SCAN_INDEX_X, |
39 | CHANNEL_SCAN_INDEX_Y, | 35 | CHANNEL_SCAN_INDEX_Y, |
@@ -389,9 +385,19 @@ static int hid_gyro_3d_remove(struct platform_device *pdev) | |||
389 | return 0; | 385 | return 0; |
390 | } | 386 | } |
391 | 387 | ||
388 | static struct platform_device_id hid_gyro_3d_ids[] = { | ||
389 | { | ||
390 | /* Format: HID-SENSOR-usage_id_in_hex_lowercase */ | ||
391 | .name = "HID-SENSOR-200076", | ||
392 | }, | ||
393 | { /* sentinel */ } | ||
394 | }; | ||
395 | MODULE_DEVICE_TABLE(platform, hid_gyro_3d_ids); | ||
396 | |||
392 | static struct platform_driver hid_gyro_3d_platform_driver = { | 397 | static struct platform_driver hid_gyro_3d_platform_driver = { |
398 | .id_table = hid_gyro_3d_ids, | ||
393 | .driver = { | 399 | .driver = { |
394 | .name = DRIVER_NAME, | 400 | .name = KBUILD_MODNAME, |
395 | .owner = THIS_MODULE, | 401 | .owner = THIS_MODULE, |
396 | }, | 402 | }, |
397 | .probe = hid_gyro_3d_probe, | 403 | .probe = hid_gyro_3d_probe, |