Re: [BUG]: unitialized buf sent over i2c

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

 



Mac Michaels wrote:
> On Wednesday 12 July 2006 23:50, Trent Piepho wrote:
>> On Wed, 12 Jul 2006, Mac Michaels wrote:
>>> The original code written for analog mode was designed
>>> to tune quickly by increasing the pump current then
>>> switch back to the more stable current value after the
>>> signal was acquired. This makes switching channels that
>>> are far apart
>> I think there is some confusion here.  It sounds like you
>> are talking about this code in tuner-simple.c,
>> default_set_tv_freq(): case TUNER_MICROTUNE_4042FI5:
>>                 /* Set the charge pump for fast tuning */
>>                 config |= TUNER_CHARGE_PUMP;
>>
>> And then there is more code a bit later in the same
>> function to poll the PLL and turn the charge pump to low
>> current after it locks.
> 
> You are correct. I was thinking about the code above when I 
> replied to the list. My comments do not apply to the 
> original discussion.
> 
> --Mac
> 
>> ** This is totally different code that was being
>> discussed. **
>>
>> What was being discussed was code in tuner-core.c,
>> set_type().  This code changes the "Aux Byte" that
>> effects the AGC take-over-point.  Totally different than
>> the charge pump current.
>>
>> The set_type() function has never had an existing PLL
>> message to modify. It's called on module load to set the
>> tuner type, not to actually tune to something, so having
>> a message wouldn't even make sense.  What would the
>> message be?
>>
>> There is very very similar code in the dvb-pll version
>> that does the same thing, except it is called via the
>> function that does tuning.  It works correctly because it
>> takes the tuning command and modifies it to set the aux
>> byte.  It does this on every tune, not just on module
>> load.
>>
>> It's clear what happened.  The working dvb code was
>> cut&pasted into the v4l tuner driver, but put in the
>> wrong function, and not adjusted to work properly in this
>> new spot (thus the use of uninitialized data).
>>
>> So, there is some code in the v4l tuner driver that
>> writes a few random bytes to the PLL when the module
>> loads, which doesn't actually do much of anything to the
>> PLL.  Just remove it.  Put something to set the aux byte
>> on every tune call, like the dvb code does, if you want
>> to be totally correct. But it's not necessary, as the
>> tuner has been working fine all this time without it.

I don't have a lot of time to type out a long email explanation right
now, but I think the patch speaks for itself.

This is what I did to rectify the situation, in the case of the LG-H06xF:

http://linuxtv.org/hg/~mkrufky/v4l-dvb?cmd=changeset;node=b67541b1a123

Trent and I were talking about this yesterday, and he had some
interesting ideas about applying this logic to the Thomson DTT761X
tuner, and possibly some others.  I would like to have this patch merged
first, and if we move forward with Trent's idea, we would probably end
up changing this again.

Any comments?

-- 
Michael Krufky


_______________________________________________

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