diff options
author | Patrick Boettcher <devnull@localhost> | 2005-04-29 10:44:48 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-04-29 10:44:48 +0000 |
commit | e86aed48d36edbea2385cab090e464064c5620d5 (patch) | |
tree | 85f5a5c2b35c173d653954f20e97499f9f3c92c4 /linux/drivers/media/dvb/dvb-usb/vp7045.c | |
parent | 4335870fc9921e4c690eff9df3be152aa2e3e606 (diff) | |
download | mediapointer-dvb-s2-e86aed48d36edbea2385cab090e464064c5620d5.tar.gz mediapointer-dvb-s2-e86aed48d36edbea2385cab090e464064c5620d5.tar.bz2 |
added key-mapping for the a800 (Thanks to Glen Harris)
changed remote-control-key-types and functions (saved about 80 lines code)
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/vp7045.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/vp7045.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/vp7045.c b/linux/drivers/media/dvb/dvb-usb/vp7045.c index b603f1e43..e385bdbc0 100644 --- a/linux/drivers/media/dvb/dvb-usb/vp7045.c +++ b/linux/drivers/media/dvb/dvb-usb/vp7045.c @@ -93,29 +93,16 @@ static int vp7045_power_ctrl(struct dvb_usb_device *d, int onoff) /* The keymapping struct. Somehow this should be loaded to the driver, but * currently it is hardcoded. */ -struct { - u8 raw; - u32 key; -} vp7045_rc_key_mapping[] = { - +static struct dvb_usb_rc_key vp7045_rc_keys[] = { /* insert the keys like this. to make the raw keys visible, enable * debug=0x04 when loading dvb-usb-vp7045. */ /* these keys are probably wrong. I don't have a working IR-receiver on my * vp7045, so I can't test it. Patches are welcome. */ - { 0x01, KEY_1 }, - { 0x02, KEY_2 }, + { 0x00, 0x01, KEY_1 }, + { 0x00, 0x02, KEY_2 }, }; -static int vp7045_rc_init(struct dvb_usb_device *d) -{ - int i; - for (i = 0; i < sizeof(vp7045_rc_key_mapping)/sizeof(vp7045_rc_key_mapping[0]); i++) - set_bit(vp7045_rc_key_mapping[i].key, d->rc_input_dev.keybit); - - return 0; -} - static int vp7045_rc_query(struct dvb_usb_device *d, u32 *key_buf, int *state) { u8 key; @@ -129,10 +116,10 @@ static int vp7045_rc_query(struct dvb_usb_device *d, u32 *key_buf, int *state) return 0; } - for (i = 0; i < sizeof(vp7045_rc_key_mapping)/sizeof(vp7045_rc_key_mapping); i++) - if (vp7045_rc_key_mapping[i].raw == key) { + for (i = 0; i < sizeof(vp7045_rc_keys)/sizeof(struct dvb_usb_rc_key); i++) + if (vp7045_rc_keys[i].data == key) { *state = REMOTE_KEY_PRESSED; - *key_buf = vp7045_rc_key_mapping[i].key; + *key_buf = vp7045_rc_keys[i].event; break; } return 0; @@ -205,15 +192,12 @@ static struct dvb_usb_properties vp7045_properties = { .usb_ctrl = CYPRESS_FX2, .firmware = "dvb-usb-vp7045-01.fw", - .streaming_ctrl = NULL, - .pid_filter = NULL, - .pid_filter_ctrl = NULL, .power_ctrl = vp7045_power_ctrl, .frontend_attach = vp7045_frontend_attach, .read_mac_address = vp7045_read_mac_addr, .rc_interval = 400, - .init_rc = vp7045_rc_init, + .rc_key_map = vp7045_rc_keys, .query_rc = vp7045_rc_query, /* parameter for the MPEG2-data transfer */ |