diff options
author | Devin Heitmueller <devin.heitmueller@gmail.com> | 2008-11-15 07:13:07 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-16 23:57:53 -0200 |
commit | 99afb989b05b9fb1c7b3831ce4b7a000b214acdb (patch) | |
tree | 0cf2ed3686af21ab487a19ca2ba70d571b1bc1df /drivers/media/dvb/dvb-usb/dib0700_core.c | |
parent | deaf53e3c8e717169669ee6c2594b5c33d1af93b (diff) | |
download | talos-obmc-linux-99afb989b05b9fb1c7b3831ce4b7a000b214acdb.tar.gz talos-obmc-linux-99afb989b05b9fb1c7b3831ce4b7a000b214acdb.zip |
V4L/DVB (9639): Make dib0700 remote control support work with firmware v1.20
The format for reading the IR controller changed in firmware 1.20. It now
provides the events on bulk endpoint 1 instead of using a control request.
Support the new format, providing backward compatibility for users who might
be using older firmware.
Thanks to Patrick Boettcher <patrick.boettcher@desy.de> for providing the
required information on how the version 1.20 firmware works.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dib0700_core.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dib0700_core.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c index dd53cee3896d..200b215f4d8b 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_core.c +++ b/drivers/media/dvb/dvb-usb/dib0700_core.c @@ -19,6 +19,22 @@ MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (defau DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); + +int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion, + u32 *romversion, u32 *ramversion, u32 *fwtype) +{ + u8 b[16]; + int ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), + REQUEST_GET_VERSION, + USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, + b, sizeof(b), USB_CTRL_GET_TIMEOUT); + *hwversion = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; + *romversion = (b[4] << 24) | (b[5] << 16) | (b[6] << 8) | b[7]; + *ramversion = (b[8] << 24) | (b[9] << 16) | (b[10] << 8) | b[11]; + *fwtype = (b[12] << 24) | (b[13] << 16) | (b[14] << 8) | b[15]; + return ret; +} + /* expecting rx buffer: request data[0] data[1] ... data[2] */ static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen) { |