Re : [BUG]: unitialized buf sent over i2c

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

 



Le 10.07.2006 05:27:27, Trent Piepho a écrit :
On Sun, 9 Jul 2006, manu wrote:
> 	Hi all,
> I was browsing the code in tuner-core.c and saw this in set_type:
>
> 	case TUNER_LG_TDVS_H06XF:
> 		/* Set the Auxiliary Byte. */
> 		buffer[2] &= ~0x20;
> 		buffer[2] |= 0x18;
> 		buffer[3] = 0x20;
> 		i2c_master_send(c, buffer, 4);
> 		default_tuner_init(c);
> 		break;
>
> but buf[0] and buf[1] never get init before.

buffer[2] isn't initialized either.  Here is message from the author
of
this code:
http://www.linuxtv.org/pipermail/linux-dvb/2005-August/003978.html

You can download the datasheet for the TUA6034, the chip programmed
here,
from Infineon's website.  It is just a standard I2C tuner PLL like a
hundred other cards use.  These tuners are programmed with a 4 byte
message, which is really two 2 byte messages back to back.  These two
messages can be sent individually.

\ It looks like the author thought he was modifying an existing message
to
the tuner, rather than working with an empty buffer.

That code is clearly trying to set the Aux byte to 0x20, which is its
default value after power on reset.  What it really is doing is just
writing random values into the tuner control registers, which doesn't
matter because they will just get overwritten when the tuner is used.
It
may or may not actually set the aux byte, depending on what happens to
be
in buffer[2].

I'll attach two patches, the first fixes this to do what the original
author probably wanted to do.

The second just gets rid of it, I don't think this code is necessary
at
all.  There are plenty of other tuners with TUA603x chips that have
this
same aux byte, and none of them have this code to set the it to the
default
value.

OK, I do not have the hardware, I just saw this and found it suspicious ;-)
Bye
Manu

	

	
		
___________________________________________________________________________ Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com


_______________________________________________

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