diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-01 14:30:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 15:43:54 -0400 |
commit | 1722f3b376f10182db85c2f6cf5bd79b857bc9e0 (patch) | |
tree | 7f87eeaa7e8e4af73dc7d474ca0d97c41d7ef823 /drivers/media/dvb/siano/smsir.c | |
parent | 4eebfb0a5f55ba7c4af33c2173862493d8845622 (diff) |
V4L/DVB: sms: properly initialize IR phys and IR name
sms were using a non-compliant nomenclature for the USB devices. Fix it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/siano/smsir.c')
-rw-r--r-- | drivers/media/dvb/siano/smsir.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/dvb/siano/smsir.c b/drivers/media/dvb/siano/smsir.c index a56eac76e0f0..f8a4fd61e3dc 100644 --- a/drivers/media/dvb/siano/smsir.c +++ b/drivers/media/dvb/siano/smsir.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <media/ir-core.h> | ||
25 | 26 | ||
26 | #include "smscoreapi.h" | 27 | #include "smscoreapi.h" |
27 | #include "smsir.h" | 28 | #include "smsir.h" |
@@ -247,6 +248,7 @@ void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len) | |||
247 | int sms_ir_init(struct smscore_device_t *coredev) | 248 | int sms_ir_init(struct smscore_device_t *coredev) |
248 | { | 249 | { |
249 | struct input_dev *input_dev; | 250 | struct input_dev *input_dev; |
251 | int board_id = smscore_get_board_id(coredev); | ||
250 | 252 | ||
251 | sms_log("Allocating input device"); | 253 | sms_log("Allocating input device"); |
252 | input_dev = input_allocate_device(); | 254 | input_dev = input_allocate_device(); |
@@ -256,8 +258,7 @@ int sms_ir_init(struct smscore_device_t *coredev) | |||
256 | } | 258 | } |
257 | 259 | ||
258 | coredev->ir.input_dev = input_dev; | 260 | coredev->ir.input_dev = input_dev; |
259 | coredev->ir.ir_kb_type = | 261 | coredev->ir.ir_kb_type = sms_get_board(board_id)->ir_kb_type; |
260 | sms_get_board(smscore_get_board_id(coredev))->ir_kb_type; | ||
261 | coredev->ir.keyboard_layout_map = | 262 | coredev->ir.keyboard_layout_map = |
262 | keyboard_layout_maps[coredev->ir.ir_kb_type]. | 263 | keyboard_layout_maps[coredev->ir.ir_kb_type]. |
263 | keyboard_layout_map; | 264 | keyboard_layout_map; |
@@ -269,11 +270,15 @@ int sms_ir_init(struct smscore_device_t *coredev) | |||
269 | coredev->ir.controller, coredev->ir.timeout); | 270 | coredev->ir.controller, coredev->ir.timeout); |
270 | 271 | ||
271 | snprintf(coredev->ir.name, | 272 | snprintf(coredev->ir.name, |
272 | IR_DEV_NAME_MAX_LEN, | 273 | sizeof(coredev->ir.name), |
273 | "SMS IR w/kbd type %d", | 274 | "SMS IR (%s)", |
274 | coredev->ir.ir_kb_type); | 275 | sms_get_board(board_id)->name); |
276 | |||
277 | strlcpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys)); | ||
278 | strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys)); | ||
279 | |||
275 | input_dev->name = coredev->ir.name; | 280 | input_dev->name = coredev->ir.name; |
276 | input_dev->phys = coredev->ir.name; | 281 | input_dev->phys = coredev->ir.phys; |
277 | input_dev->dev.parent = coredev->device; | 282 | input_dev->dev.parent = coredev->device; |
278 | 283 | ||
279 | /* Key press events only */ | 284 | /* Key press events only */ |