aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/a800.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/a800.c')
-rw-r--r--drivers/media/dvb/dvb-usb/a800.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c
index a5c363727133..b95a95e17840 100644
--- a/drivers/media/dvb/dvb-usb/a800.c
+++ b/drivers/media/dvb/dvb-usb/a800.c
@@ -37,9 +37,9 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_pr
37 return 0; 37 return 0;
38} 38}
39 39
40static struct ir_scancode ir_codes_a800_table[] = { 40static struct rc_map_table rc_map_a800_table[] = {
41 { 0x0201, KEY_PROG1 }, /* SOURCE */ 41 { 0x0201, KEY_MODE }, /* SOURCE */
42 { 0x0200, KEY_POWER }, /* POWER */ 42 { 0x0200, KEY_POWER2 }, /* POWER */
43 { 0x0205, KEY_1 }, /* 1 */ 43 { 0x0205, KEY_1 }, /* 1 */
44 { 0x0206, KEY_2 }, /* 2 */ 44 { 0x0206, KEY_2 }, /* 2 */
45 { 0x0207, KEY_3 }, /* 3 */ 45 { 0x0207, KEY_3 }, /* 3 */
@@ -52,8 +52,8 @@ static struct ir_scancode ir_codes_a800_table[] = {
52 { 0x0212, KEY_LEFT }, /* L / DISPLAY */ 52 { 0x0212, KEY_LEFT }, /* L / DISPLAY */
53 { 0x0211, KEY_0 }, /* 0 */ 53 { 0x0211, KEY_0 }, /* 0 */
54 { 0x0213, KEY_RIGHT }, /* R / CH RTN */ 54 { 0x0213, KEY_RIGHT }, /* R / CH RTN */
55 { 0x0217, KEY_PROG2 }, /* SNAP SHOT */ 55 { 0x0217, KEY_CAMERA }, /* SNAP SHOT */
56 { 0x0210, KEY_PROG3 }, /* 16-CH PREV */ 56 { 0x0210, KEY_LAST }, /* 16-CH PREV */
57 { 0x021e, KEY_VOLUMEDOWN }, /* VOL DOWN */ 57 { 0x021e, KEY_VOLUMEDOWN }, /* VOL DOWN */
58 { 0x020c, KEY_ZOOM }, /* FULL SCREEN */ 58 { 0x020c, KEY_ZOOM }, /* FULL SCREEN */
59 { 0x021f, KEY_VOLUMEUP }, /* VOL UP */ 59 { 0x021f, KEY_VOLUMEUP }, /* VOL UP */
@@ -78,17 +78,26 @@ static struct ir_scancode ir_codes_a800_table[] = {
78 78
79static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 79static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
80{ 80{
81 u8 key[5]; 81 int ret;
82 u8 *key = kmalloc(5, GFP_KERNEL);
83 if (!key)
84 return -ENOMEM;
85
82 if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), 86 if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0),
83 0x04, USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, key, 5, 87 0x04, USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, key, 5,
84 2000) != 5) 88 2000) != 5) {
85 return -ENODEV; 89 ret = -ENODEV;
90 goto out;
91 }
86 92
87 /* call the universal NEC remote processor, to find out the key's state and event */ 93 /* call the universal NEC remote processor, to find out the key's state and event */
88 dvb_usb_nec_rc_key_to_event(d,key,event,state); 94 dvb_usb_nec_rc_key_to_event(d,key,event,state);
89 if (key[0] != 0) 95 if (key[0] != 0)
90 deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]); 96 deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]);
91 return 0; 97 ret = 0;
98out:
99 kfree(key);
100 return ret;
92} 101}
93 102
94/* USB Driver stuff */ 103/* USB Driver stuff */
@@ -148,8 +157,8 @@ static struct dvb_usb_device_properties a800_properties = {
148 157
149 .rc.legacy = { 158 .rc.legacy = {
150 .rc_interval = DEFAULT_RC_INTERVAL, 159 .rc_interval = DEFAULT_RC_INTERVAL,
151 .rc_key_map = ir_codes_a800_table, 160 .rc_map_table = rc_map_a800_table,
152 .rc_key_map_size = ARRAY_SIZE(ir_codes_a800_table), 161 .rc_map_size = ARRAY_SIZE(rc_map_a800_table),
153 .rc_query = a800_rc_query, 162 .rc_query = a800_rc_query,
154 }, 163 },
155 164