aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor M. Liplianin <liplianin@me.by>2009-06-13 07:10:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 18:07:46 -0400
commit8a8dad71485cbfc21ddc0e93f4ae4338b68b82b1 (patch)
tree235a14f49990649d1c6fa3c472c93226ad237b22
parent1cdc6392b74246be333e2c88b61beedbf9991422 (diff)
V4L/DVB (11981): Remote control debugging for dw2102 driver based USB cards
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/dvb-usb/dw2102.c27
-rw-r--r--drivers/media/dvb/dvb-usb/dw2102.h1
2 files changed, 21 insertions, 7 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c
index c65f273ff313..dee9399f8597 100644
--- a/drivers/media/dvb/dvb-usb/dw2102.c
+++ b/drivers/media/dvb/dvb-usb/dw2102.c
@@ -51,7 +51,9 @@ struct dw210x_rc_keys {
51/* debug */ 51/* debug */
52static int dvb_usb_dw2102_debug; 52static int dvb_usb_dw2102_debug;
53module_param_named(debug, dvb_usb_dw2102_debug, int, 0644); 53module_param_named(debug, dvb_usb_dw2102_debug, int, 0644);
54MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer (or-able))." DVB_USB_DEBUG_STATUS); 54MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer 4=rc(or-able))."
55 DVB_USB_DEBUG_STATUS);
56
55 57
56DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 58DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
57 59
@@ -553,26 +555,37 @@ static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
553{ 555{
554 struct dw210x_state *st = d->priv; 556 struct dw210x_state *st = d->priv;
555 u8 key[2]; 557 u8 key[2];
556 struct i2c_msg msg[] = { 558 struct i2c_msg msg = {
557 {.addr = DW2102_RC_QUERY, .flags = I2C_M_RD, .buf = key, 559 .addr = DW2102_RC_QUERY,
558 .len = 2}, 560 .flags = I2C_M_RD,
561 .buf = key,
562 .len = 2
559 }; 563 };
560 int i; 564 int i;
561 565
562 *state = REMOTE_NO_KEY_PRESSED; 566 *state = REMOTE_NO_KEY_PRESSED;
563 if (dw2102_i2c_transfer(&d->i2c_adap, msg, 1) == 1) { 567 if (dw2102_i2c_transfer(&d->i2c_adap, &msg, 1) == 1) {
564 for (i = 0; i < ARRAY_SIZE(dw210x_rc_keys); i++) { 568 for (i = 0; i < ARRAY_SIZE(dw210x_rc_keys); i++) {
565 if (dw210x_rc_keys[i].data == msg[0].buf[0]) { 569 if (dw210x_rc_keys[i].data == msg.buf[0]) {
566 *state = REMOTE_KEY_PRESSED; 570 *state = REMOTE_KEY_PRESSED;
567 *event = dw210x_rc_keys[i].event; 571 *event = dw210x_rc_keys[i].event;
568 st->last_key_pressed = 572 st->last_key_pressed =
569 dw210x_rc_keys[i].event; 573 dw210x_rc_keys[i].event;
570 break; 574 break;
571 } 575 }
576
572 st->last_key_pressed = 0; 577 st->last_key_pressed = 0;
573 } 578 }
579
580 if ((*state) == REMOTE_KEY_PRESSED)
581 deb_rc("%s: found rc key: %x, %x, event: %x\n",
582 __func__, key[0], key[1], (*event));
583 else if (key[0] != 0xff)
584 deb_rc("%s: unknown rc key: %x, %x\n",
585 __func__, key[0], key[1]);
586
574 } 587 }
575 /* info("key: %x %x\n",key[0],key[1]); */ 588
576 return 0; 589 return 0;
577} 590}
578 591
diff --git a/drivers/media/dvb/dvb-usb/dw2102.h b/drivers/media/dvb/dvb-usb/dw2102.h
index e3370734e95a..5cd0b0eb6ce1 100644
--- a/drivers/media/dvb/dvb-usb/dw2102.h
+++ b/drivers/media/dvb/dvb-usb/dw2102.h
@@ -5,4 +5,5 @@
5#include "dvb-usb.h" 5#include "dvb-usb.h"
6 6
7#define deb_xfer(args...) dprintk(dvb_usb_dw2102_debug, 0x02, args) 7#define deb_xfer(args...) dprintk(dvb_usb_dw2102_debug, 0x02, args)
8#define deb_rc(args...) dprintk(dvb_usb_dw2102_debug, 0x04, args)
8#endif 9#endif