Mailing List archive

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

[linux-dvb] Re: Problem conserning NEWSTRUCT drivers, DVB-C andQAM 128



Hi,

I'll apply your fix in CVS.

dvb_register_frontend() is supposed to return an int as success/failed 
indicator, I'll fix this too.

thanks for your fix,

- Holger


Jaakko Hyvätti wrote:
>   Hi,
> 
>   I found the reason for this.  The ves1820 register 0 is first set to the
> correct QAM setting, but immediately after that FE_RESET is called, and
> reg0 value is lost and QAM_128 value is replaced in there.  I added a
> couple of printk's to obvious places to find this:
> 
> Sep  8 04:20:04 pupu kernel: ves1820.c: Setting tuner type 1 to 161.750000 MHz
> Sep  8 04:20:04 pupu kernel: ves1820.c: reg0 69
> Sep  8 04:20:04 pupu kernel: ves1820.c set to QAM_64, 6.900000 Msym/s, inversion:0
> Sep  8 04:20:04 pupu kernel: ves1820.c reset, reg0 6d
> 
>   This is because the internal storage of the ves1820 driver data is not
> updated correctly when changing from QAM_128 to QAM_64.  The bits are
> OR'ed but no bits are cleared.  As QAM_128 is represented by bits 011 and
> QAM_64 is represented as 010, the QAM_128 setting is premanent if set
> once.  Here is a patch:
> 
> Index: driver/frontends/ves1820.c
> ===================================================================
> RCS file: /cvs/linuxtv/DVB/driver/frontends/Attic/ves1820.c,v
> retrieving revision 1.1.2.10
> diff -u -r1.1.2.10 ves1820.c
> --- driver/frontends/ves1820.c	19 Aug 2002 12:08:18 -0000	1.1.2.10
> +++ driver/frontends/ves1820.c	8 Sep 2002 02:09:08 -0000
> @@ -31,13 +31,13 @@
>  #define dprintk	if (debug) printk
> 
> 
> -#define SET_PWM(frontend,pwm) do { (int) frontend->data |= pwm; } while (0)
> +#define SET_PWM(frontend,pwm) do { (int) frontend->data &= 0xffff00; (int) frontend->data |= pwm; } while (0)
>  #define GET_PWM(frontend) ((u8) ((int) frontend->data & 0xff))
> 
> -#define SET_REG0(frontend,reg0) do { (int) frontend->data |= reg0 << 8; } while (0)
> +#define SET_REG0(frontend,reg0) do { (int) frontend->data &= 0xff00ff; (int) frontend->data |= reg0 << 8; } while (0)
>  #define GET_REG0(frontend) ((u8) (((int) frontend->data >> 8) & 0xff))
> 
> -#define SET_TUNER(frontend,type) do { (int) frontend->data |= type << 16; } while (0)
> +#define SET_TUNER(frontend,type) do { (int) frontend->data &= 0xffff; (int) frontend->data |= type << 16; } while (0)
>  #define GET_TUNER(frontend) ((u8) (((int) frontend->data >> 16) & 0xff))
> 
>   After this patch I can tune to all streams in HTV cable, except for the
> 138MHz one.  Probably below some hardware limit?  Well that's not free to
> air anyway.
> 
>   Ps. I do not quite understand why dvb_register_frontend does this:
> 	return (struct dvb_frontend*) data;
> ..where data is the frontend internal data???
> 
> -Jaakko
> 




--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index