diff options
author | Igor M. Liplianin <liplianin@me.by> | 2009-06-13 14:10:24 +0300 |
---|---|---|
committer | Igor M. Liplianin <liplianin@me.by> | 2009-06-13 14:10:24 +0300 |
commit | aa180367f345706e7f042506f21cbab42c6e233a (patch) | |
tree | 0d28113a821412a85a11b828b104635adab8d910 /linux/drivers/media/dvb/dvb-usb | |
parent | 1d58a0edec72a8112ebbe9b6b101edcdd5a9572b (diff) | |
download | mediapointer-dvb-s2-aa180367f345706e7f042506f21cbab42c6e233a.tar.gz mediapointer-dvb-s2-aa180367f345706e7f042506f21cbab42c6e233a.tar.bz2 |
Remote control debugging for dw2102 driver based USB cards
From: Igor M. Liplianin <liplianin@me.by>
Remote control debugging for dw2102 driver based USB cards
It includes DVBWorld, TeVii, Terratec and others.
Type 'modprobe dvb-usb-dw2102 debug=4', then look at dmesg output.
Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dw2102.c | 27 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dw2102.h | 1 |
2 files changed, 21 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dw2102.c b/linux/drivers/media/dvb/dvb-usb/dw2102.c index 2b8ee587b..725d5c00d 100644 --- a/linux/drivers/media/dvb/dvb-usb/dw2102.c +++ b/linux/drivers/media/dvb/dvb-usb/dw2102.c @@ -51,7 +51,9 @@ struct dw210x_rc_keys { /* debug */ static int dvb_usb_dw2102_debug; module_param_named(debug, dvb_usb_dw2102_debug, int, 0644); -MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer (or-able))." DVB_USB_DEBUG_STATUS); +MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer 4=rc(or-able))." + DVB_USB_DEBUG_STATUS); + DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); @@ -565,26 +567,37 @@ static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state) { struct dw210x_state *st = d->priv; u8 key[2]; - struct i2c_msg msg[] = { - {.addr = DW2102_RC_QUERY, .flags = I2C_M_RD, .buf = key, - .len = 2}, + struct i2c_msg msg = { + .addr = DW2102_RC_QUERY, + .flags = I2C_M_RD, + .buf = key, + .len = 2 }; int i; *state = REMOTE_NO_KEY_PRESSED; - if (dw2102_i2c_transfer(&d->i2c_adap, msg, 1) == 1) { + if (dw2102_i2c_transfer(&d->i2c_adap, &msg, 1) == 1) { for (i = 0; i < ARRAY_SIZE(dw210x_rc_keys); i++) { - if (dw210x_rc_keys[i].data == msg[0].buf[0]) { + if (dw210x_rc_keys[i].data == msg.buf[0]) { *state = REMOTE_KEY_PRESSED; *event = dw210x_rc_keys[i].event; st->last_key_pressed = dw210x_rc_keys[i].event; break; } + st->last_key_pressed = 0; } + + if ((*state) == REMOTE_KEY_PRESSED) + deb_rc("%s: found rc key: %x, %x, event: %x\n", + __func__, key[0], key[1], (*event)); + else if (key[0] != 0xff) + deb_rc("%s: unknown rc key: %x, %x\n", + __func__, key[0], key[1]); + } - /* info("key: %x %x\n",key[0],key[1]); */ + return 0; } diff --git a/linux/drivers/media/dvb/dvb-usb/dw2102.h b/linux/drivers/media/dvb/dvb-usb/dw2102.h index e3370734e..5cd0b0eb6 100644 --- a/linux/drivers/media/dvb/dvb-usb/dw2102.h +++ b/linux/drivers/media/dvb/dvb-usb/dw2102.h @@ -5,4 +5,5 @@ #include "dvb-usb.h" #define deb_xfer(args...) dprintk(dvb_usb_dw2102_debug, 0x02, args) +#define deb_rc(args...) dprintk(dvb_usb_dw2102_debug, 0x04, args) #endif |