summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-usb/dtt200u.c
diff options
context:
space:
mode:
authorPatrick Boettcher <devnull@localhost>2005-04-02 14:42:56 +0000
committerPatrick Boettcher <devnull@localhost>2005-04-02 14:42:56 +0000
commit861784e76607eafbfb13c6ce1e3b87204b3978da (patch)
tree892e736a8c25848d2ccb0a3a8a46f6b92693ec56 /linux/drivers/media/dvb/dvb-usb/dtt200u.c
parent302481a5ffb8737f5fcb821ee79576637aa85055 (diff)
downloadmediapointer-dvb-s2-861784e76607eafbfb13c6ce1e3b87204b3978da.tar.gz
mediapointer-dvb-s2-861784e76607eafbfb13c6ce1e3b87204b3978da.tar.bz2
re-enabled and improved commonly used remote control code for dvb-usb
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/dtt200u.c')
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dtt200u.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dtt200u.c b/linux/drivers/media/dvb/dvb-usb/dtt200u.c
index 28cb6863b..12abff048 100644
--- a/linux/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/linux/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -41,11 +41,29 @@ static int dtt200u_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int
return dvb_usb_generic_write(d,b_pid,4);
}
-static int dtt200u_rc_query(struct dvb_usb_device *d, u8 *key_buf, int *state)
+/* remote control */
+
+struct dvb_usb_nec_rc_key dtt200u_rc_keys[] = {
+ { 0x00, 0xff, 0x03, KEY_1 },
+ { 0x00, 0xff, 0x01, KEY_2 },
+ { 0x00, 0xff, 0x06, KEY_3 },
+};
+
+static int dtt200u_rc_init(struct dvb_usb_device *d)
+{
+ int i;
+ for (i = 0; i < sizeof(dtt200u_rc_keys)/sizeof(struct dvb_usb_nec_rc_key); i++)
+ set_bit(dtt200u_rc_keys[i].key, d->rc_input_dev.keybit);
+ return 0;
+}
+
+static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{
- deb_info("remote query\n");
- *state = REMOTE_KEY_NO;
- return 0; //dtt200u_usb_op(d,RC_VAL_READ,&v,1,NULL,0,20);
+ u8 key[5],cmd = GET_RC_KEY;
+ dvb_usb_generic_rw(d,&cmd,1,key,5);
+ dvb_usb_nec_rc_key_to_event(d,dtt200u_rc_keys,sizeof(dtt200u_rc_keys)/sizeof(struct dvb_usb_nec_rc_key),
+ key,event,state);
+ return 0;
}
static int dtt200u_frontend_attach(struct dvb_usb_device *d)
@@ -81,9 +99,9 @@ static struct dvb_usb_properties dtt200u_properties = {
.power_ctrl = NULL,
.frontend_attach = dtt200u_frontend_attach,
- .rc_interval = 400,
- .remote_protocol = USB_REMOTE_PROTO_NEC,
+ .rc_interval = 200,
.query_rc = dtt200u_rc_query,
+ .init_rc = dtt200u_rc_init,
.generic_bulk_ctrl_endpoint = 0x01,