Mailing List archive

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

[linux-dvb] Re: Twinhan DST VP-1020



On Thu, Sep 18, 2003 at 06:38:13PM +0200, Ralph Metzler wrote:
> Jamie Honan writes:
>  > There are a number of bugs in the code given by twinhan, which
>  > caused me no end of problems. Specifically the I2C read could
>  > never have worked.
> 
> >From which code by twinhan did you get that?

The stuff under the label "Linux 20020327" on the xusa
web site. The module labelled twinhan2.4.7-10.o

> According to what I found in the binary driver, they write
> 0xab0000a7 for the first byte, 0xab0000b7 for the following
> and 0xab000093 for the last byte into the I2C register.
> Except for the stop at the end this is the same you use now.

I must have decoded incorrectly.

I got:
   for (i = 1; i < 9; i++) {
        cmd = 0xab0000a7;
        if(i == 8) {
            cmd = 0xab000083;
   ....

The missing stop at the end is my bad.

Also I have the following anomolies:

    no checking RACK on read (which I have duplicated until now)
    (actually RACK is not checked on write except under failure)

    disabling output on GPIO 0 also disables output on 1, which
    looks wrong if it was signaling the 8820.

I've duplicated this for now.

The tuning info returned from the asic is not very satisfactory.
I only just worked this out last night. If the first two bytes
are zero, then it hasn't tuned. Then to decode the returned packet
I get:

convertTunerData(u8 *A10, program *retpval, unsigned *lnb, progam *inpval)
{
unsigned long long llval;
    word = iword = A10[5] + A10[4] << 8;
    if(word < 0) {
        word = word + 15;
    }
    retpval->sym = (word >> 4) + ((A10[6] * 21484 * iword) >> 8);
    ecx = 1000000 * (((V10[1] & 0x7f) << 8) + V10[2]);
    llval = (long long)ecx * 1125899907;
    retpval->freq = (llval >> 50) - (ecx >> 31);
    ... other junk deleted
}

The weird thing is, the frequency stuff seems to me to be no more
than a convoluted way of doing:

    freq =  (((V10[1] & 0x7f) << 8) + V10[2]);


Jamie


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



Home | Main Index | Thread Index