Hi, heres a patch to fix problems with tuner/PLL synth detection with the stv0299 code.

I decided just to make it use single i2c transfers whenever talking to the PLL, since 
its obviously not 
reliable to use double transfers.


--- CUT HERE ---
Index: linux/drivers/media/dvb/frontends/stv0299.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/frontends/stv0299.c,v
retrieving revision 1.5
diff -r1.5 stv0299.c
252,258c252,253
<       if (ftype == LG_TDQF_S001F || ftype == ALPS_BSRU6) {
<               ret  = i2c->xfer (i2c, &msg[0], 1);
<               ret += i2c->xfer (i2c, &msg[1], 1);
<       }
<       else {
<               ret = i2c->xfer (i2c, msg, 2);
<       }
---
>       ret  = i2c->xfer (i2c, &msg[0], 1);
>       ret += i2c->xfer (i2c, &msg[1], 1);
339c334,335
<       ret = i2c->xfer (i2c, msg, 2);
---
>       ret =  i2c->xfer (i2c, &msg[0], 1);
>       ret += i2c->xfer (i2c, &msg[1], 1);
790c786,787
<       int type;
---
>       int status;
> 
794c791
<         u8 stat [] = { 0 };
---
>       u8 stat [] = { 0 };
796c793
<                            { addr: 0x60, flags: I2C_M_RD, buf: stat, len: 1 }};
---
>                                 { addr: 0x60, flags: I2C_M_RD, buf: stat, len: 1 }};
800,801c797,800
<       if (i2c->xfer(i2c, msg1, 2) == 2) {
<               type = PHILIPS_SU1278SH;
---
>         status = i2c->xfer(i2c, &msg1[0], 1);
>         status += i2c->xfer(i2c, &msg1[1], 1);
>         if (status == 2) 
>         {
803,816c802,816
<       } else if (i2c->xfer(i2c, msg2, 2) == 2) {
< if (0) { //           if ((stat[0] & 0x3f) == 0) {
<                       type = LG_TDQF_S001F;
<                       printk ("%s: setup for tuner TDQF-S001F\n", __FILE__);
<               }
<               else {
<                       type = ALPS_BSRU6;
<                       printk ("%s: setup for tuner BSRU6, TDQB-S00x\n", __FILE__);
<               }
<       } else {
<               type = UNKNOWN_FRONTEND;
<               printk ("%s: unknown PLL synthesizer, "
<                       "please report to <[EMAIL PROTECTED]>!!\n",
<                       __FILE__);
---
>               return PHILIPS_SU1278SH;
>       } 
>    
>       status = i2c->xfer(i2c, &msg2[0], 1);
>         status += i2c->xfer(i2c, &msg2[1], 1);
>         if (status == 2)
>         {
>               /*
>               if ((stat[0] & 0x3f) == 0) {
>                       type = LG_TDQF_S001F;
>                       printk ("%s: setup for tuner TDQF-S001F\n", __FILE__);
>               }
>               else { */
>               printk ("%s: setup for tuner BSRU6, TDQB-S00x\n", __FILE__);
>               return ALPS_BSRU6;
818c818,823
<       return type;
---
>    
>         /* If we get here, we have an unknown PLL */
>       printk ("%s: unknown PLL synthesizer, "
>               "please report to <[EMAIL PROTECTED]>!!\n",
>               __FILE__);
>       return UNKNOWN_FRONTEND;
--- CUT HERE ---


-- 
adq


-- 
Info:
To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as 
subject.

Reply via email to