]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] dvb: Misc frontend updates
authorAndrew Morton <akpm@osdl.org>
Thu, 26 Feb 2004 00:22:14 +0000 (16:22 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 26 Feb 2004 00:22:14 +0000 (16:22 -0800)
From: Michael Hunold <hunold@linuxtv.org>

- alps_tdlb7 + alps_tdmb7: Changed to use full i2c reads in probing instead
  of i2c pings to be compatable with ttusb

- nxt6000: bugfix by Robert Cook: FE_RESET did the same as FE_INIT, thus
  invalidating current channel settings on FE_RESET

- sp887x: fixed typo

- Makefile: add nxt6000 frontend driver to Makefiles

- Kconfig: DVB_TDA1004X and DVB_NXT6000 do not depend on !STANDALONE (i.e.
  no compile-time firmware image necessary)

- ves1820: turn off ves1820 test output pins

- ves1820: verbose-print AFC only if carrier has been recovered

- ves1820: change AFC handling as suggested by Robert Schlabbach, use bit 1
  of the SYNC register for FE_HAS_SIGNAL

drivers/media/dvb/frontends/Kconfig
drivers/media/dvb/frontends/Makefile
drivers/media/dvb/frontends/alps_tdlb7.c
drivers/media/dvb/frontends/alps_tdmb7.c
drivers/media/dvb/frontends/nxt6000.c
drivers/media/dvb/frontends/sp887x.c
drivers/media/dvb/frontends/ves1820.c

index 0d0fb617f0e30b7d2f6fa7f666f238f3a791ef86..325e3feebf53e69c90f8328995eb32ae79ac6358 100644 (file)
@@ -154,8 +154,8 @@ config DVB_VES1X93
          right one will get autodetected.
 
 config DVB_TDA1004X
-       tristate "Frontends with external TDA1004X demodulators (OFDM)"
-       depends on DVB_CORE && !STANDALONE
+       tristate "Frontends with external TDA10045H or TDA10046H demodulators (OFDM)"
+       depends on DVB_CORE
        help
          A DVB-T tuner module. Say Y when you want to support this frontend.
 
@@ -173,3 +173,15 @@ config DVB_TDA1004X_FIRMWARE_FILE
             wget http://www.technotrend.de/new/215/TTweb_215a_budget_20_05_2003.zip
             unzip -j TTweb_215a_budget_20_05_2003.zip Software/Oem/PCI/App/ttlcdacc.dll
             mv ttlcdacc.dll /usr/lib/hotplug/firmware/tda1004x.bin
+         Note: even if you're using a USB device, you MUST get the file from the
+         TechnoTrend PCI drivers.
+
+config DVB_NXT6000
+       tristate "Frontends with NxtWave Communications NXT6000 demodulator (OFDM)"
+       depends on DVB_CORE
+       help
+         A DVB-T tuner module. Say Y when you want to support this frontend.
+
+         If you don't know what tuner module is soldered on your
+         DVB adapter simply enable all supported frontends, the
+         right one will get autodetected.
index 7dc59058cf129d49d9c1cfdd929686a62bfa490e..e536b0de7828235d09bf3ff251fbc8ecce26f512 100644 (file)
@@ -17,3 +17,4 @@ obj-$(CONFIG_DVB_VES1820) += ves1820.o
 obj-$(CONFIG_DVB_VES1X93) += ves1x93.o
 obj-$(CONFIG_DVB_TDA1004X) += tda1004x.o
 obj-$(CONFIG_DVB_SP887X) += sp887x.o
+obj-$(CONFIG_DVB_NXT6000) += nxt6000.o
index 5b0c03290c96b66eeafaca6a13cfac51d67b2700..f46f24fef213eff967a5322dcb509ca40e13c7fa 100644 (file)
@@ -665,11 +665,14 @@ static int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
 
 static int tdlb7_attach (struct dvb_i2c_bus *i2c, void **data)
 {
-       struct i2c_msg msg = { addr: 0x71, flags: 0, buf: NULL, len: 0 };
+        u8 b0 [] = { 0x02 , 0x00 };
+        u8 b1 [] = { 0, 0 };
+        struct i2c_msg msg [] = { { addr: 0x71, flags: 0, buf: b0, len: 2 },
+                                  { addr: 0x71, flags: I2C_M_RD, buf: b1, len: 2 } };
 
        dprintk ("%s\n", __FUNCTION__);
 
-       if (i2c->xfer (i2c, &msg, 1) != 1)
+        if (i2c->xfer (i2c, msg, 2) != 2)
                 return -ENODEV;
 
        sp8870_firmware_upload(i2c);
index 072bc89076c9ce89627057d067caa9b04da91e8b..6107c2b5e80f708fc7d24249fd7e7dd9afdc9f39 100644 (file)
@@ -404,11 +404,14 @@ static int tdmb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
 
 static int tdmb7_attach (struct dvb_i2c_bus *i2c, void **data)
 {
-       struct i2c_msg msg = { .addr = 0x43, .flags = 0, .buf = NULL,. len = 0 };
+        u8 b0 [] = { 0x7 };
+        u8 b1 [] = { 0 };
+        struct i2c_msg msg [] = { { .addr = 0x43, .flags = 0, .buf = b0, .len = 1 },
+                                  { .addr = 0x43, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
 
        dprintk ("%s\n", __FUNCTION__);
 
-       if (i2c->xfer (i2c, &msg, 1) != 1)
+        if (i2c->xfer (i2c, msg, 2) != 2)
                 return -ENODEV;
 
        return dvb_register_frontend (tdmb7_ioctl, i2c, NULL, &tdmb7_info);
index db739c8b5e8fdf615f80eed023f71d0fe4c71329..14e9cfe2f1d6dfc16be57b763269e6646ee3646c 100644 (file)
@@ -758,11 +758,11 @@ static int nxt6000_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
                }
        
                case FE_INIT:
-               case FE_RESET:
-               
                        nxt6000_reset(fe);
                        nxt6000_setup(fe);
+               break;
 
+       case FE_RESET:
                        break;
                
                case FE_SET_FRONTEND:
index 0610bd3d2ee2cb2712aaf0eba507b0aab117feb2..12c6ccd99458a935ca41c07f866f8d11d45314e5 100644 (file)
@@ -58,7 +58,7 @@ static char *sp887x_firmware = DVB_SP887X_FIRMWARE_FILE;
 
 static
 struct dvb_frontend_info sp887x_info = {
-       .name = "Microtune MT7072DTF",
+       .name = "Microtune MT7202DTF",
        .type = FE_OFDM,
        .frequency_min =  50500000,
        .frequency_max = 858000000,
index bdd84c055a88cb0d2808dbaf634c290992ca35c9..1652be9d316779a7dfa4cc2c9362fa9c7c485077 100644 (file)
@@ -120,7 +120,7 @@ static struct dvb_frontend_info ves1820_info = {
 static u8 ves1820_inittab [] =
 {
        0x69, 0x6A, 0x9B, 0x12, 0x12, 0x46, 0x26, 0x1A,
-       0x43, 0x6A, 0xAA, 0xAA, 0x1E, 0x85, 0x43, 0x28,
+       0x43, 0x6A, 0xAA, 0xAA, 0x1E, 0x85, 0x43, 0x20,
        0xE0, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -380,7 +380,7 @@ static int ves1820_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
 
                 sync = ves1820_readreg (fe, 0x11);
 
-               if (sync & 2)
+               if (sync & 1)
                        *status |= FE_HAS_SIGNAL;
 
                if (sync & 2)
@@ -440,13 +440,14 @@ static int ves1820_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
                s8 afc = 0;
                 
                 sync = ves1820_readreg (fe, 0x11);
-               if (sync & 2)
-                       /* AFC only valid when carrier has been recovered */
                        afc = ves1820_readreg(fe, 0x19);
-               if (verbose)
-                       printk ("DVB: VES1820(%d): AFC (%d) %dHz\n",
+               if (verbose) {
+                       /* AFC only valid when carrier has been recovered */
+                       printk(sync & 2 ? "DVB: VES1820(%d): AFC (%d) %dHz\n" :
+                                         "DVB: VES1820(%d): [AFC (%d) %dHz]\n",
                                        fe->i2c->adapter->num, afc,
-                               -((s32)(p->u.qam.symbol_rate >> 3) * afc >> 7));
+                              -((s32)p->u.qam.symbol_rate * afc) >> 10);
+               }
 
                p->inversion = HAS_INVERSION(reg0) ? INVERSION_ON : INVERSION_OFF;
                p->u.qam.modulation = ((reg0 >> 2) & 7) + QAM_16;
@@ -454,9 +455,8 @@ static int ves1820_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
                p->u.qam.fec_inner = FEC_NONE;
 
                p->frequency = ((p->frequency + 31250) / 62500) * 62500;
-               /* To prevent overflow, shift symbol rate first a
-                  couple of bits. */
-               p->frequency -= (s32)(p->u.qam.symbol_rate >> 3) * afc >> 7;
+               if (sync & 2)
+                       p->frequency -= ((s32)p->u.qam.symbol_rate * afc) >> 10;
                break;
        }
        case FE_SLEEP: