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 | |
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')
-rw-r--r-- | drivers/media/dvb/siano/smsir.c | 17 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsir.h | 5 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsusb.c | 3 |
3 files changed, 15 insertions, 10 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 */ |
diff --git a/drivers/media/dvb/siano/smsir.h b/drivers/media/dvb/siano/smsir.h index b7d703e2d338..77e65057949b 100644 --- a/drivers/media/dvb/siano/smsir.h +++ b/drivers/media/dvb/siano/smsir.h | |||
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
24 | 24 | ||
25 | #include <linux/input.h> | 25 | #include <linux/input.h> |
26 | 26 | ||
27 | #define IR_DEV_NAME_MAX_LEN 23 /* "SMS IR kbd type nn\0" */ | 27 | #define IR_DEV_NAME_MAX_LEN 40 |
28 | #define IR_KEYBOARD_LAYOUT_SIZE 64 | 28 | #define IR_KEYBOARD_LAYOUT_SIZE 64 |
29 | #define IR_DEFAULT_TIMEOUT 100 | 29 | #define IR_DEFAULT_TIMEOUT 100 |
30 | 30 | ||
@@ -78,7 +78,8 @@ struct smscore_device_t; | |||
78 | struct ir_t { | 78 | struct ir_t { |
79 | struct input_dev *input_dev; | 79 | struct input_dev *input_dev; |
80 | enum ir_kb_type ir_kb_type; | 80 | enum ir_kb_type ir_kb_type; |
81 | char name[IR_DEV_NAME_MAX_LEN+1]; | 81 | char name[IR_DEV_NAME_MAX_LEN + 1]; |
82 | char phys[32]; | ||
82 | u16 *keyboard_layout_map; | 83 | u16 *keyboard_layout_map; |
83 | u32 timeout; | 84 | u32 timeout; |
84 | u32 controller; | 85 | u32 controller; |
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c index a9c27fb69ba7..50d4338610e0 100644 --- a/drivers/media/dvb/siano/smsusb.c +++ b/drivers/media/dvb/siano/smsusb.c | |||
@@ -352,8 +352,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) | |||
352 | params.num_buffers = MAX_BUFFERS; | 352 | params.num_buffers = MAX_BUFFERS; |
353 | params.sendrequest_handler = smsusb_sendrequest; | 353 | params.sendrequest_handler = smsusb_sendrequest; |
354 | params.context = dev; | 354 | params.context = dev; |
355 | snprintf(params.devpath, sizeof(params.devpath), | 355 | usb_make_path(dev->udev, params.devpath, sizeof(params.devpath)); |
356 | "usb\\%d-%s", dev->udev->bus->busnum, dev->udev->devpath); | ||
357 | 356 | ||
358 | /* register in smscore */ | 357 | /* register in smscore */ |
359 | rc = smscore_register_device(¶ms, &dev->coredev); | 358 | rc = smscore_register_device(¶ms, &dev->coredev); |