diff options
author | Patrick Boettcher <devnull@localhost> | 2005-04-27 12:45:28 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-04-27 12:45:28 +0000 |
commit | 284f6a87e6612f7025766e5ba0b2470102ab9842 (patch) | |
tree | 3e41c48e7b3fea435a5a2846fdb770935f79e46a /linux/drivers/media/dvb/dvb-usb/a800.c | |
parent | 129880a6df432ecd06fbe5a1ed773683b719fc83 (diff) | |
download | mediapointer-dvb-s2-284f6a87e6612f7025766e5ba0b2470102ab9842.tar.gz mediapointer-dvb-s2-284f6a87e6612f7025766e5ba0b2470102ab9842.tar.bz2 |
- removed the field which specified the delay between the two transfer of a read operation (not unused, didn't help)
- correct the maximal number of feed for each device (up to now it was always 255 even if the device was only able to handle 16 pids)
- added preliminary remote control support for the AVerTV USB2 A800
- changed the remote-control-struct for the NEC-protocol
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/a800.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/a800.c | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/a800.c b/linux/drivers/media/dvb/dvb-usb/a800.c index c6e477d63..cc3f9dd9e 100644 --- a/linux/drivers/media/dvb/dvb-usb/a800.c +++ b/linux/drivers/media/dvb/dvb-usb/a800.c @@ -5,7 +5,7 @@ * * Thanks to * - AVerMedia who kindly provided information and - * - Glen Harris who suffered from my mistake during development. + * - Glen Harris who suffered from my mistakes during development. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -15,11 +15,55 @@ */ #include "dibusb.h" +static int debug; +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "set debugging level (rc=1 (or-able))." DVB_USB_DEBUG_STATUS); +#define deb_rc(args...) dprintk(debug,0x01,args) + static int a800_power_ctrl(struct dvb_usb_device *d, int onoff) { return 0; } +static struct dvb_usb_nec_rc_key a800_rc_keys[] = { + { 0x00, 0x16, KEY_POWER }, /* dummy key */ +}; + +int a800_rc_init(struct dvb_usb_device *d) +{ + int i; + for (i = 0; i < sizeof(a800_rc_keys)/sizeof(struct dvb_usb_nec_rc_key); i++) + set_bit(a800_rc_keys[i].event, d->rc_input_dev.keybit); + return 0; +} + +/*1. Make a vendor request with the following parameters: + * Request = 0x04 + * Index = 0; + * Value = 0; + * TransferBufferLength = 5; + * TransferBuffer = TransferBufferPointer; + * + *2. Send the command to the A800 device, then you can get 5 bytes of data back: + * Control byte | custom code | ~custom code | data code | ~data code + * Control byte: 0x00: no data 0x01: data is available 0x02: repeat (repeat the previous valid data) + */ +int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) +{ + u8 key[5]; + if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), + 0x04, USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, key, 5, + 2*HZ) != 5) + return -ENODEV; + + /* call the universal NEC remote processor, to find out the key's state and event */ + dvb_usb_nec_rc_key_to_event(d,a800_rc_keys,sizeof(a800_rc_keys)/sizeof(struct dvb_usb_nec_rc_key), + key,event,state); + if (key[0] != 0) + deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]); + return 0; +} + /* USB Driver stuff */ static struct dvb_usb_properties a800_properties; @@ -39,6 +83,8 @@ MODULE_DEVICE_TABLE (usb, a800_table); static struct dvb_usb_properties a800_properties = { .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, + .pid_filter_count = 32, + .usb_ctrl = CYPRESS_FX2, .firmware = "dvb-usb-avertv-a800-02.fw", @@ -54,8 +100,8 @@ static struct dvb_usb_properties a800_properties = { .read_mac_address = NULL, .rc_interval = DEFAULT_RC_INTERVAL, - .init_rc = NULL, /* TODO */ - .query_rc = NULL, + .init_rc = a800_rc_init, + .query_rc = a800_rc_query, .i2c_algo = &dibusb_i2c_algo, |