Re: No frontend for Twinhan VP-1022A Ver 2.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try this. I think it is a fault with ir-kbd-i2c, in that it is being probed at the same time as the dst_probe is occurring, and so dst_probe fails. This patch might fix your problem. You can either apply this, or else just delete bttv_probe part yourself. If you use this patch, you need to specify insmod option twinhan=1 for ir-kbd-i2c module

Added twinhan option to bypass "ir_probe", which causes "dst_probe" to fail on Twinhan DST clones.

diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 59edf58..0ab2db6 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -52,8 +54,11 @@ module_param(debug, int, 0644);    /* de

static int hauppauge = 0;
module_param(hauppauge, int, 0644);    /* Choose Hauppauge remote */
-MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)"); +MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)")

+static int twinhan = 0;
+module_param(twinhan, int, 0644);      /* Fix for Twinhan cards */
+MODULE_PARM_DESC(twinhan, "Workaround for Twinhan _write_dst error which causes dst_probe to fail: 1=on, 0=off (default 0)");

#define DEVNAME "ir-kbd-i2c"
#define dprintk(level, fmt, arg...)    if (debug >= level) \
@@ -339,7 +344,7 @@ static int ir_attach(struct i2c_adapter
       case 0x1a:
               name        = "Hauppauge";
               ir->get_key = get_key_haup;
-               ir_type     = IR_TYPE_RC5;
+               ir_type     = IR_TYPE_OTHER;
               if (hauppauge == 1) {
                       ir_codes    = ir_codes_hauppauge_new;
               } else {
@@ -447,51 +452,55 @@ static int ir_probe(struct i2c_adapter *

          That's why we probe 0x1a (~0x34) first. CB
       */
-
-       static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
-       static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, -1 };
-       static const int probe_em28XX[] = { 0x30, 0x47, -1 };
-       const int *probe = NULL;
-       struct i2c_client c;
-       unsigned char buf;
-       int i,rc;
-
-       switch (adap->id) {
-       case I2C_HW_B_BT848:
-               probe = probe_bttv;
-               break;
-       case I2C_HW_B_CX2341X:
-               probe = probe_bttv;
-               break;
-       case I2C_HW_SAA7134:
-               probe = probe_saa7134;
-               break;
-       case I2C_HW_B_EM28XX:
-               probe = probe_em28XX;
-               break;
-       }
-       if (NULL == probe)
+       if (twinhan == 1) {
+               dprintk(1,"Twinhan option specified. IR disabled.\n");
               return 0;
-
-       memset(&c,0,sizeof(c));
-       c.adapter = adap;
-       for (i = 0; -1 != probe[i]; i++) {
-               c.addr = probe[i];
-               rc = i2c_master_recv(&c,&buf,0);
-               dprintk(1,"probe 0x%02x @ %s: %s\n",
-                       probe[i], adap->name,
-                       (0 == rc) ? "yes" : "no");
-               if (0 == rc) {
-                       ir_attach(adap,probe[i],0,0);
+       } else {
+ static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
+               static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, -1 };
+               static const int probe_em28XX[] = { 0x30, 0x47, -1 };
+               const int *probe = NULL;
+               struct i2c_client c;
+               unsigned char buf;
+               int i,rc;
+
+               switch (adap->id) {
+               case I2C_HW_B_BT848:
+                       probe = probe_bttv;
+                       break;
+               case I2C_HW_B_CX2341X:
+                       probe = probe_bttv;
+                       break;
+               case I2C_HW_SAA7134:
+                       probe = probe_saa7134;
+                       break;
+               case I2C_HW_B_EM28XX:
+                       probe = probe_em28XX;
                       break;
               }
+               if (NULL == probe)
+                       return 0;
+
+               memset(&c,0,sizeof(c));
+               c.adapter = adap;
+               for (i = 0; -1 != probe[i]; i++) {
+                       c.addr = probe[i];
+                       rc = i2c_master_recv(&c,&buf,0);
+                       dprintk(1,"probe 0x%02x @ %s: %s\n",
+                               probe[i], adap->name,
+                               (0 == rc) ? "yes" : "no");
+                       if (0 == rc) {
+                               ir_attach(adap,probe[i],0,0);
+                               break;
+                       }
+               }
+               return 0;
       }
-       return 0;
}

_________________________________________________________________
MSN Hotmail is evolving ? check out the new Windows Live Mail http://ideas.live.com


_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux