aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChris Pascoe <c.pascoe@itee.uq.edu.au>2006-01-09 15:21:29 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 15:21:29 -0500
commit7c239703a942117c3446ca06af537fc3ea12fb24 (patch)
treead09a788f27d1a0fdbe089027757c4d4b93579e0 /drivers
parent43eabb4e2284146f8bfae8730ae41c218b724b7d (diff)
V4L/DVB (3312): DViCO USB IR Remote support
- Add support for the remote control receiver inside the DViCO FusionHDTV DVB-T Dual Digital, and a keymap for the MCE remote bundled with it. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c78
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.h2
2 files changed, 80 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 9622a79d6e68..163b69405b95 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -15,6 +15,7 @@
15 * part 15 * part
16 * 16 *
17 * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de) 17 * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de)
18 * Copyright (C) 2006 Chris Pascoe (c.pascoe@itee.uq.edu.au)
18 * 19 *
19 * This program is free software; you can redistribute it and/or modify it 20 * This program is free software; you can redistribute it and/or modify it
20 * under the terms of the GNU General Public License as published by the Free 21 * under the terms of the GNU General Public License as published by the Free
@@ -159,6 +160,30 @@ static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff)
159 return 0; 160 return 0;
160} 161}
161 162
163static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
164{
165 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
166 u8 irCode[4];
167 int i;
168
169 cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, irCode, 4);
170
171 *event = 0;
172 *state = REMOTE_NO_KEY_PRESSED;
173
174 for (i = 0; i < d->props.rc_key_map_size; i++) {
175 if (keymap[i].custom == irCode[2] &&
176 keymap[i].data == irCode[3]) {
177 *event = keymap[i].event;
178 *state = REMOTE_KEY_PRESSED;
179
180 return 0;
181 }
182 }
183
184 return 0;
185}
186
162static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) 187static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
163{ 188{
164 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 }; 189 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 };
@@ -372,6 +397,54 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
372 } 397 }
373}; 398};
374 399
400struct dvb_usb_rc_key dvico_mce_rc_keys[] = {
401 { 0xfe, 0x02, KEY_TV },
402 { 0xfe, 0x0e, KEY_MP3 },
403 { 0xfe, 0x1a, KEY_DVD },
404 { 0xfe, 0x1e, KEY_FAVORITES },
405 { 0xfe, 0x16, KEY_SETUP },
406 { 0xfe, 0x46, KEY_POWER2 },
407 { 0xfe, 0x0a, KEY_EPG },
408 { 0xfe, 0x49, KEY_BACK },
409 { 0xfe, 0x4d, KEY_MENU },
410 { 0xfe, 0x51, KEY_UP },
411 { 0xfe, 0x5b, KEY_LEFT },
412 { 0xfe, 0x5f, KEY_RIGHT },
413 { 0xfe, 0x53, KEY_DOWN },
414 { 0xfe, 0x5e, KEY_OK },
415 { 0xfe, 0x59, KEY_INFO },
416 { 0xfe, 0x55, KEY_TAB },
417 { 0xfe, 0x0f, KEY_PREVIOUSSONG },/* Replay */
418 { 0xfe, 0x12, KEY_NEXTSONG }, /* Skip */
419 { 0xfe, 0x42, KEY_ENTER }, /* Windows/Start */
420 { 0xfe, 0x15, KEY_VOLUMEUP },
421 { 0xfe, 0x05, KEY_VOLUMEDOWN },
422 { 0xfe, 0x11, KEY_CHANNELUP },
423 { 0xfe, 0x09, KEY_CHANNELDOWN },
424 { 0xfe, 0x52, KEY_CAMERA },
425 { 0xfe, 0x5a, KEY_TUNER }, /* Live */
426 { 0xfe, 0x19, KEY_OPEN },
427 { 0xfe, 0x0b, KEY_1 },
428 { 0xfe, 0x17, KEY_2 },
429 { 0xfe, 0x1b, KEY_3 },
430 { 0xfe, 0x07, KEY_4 },
431 { 0xfe, 0x50, KEY_5 },
432 { 0xfe, 0x54, KEY_6 },
433 { 0xfe, 0x48, KEY_7 },
434 { 0xfe, 0x4c, KEY_8 },
435 { 0xfe, 0x58, KEY_9 },
436 { 0xfe, 0x13, KEY_ANGLE }, /* Aspect */
437 { 0xfe, 0x03, KEY_0 },
438 { 0xfe, 0x1f, KEY_ZOOM },
439 { 0xfe, 0x43, KEY_REWIND },
440 { 0xfe, 0x47, KEY_PLAYPAUSE },
441 { 0xfe, 0x4f, KEY_FASTFORWARD },
442 { 0xfe, 0x57, KEY_MUTE },
443 { 0xfe, 0x0d, KEY_STOP },
444 { 0xfe, 0x01, KEY_RECORD },
445 { 0xfe, 0x4e, KEY_POWER },
446};
447
375static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { 448static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
376 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 449 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
377 450
@@ -389,6 +462,11 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
389 462
390 .i2c_algo = &cxusb_i2c_algo, 463 .i2c_algo = &cxusb_i2c_algo,
391 464
465 .rc_interval = 150,
466 .rc_key_map = dvico_mce_rc_keys,
467 .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
468 .rc_query = cxusb_rc_query,
469
392 .generic_bulk_ctrl_endpoint = 0x01, 470 .generic_bulk_ctrl_endpoint = 0x01,
393 /* parameter for the MPEG2-data transfer */ 471 /* parameter for the MPEG2-data transfer */
394 .urb = { 472 .urb = {
diff --git a/drivers/media/dvb/dvb-usb/cxusb.h b/drivers/media/dvb/dvb-usb/cxusb.h
index 135c2a81f581..087c99427853 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.h
+++ b/drivers/media/dvb/dvb-usb/cxusb.h
@@ -21,6 +21,8 @@ extern int dvb_usb_cxusb_debug;
21#define CMD_STREAMING_ON 0x36 21#define CMD_STREAMING_ON 0x36
22#define CMD_STREAMING_OFF 0x37 22#define CMD_STREAMING_OFF 0x37
23 23
24#define CMD_GET_IR_CODE 0x47
25
24#define CMD_ANALOG 0x50 26#define CMD_ANALOG 0x50
25#define CMD_DIGITAL 0x51 27#define CMD_DIGITAL 0x51
26 28