V4L/DVB (9468): Miscellaneous fixes
authorReinhard Nissl <rnissl@gmx.de>
Wed, 9 Jul 2008 18:38:27 +0000 (15:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:24 +0000 (17:53 -0200)
 - Fix a bitfield
 - Set gain appropriately
 - Slept for the wrong duration

Signed-off-by: Reinhard Nissl <rnissl@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/stb0899_reg.h
drivers/media/dvb/frontends/stb6100.c

index 4e5b2415847fc159cc0da5dfc43d2bc38597f0e4..ba1ed56304a0f4e0d7134f7db7a75daee589d7b2 100644 (file)
 
 #define STB0899_OFF0_CRL_FREQ                  0xf304
 #define STB0899_BASE_CRL_FREQ                  0x00000000
-#define STB0899_CARR_FREQ                      (0x1fffffff << 0)
+#define STB0899_CARR_FREQ                      (0x3fffffff << 0)
 #define STB0899_OFFST_CARR_FREQ                        0
 #define STB0899_WIDTH_CARR_FREQ                        30
 
index f404a4d0fb17241a54401f5d8914e06ea7a86ac0..083d6b6271894d7e5204d213907d2fa6c139d327 100644 (file)
@@ -338,11 +338,11 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
 
        /* Baseband gain.       */
        if (srate >= 15000000)
-               g = 8;
-       else if (state->srate >= 5000000)
-               g = 12;
+               g = 9;  //  +4 dB
+       else if (srate >= 5000000)
+               g = 11; //  +8 dB
        else
-               g = 14;
+               g = 14; // +14 dB
 
        regs[STB6100_G] = (regs[STB6100_G] & ~STB6100_G_G) | g;
        regs[STB6100_G] &= ~STB6100_G_GCT; /* mask GCT */
@@ -403,7 +403,7 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
        if ((rc = stb6100_write_reg(state, STB6100_VCO, regs[STB6100_VCO])) < 0)
                return rc;
 
-       msleep(5);                                      /* wait for LO to lock          */
+       msleep(10);                                     /* wait for LO to lock          */
        regs[STB6100_VCO] &= ~STB6100_VCO_OSCH;         /* vco search disabled          */
        regs[STB6100_VCO] |= STB6100_VCO_OCK;           /* search clock off             */
        if ((rc = stb6100_write_reg(state, STB6100_VCO, regs[STB6100_VCO])) < 0)