diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-03-12 19:18:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-17 23:47:05 -0400 |
commit | 727e625cc2c114e449a78f851b0c12edac897a83 (patch) | |
tree | ec7b14d68fb1b79d636d50756082e61360610063 /drivers/media/IR | |
parent | 9c89a181a09eaafca5fc638c3b7ce1620227f60a (diff) |
V4L/DVB: ir-core: export driver name used by IR via uevent
Now, both driver and keytable names are exported to userspace. This
will help userspace to decide when a table need to be replaced
by another one.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r-- | drivers/media/IR/ir-keytable.c | 7 | ||||
-rw-r--r-- | drivers/media/IR/ir-sysfs.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 6db3ff74659b..73fe4bec83bc 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c | |||
@@ -404,7 +404,8 @@ EXPORT_SYMBOL_GPL(ir_g_keycode_from_table); | |||
404 | */ | 404 | */ |
405 | int ir_input_register(struct input_dev *input_dev, | 405 | int ir_input_register(struct input_dev *input_dev, |
406 | const struct ir_scancode_table *rc_tab, | 406 | const struct ir_scancode_table *rc_tab, |
407 | const struct ir_dev_props *props) | 407 | const struct ir_dev_props *props, |
408 | const char *driver_name) | ||
408 | { | 409 | { |
409 | struct ir_input_dev *ir_dev; | 410 | struct ir_input_dev *ir_dev; |
410 | struct ir_scancode *keymap = rc_tab->scan; | 411 | struct ir_scancode *keymap = rc_tab->scan; |
@@ -419,6 +420,10 @@ int ir_input_register(struct input_dev *input_dev, | |||
419 | 420 | ||
420 | spin_lock_init(&ir_dev->rc_tab.lock); | 421 | spin_lock_init(&ir_dev->rc_tab.lock); |
421 | 422 | ||
423 | ir_dev->driver_name = kmalloc(strlen(driver_name) + 1, GFP_KERNEL); | ||
424 | if (!ir_dev->driver_name) | ||
425 | return -ENOMEM; | ||
426 | strcpy(ir_dev->driver_name, driver_name); | ||
422 | ir_dev->rc_tab.name = rc_tab->name; | 427 | ir_dev->rc_tab.name = rc_tab->name; |
423 | ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); | 428 | ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); |
424 | ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * | 429 | ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * |
diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c index 6d63657b5685..0592515a19f8 100644 --- a/drivers/media/IR/ir-sysfs.c +++ b/drivers/media/IR/ir-sysfs.c | |||
@@ -140,6 +140,8 @@ static int ir_dev_uevent(struct device *device, struct kobj_uevent_env *env) | |||
140 | 140 | ||
141 | if (ir_dev->rc_tab.name) | 141 | if (ir_dev->rc_tab.name) |
142 | ADD_HOTPLUG_VAR("NAME=\"%s\"", ir_dev->rc_tab.name); | 142 | ADD_HOTPLUG_VAR("NAME=\"%s\"", ir_dev->rc_tab.name); |
143 | if (ir_dev->driver_name) | ||
144 | ADD_HOTPLUG_VAR("DRV_NAME=\"%s\"", ir_dev->driver_name); | ||
143 | 145 | ||
144 | return 0; | 146 | return 0; |
145 | } | 147 | } |