summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/frontends/Makefile2
-rw-r--r--drivers/media/dvb/frontends/tda18271-fe.c (renamed from drivers/media/dvb/frontends/tda18271.c)305
-rw-r--r--drivers/media/dvb/frontends/tda18271-priv.h96
-rw-r--r--drivers/media/dvb/frontends/tda18271-tables.c253
4 files changed, 362 insertions, 294 deletions
diff --git a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile
index 57e5fa80589b..784565208fb4 100644
--- a/drivers/media/dvb/frontends/Makefile
+++ b/drivers/media/dvb/frontends/Makefile
@@ -5,6 +5,8 @@
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/
EXTRA_CFLAGS += -Idrivers/media/video/
+tda18271-objs := tda18271-tables.o tda18271-fe.o
+
obj-$(CONFIG_DVB_PLL) += dvb-pll.o
obj-$(CONFIG_DVB_STV0299) += stv0299.o
obj-$(CONFIG_DVB_SP8870) += sp8870.o
diff --git a/drivers/media/dvb/frontends/tda18271.c b/drivers/media/dvb/frontends/tda18271-fe.c
index ad72ff69ce92..ba980cf5811b 100644
--- a/drivers/media/dvb/frontends/tda18271.c
+++ b/drivers/media/dvb/frontends/tda18271-fe.c
@@ -1,5 +1,5 @@
/*
- tda18271.c - driver for the Philips / NXP TDA18271 silicon tuner
+ tda18271-fe.c - driver for the Philips / NXP TDA18271 silicon tuner
Copyright (C) 2007 Michael Krufky (mkrufky@linuxtv.org)
@@ -18,12 +18,12 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/videodev2.h>
#include "tuner-driver.h"
#include "tda18271.h"
+#include "tda18271-priv.h"
static int debug;
module_param(debug, int, 0644);
@@ -33,285 +33,8 @@ MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
if (debug >= level) \
printk(KERN_DEBUG "%s: " fmt, __FUNCTION__, ##arg); } while (0)
-#define R_ID 0x00 /* ID byte */
-#define R_TM 0x01 /* Thermo byte */
-#define R_PL 0x02 /* Power level byte */
-#define R_EP1 0x03 /* Easy Prog byte 1 */
-#define R_EP2 0x04 /* Easy Prog byte 2 */
-#define R_EP3 0x05 /* Easy Prog byte 3 */
-#define R_EP4 0x06 /* Easy Prog byte 4 */
-#define R_EP5 0x07 /* Easy Prog byte 5 */
-#define R_CPD 0x08 /* Cal Post-Divider byte */
-#define R_CD1 0x09 /* Cal Divider byte 1 */
-#define R_CD2 0x0a /* Cal Divider byte 2 */
-#define R_CD3 0x0b /* Cal Divider byte 3 */
-#define R_MPD 0x0c /* Main Post-Divider byte */
-#define R_MD1 0x0d /* Main Divider byte 1 */
-#define R_MD2 0x0e /* Main Divider byte 2 */
-#define R_MD3 0x0f /* Main Divider byte 3 */
-#define R_EB1 0x10 /* Extended byte 1 */
-#define R_EB2 0x11 /* Extended byte 2 */
-#define R_EB3 0x12 /* Extended byte 3 */
-#define R_EB4 0x13 /* Extended byte 4 */
-#define R_EB5 0x14 /* Extended byte 5 */
-#define R_EB6 0x15 /* Extended byte 6 */
-#define R_EB7 0x16 /* Extended byte 7 */
-#define R_EB8 0x17 /* Extended byte 8 */
-#define R_EB9 0x18 /* Extended byte 9 */
-#define R_EB10 0x19 /* Extended byte 10 */
-#define R_EB11 0x1a /* Extended byte 11 */
-#define R_EB12 0x1b /* Extended byte 12 */
-#define R_EB13 0x1c /* Extended byte 13 */
-#define R_EB14 0x1d /* Extended byte 14 */
-#define R_EB15 0x1e /* Extended byte 15 */
-#define R_EB16 0x1f /* Extended byte 16 */
-#define R_EB17 0x20 /* Extended byte 17 */
-#define R_EB18 0x21 /* Extended byte 18 */
-#define R_EB19 0x22 /* Extended byte 19 */
-#define R_EB20 0x23 /* Extended byte 20 */
-#define R_EB21 0x24 /* Extended byte 21 */
-#define R_EB22 0x25 /* Extended byte 22 */
-#define R_EB23 0x26 /* Extended byte 23 */
-
-struct tda18271_pll_map {
- u32 lomax;
- u8 pd; /* post div */
- u8 d; /* div */
-};
-
-static struct tda18271_pll_map tda18271_main_pll[] = {
- { .lomax = 32000, .pd = 0x5f, .d = 0xf0 },
- { .lomax = 35000, .pd = 0x5e, .d = 0xe0 },
- { .lomax = 37000, .pd = 0x5d, .d = 0xd0 },
- { .lomax = 41000, .pd = 0x5c, .d = 0xc0 },
- { .lomax = 44000, .pd = 0x5b, .d = 0xb0 },
- { .lomax = 49000, .pd = 0x5a, .d = 0xa0 },
- { .lomax = 54000, .pd = 0x59, .d = 0x90 },
- { .lomax = 61000, .pd = 0x58, .d = 0x80 },
- { .lomax = 65000, .pd = 0x4f, .d = 0x78 },
- { .lomax = 70000, .pd = 0x4e, .d = 0x70 },
- { .lomax = 75000, .pd = 0x4d, .d = 0x68 },
- { .lomax = 82000, .pd = 0x4c, .d = 0x60 },
- { .lomax = 89000, .pd = 0x4b, .d = 0x58 },
- { .lomax = 98000, .pd = 0x4a, .d = 0x50 },
- { .lomax = 109000, .pd = 0x49, .d = 0x48 },
- { .lomax = 123000, .pd = 0x48, .d = 0x40 },
- { .lomax = 131000, .pd = 0x3f, .d = 0x3c },
- { .lomax = 141000, .pd = 0x3e, .d = 0x38 },
- { .lomax = 151000, .pd = 0x3d, .d = 0x34 },
- { .lomax = 164000, .pd = 0x3c, .d = 0x30 },
- { .lomax = 179000, .pd = 0x3b, .d = 0x2c },
- { .lomax = 197000, .pd = 0x3a, .d = 0x28 },
- { .lomax = 219000, .pd = 0x39, .d = 0x24 },
- { .lomax = 246000, .pd = 0x38, .d = 0x20 },
- { .lomax = 263000, .pd = 0x2f, .d = 0x1e },
- { .lomax = 282000, .pd = 0x2e, .d = 0x1c },
- { .lomax = 303000, .pd = 0x2d, .d = 0x1a },
- { .lomax = 329000, .pd = 0x2c, .d = 0x18 },
- { .lomax = 359000, .pd = 0x2b, .d = 0x16 },
- { .lomax = 395000, .pd = 0x2a, .d = 0x14 },
- { .lomax = 438000, .pd = 0x29, .d = 0x12 },
- { .lomax = 493000, .pd = 0x28, .d = 0x10 },
- { .lomax = 526000, .pd = 0x1f, .d = 0x0f },
- { .lomax = 564000, .pd = 0x1e, .d = 0x0e },
- { .lomax = 607000, .pd = 0x1d, .d = 0x0d },
- { .lomax = 658000, .pd = 0x1c, .d = 0x0c },
- { .lomax = 718000, .pd = 0x1b, .d = 0x0b },
- { .lomax = 790000, .pd = 0x1a, .d = 0x0a },
- { .lomax = 877000, .pd = 0x19, .d = 0x09 },
- { .lomax = 987000, .pd = 0x18, .d = 0x08 },
- { .lomax = 0, .pd = 0x00, .d = 0x00 }, /* end */
-};
-
-static struct tda18271_pll_map tda18271_cal_pll[] = {
- { .lomax = 33000, .pd = 0xdd, .d = 0xd0 },
- { .lomax = 36000, .pd = 0xdc, .d = 0xc0 },
- { .lomax = 40000, .pd = 0xdb, .d = 0xb0 },
- { .lomax = 44000, .pd = 0xda, .d = 0xa0 },
- { .lomax = 49000, .pd = 0xd9, .d = 0x90 },
- { .lomax = 55000, .pd = 0xd8, .d = 0x80 },
- { .lomax = 63000, .pd = 0xd3, .d = 0x70 },
- { .lomax = 67000, .pd = 0xcd, .d = 0x68 },
- { .lomax = 73000, .pd = 0xcc, .d = 0x60 },
- { .lomax = 80000, .pd = 0xcb, .d = 0x58 },
- { .lomax = 88000, .pd = 0xca, .d = 0x50 },
- { .lomax = 98000, .pd = 0xc9, .d = 0x48 },
- { .lomax = 110000, .pd = 0xc8, .d = 0x40 },
- { .lomax = 126000, .pd = 0xc3, .d = 0x38 },
- { .lomax = 135000, .pd = 0xbd, .d = 0x34 },
- { .lomax = 147000, .pd = 0xbc, .d = 0x30 },
- { .lomax = 160000, .pd = 0xbb, .d = 0x2c },
- { .lomax = 176000, .pd = 0xba, .d = 0x28 },
- { .lomax = 196000, .pd = 0xb9, .d = 0x24 },
- { .lomax = 220000, .pd = 0xb8, .d = 0x20 },
- { .lomax = 252000, .pd = 0xb3, .d = 0x1c },
- { .lomax = 271000, .pd = 0xad, .d = 0x1a },
- { .lomax = 294000, .pd = 0xac, .d = 0x18 },
- { .lomax = 321000, .pd = 0xab, .d = 0x16 },
- { .lomax = 353000, .pd = 0xaa, .d = 0x14 },
- { .lomax = 392000, .pd = 0xa9, .d = 0x12 },
- { .lomax = 441000, .pd = 0xa8, .d = 0x10 },
- { .lomax = 505000, .pd = 0xa3, .d = 0x0e },
- { .lomax = 543000, .pd = 0x9d, .d = 0x0d },
- { .lomax = 589000, .pd = 0x9c, .d = 0x0c },
- { .lomax = 642000, .pd = 0x9b, .d = 0x0b },
- { .lomax = 707000, .pd = 0x9a, .d = 0x0a },
- { .lomax = 785000, .pd = 0x99, .d = 0x09 },
- { .lomax = 883000, .pd = 0x98, .d = 0x08 },
- { .lomax = 1010000, .pd = 0x93, .d = 0x07 },
- { .lomax = 0, .pd = 0x00, .d = 0x00 }, /* end */
-};
-
-struct tda18271_map {
- u32 rfmax;
- u8 val;
-};
-
-static struct tda18271_map tda18271_bp_filter[] = {
- { .rfmax = 62000, .val = 0x00 },
- { .rfmax = 84000, .val = 0x01 },
- { .rfmax = 100000, .val = 0x02 },
- { .rfmax = 140000, .val = 0x03 },
- { .rfmax = 170000, .val = 0x04 },
- { .rfmax = 180000, .val = 0x05 },
- { .rfmax = 865000, .val = 0x06 },
- { .rfmax = 0, .val = 0x00 }, /* end */
-};
-
-static struct tda18271_map tda18271_km[] = {
- { .rfmax = 61100, .val = 0x74 },
- { .rfmax = 350000, .val = 0x40 },
- { .rfmax = 720000, .val = 0x30 },
- { .rfmax = 865000, .val = 0x40 },
- { .rfmax = 0, .val = 0x00 }, /* end */
-};
-
-static struct tda18271_map tda18271_rf_band[] = {
- { .rfmax = 47900, .val = 0x00 },
- { .rfmax = 61100, .val = 0x01 },
-/* { .rfmax = 152600, .val = 0x02 }, */
- { .rfmax = 121200, .val = 0x02 },
- { .rfmax = 164700, .val = 0x03 },
- { .rfmax = 203500, .val = 0x04 },
- { .rfmax = 457800, .val = 0x05 },
- { .rfmax = 865000, .val = 0x06 },
- { .rfmax = 0, .val = 0x00 }, /* end */
-};
-
-static struct tda18271_map tda18271_gain_taper[] = {
- { .rfmax = 45400, .val = 0x1f },
- { .rfmax = 45800, .val = 0x1e },
- { .rfmax = 46200, .val = 0x1d },
- { .rfmax = 46700, .val = 0x1c },
- { .rfmax = 47100, .val = 0x1b },
- { .rfmax = 47500, .val = 0x1a },
- { .rfmax = 47900, .val = 0x19 },
- { .rfmax = 49600, .val = 0x17 },
- { .rfmax = 51200, .val = 0x16 },
- { .rfmax = 52900, .val = 0x15 },
- { .rfmax = 54500, .val = 0x14 },
- { .rfmax = 56200, .val = 0x13 },
- { .rfmax = 57800, .val = 0x12 },
- { .rfmax = 59500, .val = 0x11 },
- { .rfmax = 61100, .val = 0x10 },
- { .rfmax = 67600, .val = 0x0d },
- { .rfmax = 74200, .val = 0x0c },
- { .rfmax = 80700, .val = 0x0b },
- { .rfmax = 87200, .val = 0x0a },
- { .rfmax = 93800, .val = 0x09 },
- { .rfmax = 100300, .val = 0x08 },
- { .rfmax = 106900, .val = 0x07 },
- { .rfmax = 113400, .val = 0x06 },
- { .rfmax = 119900, .val = 0x05 },
- { .rfmax = 126500, .val = 0x04 },
- { .rfmax = 133000, .val = 0x03 },
- { .rfmax = 139500, .val = 0x02 },
- { .rfmax = 146100, .val = 0x01 },
- { .rfmax = 152600, .val = 0x00 },
- { .rfmax = 154300, .val = 0x1f },
- { .rfmax = 156100, .val = 0x1e },
- { .rfmax = 157800, .val = 0x1d },
- { .rfmax = 159500, .val = 0x1c },
- { .rfmax = 161200, .val = 0x1b },
- { .rfmax = 163000, .val = 0x1a },
- { .rfmax = 164700, .val = 0x19 },
- { .rfmax = 170200, .val = 0x17 },
- { .rfmax = 175800, .val = 0x16 },
- { .rfmax = 181300, .val = 0x15 },
- { .rfmax = 186900, .val = 0x14 },
- { .rfmax = 192400, .val = 0x13 },
- { .rfmax = 198000, .val = 0x12 },
- { .rfmax = 203500, .val = 0x11 },
- { .rfmax = 216200, .val = 0x14 },
- { .rfmax = 228900, .val = 0x13 },
- { .rfmax = 241600, .val = 0x12 },
- { .rfmax = 254400, .val = 0x11 },
- { .rfmax = 267100, .val = 0x10 },
- { .rfmax = 279800, .val = 0x0f },
- { .rfmax = 292500, .val = 0x0e },
- { .rfmax = 305200, .val = 0x0d },
- { .rfmax = 317900, .val = 0x0c },
- { .rfmax = 330700, .val = 0x0b },
- { .rfmax = 343400, .val = 0x0a },
- { .rfmax = 356100, .val = 0x09 },
- { .rfmax = 368800, .val = 0x08 },
- { .rfmax = 381500, .val = 0x07 },
- { .rfmax = 394200, .val = 0x06 },
- { .rfmax = 406900, .val = 0x05 },
- { .rfmax = 419700, .val = 0x04 },
- { .rfmax = 432400, .val = 0x03 },
- { .rfmax = 445100, .val = 0x02 },
- { .rfmax = 457800, .val = 0x01 },
- { .rfmax = 476300, .val = 0x19 },
- { .rfmax = 494800, .val = 0x18 },
- { .rfmax = 513300, .val = 0x17 },
- { .rfmax = 531800, .val = 0x16 },
- { .rfmax = 550300, .val = 0x15 },
- { .rfmax = 568900, .val = 0x14 },
- { .rfmax = 587400, .val = 0x13 },
- { .rfmax = 605900, .val = 0x12 },
- { .rfmax = 624400, .val = 0x11 },
- { .rfmax = 642900, .val = 0x10 },
- { .rfmax = 661400, .val = 0x0f },
- { .rfmax = 679900, .val = 0x0e },
- { .rfmax = 698400, .val = 0x0d },
- { .rfmax = 716900, .val = 0x0c },
- { .rfmax = 735400, .val = 0x0b },
- { .rfmax = 753900, .val = 0x0a },
- { .rfmax = 772500, .val = 0x09 },
- { .rfmax = 791000, .val = 0x08 },
- { .rfmax = 809500, .val = 0x07 },
- { .rfmax = 828000, .val = 0x06 },
- { .rfmax = 846500, .val = 0x05 },
- { .rfmax = 865000, .val = 0x04 },
- { .rfmax = 0, .val = 0x00 }, /* end */
-};
-
-static struct tda18271_map tda18271_rf_cal[] = {
- { .rfmax = 41000, .val = 0x1e },
- { .rfmax = 43000, .val = 0x30 },
- { .rfmax = 45000, .val = 0x43 },
- { .rfmax = 46000, .val = 0x4d },
- { .rfmax = 47000, .val = 0x54 },
- { .rfmax = 47900, .val = 0x64 },
- { .rfmax = 49100, .val = 0x20 },
- { .rfmax = 50000, .val = 0x22 },
- { .rfmax = 51000, .val = 0x2a },
- { .rfmax = 53000, .val = 0x32 },
- { .rfmax = 55000, .val = 0x35 },
- { .rfmax = 56000, .val = 0x3c },
- { .rfmax = 57000, .val = 0x3f },
- { .rfmax = 58000, .val = 0x48 },
- { .rfmax = 59000, .val = 0x4d },
- { .rfmax = 60000, .val = 0x58 },
- { .rfmax = 61100, .val = 0x5f },
- { .rfmax = 0, .val = 0x00 }, /* end */
-};
-
/*---------------------------------------------------------------------*/
-#define TDA18271_NUM_REGS 39
-
#define TDA18271_ANALOG 0
#define TDA18271_DIGITAL 1
@@ -395,7 +118,7 @@ static void tda18271_read_regs(struct dvb_frontend *fe)
printk("ERROR: %s: i2c_transfer returned: %d\n",
__FUNCTION__, ret);
- if (debug > 1)
+ if (debug > 2)
tda18271_dump_regs(fe);
}
@@ -823,16 +546,6 @@ static int tda18271_tune(struct dvb_frontend *fe,
/* see table 22 */
regs[R_EP3] |= std;
- /* TO DO: *
- * ================ *
- * FM radio, 0x18 *
- * ATSC 6MHz, 0x1c *
- * DVB-T 6MHz, 0x1c *
- * DVB-T 7MHz, 0x1d *
- * DVB-T 8MHz, 0x1e *
- * QAM 6MHz, 0x1d *
- * QAM 8MHz, 0x1f */
-
regs[R_EP4] &= ~0x03; /* set cal mode to normal */
regs[R_EP4] &= ~0x1c; /* clear if level bits */
@@ -879,6 +592,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
tda18271_write_regs(fe, R_TM, 15);
msleep(5);
+
return 0;
}
@@ -918,16 +632,19 @@ static int tda18271_set_params(struct dvb_frontend *fe,
} else if (fe->ops.info.type == FE_OFDM) {
switch (params->u.ofdm.bandwidth) {
case BANDWIDTH_6_MHZ:
- std = 0x1c;
+ std = 0x1b; /* device-specific (spec says 0x1c) */
bw = 6000000;
+ sgIF = 3300000;
break;
case BANDWIDTH_7_MHZ:
- std = 0x1d;
+ std = 0x19; /* device-specific (spec says 0x1d) */
bw = 7000000;
+ sgIF = 3800000;
break;
case BANDWIDTH_8_MHZ:
- std = 0x1e;
+ std = 0x1a; /* device-specific (spec says 0x1e) */
bw = 8000000;
+ sgIF = 4300000;
break;
default:
printk(KERN_WARNING "%s: bandwidth not set!\n",
@@ -1038,7 +755,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
{
struct tda18271_priv *priv = NULL;
- dprintk(1, "@ 0x%x\n", addr);
+ dprintk(1, "@ %d-%04x\n", i2c_adapter_id(i2c), addr);
priv = kzalloc(sizeof(struct tda18271_priv), GFP_KERNEL);
if (priv == NULL)
return NULL;
diff --git a/drivers/media/dvb/frontends/tda18271-priv.h b/drivers/media/dvb/frontends/tda18271-priv.h
new file mode 100644
index 000000000000..71b4d7963699
--- /dev/null
+++ b/drivers/media/dvb/frontends/tda18271-priv.h
@@ -0,0 +1,96 @@
+/*
+ tda18271-priv.h - private header for the NXP TDA18271 silicon tuner
+
+ Copyright (C) 2007 Michael Krufky (mkrufky@linuxtv.org)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __TDA18271_PRIV_H__
+#define __TDA18271_PRIV_H__
+
+#include <linux/types.h>
+
+#define R_ID 0x00 /* ID byte */
+#define R_TM 0x01 /* Thermo byte */
+#define R_PL 0x02 /* Power level byte */
+#define R_EP1 0x03 /* Easy Prog byte 1 */
+#define R_EP2 0x04 /* Easy Prog byte 2 */
+#define R_EP3 0x05 /* Easy Prog byte 3 */
+#define R_EP4 0x06 /* Easy Prog byte 4 */
+#define R_EP5 0x07 /* Easy Prog byte 5 */
+#define R_CPD 0x08 /* Cal Post-Divider byte */
+#define R_CD1 0x09 /* Cal Divider byte 1 */
+#define R_CD2 0x0a /* Cal Divider byte 2 */
+#define R_CD3 0x0b /* Cal Divider byte 3 */
+#define R_MPD 0x0c /* Main Post-Divider byte */
+#define R_MD1 0x0d /* Main Divider byte 1 */
+#define R_MD2 0x0e /* Main Divider byte 2 */
+#define R_MD3 0x0f /* Main Divider byte 3 */
+#define R_EB1 0x10 /* Extended byte 1 */
+#define R_EB2 0x11 /* Extended byte 2 */
+#define R_EB3 0x12 /* Extended byte 3 */
+#define R_EB4 0x13 /* Extended byte 4 */
+#define R_EB5 0x14 /* Extended byte 5 */
+#define R_EB6 0x15 /* Extended byte 6 */
+#define R_EB7 0x16 /* Extended byte 7 */
+#define R_EB8 0x17 /* Extended byte 8 */
+#define R_EB9 0x18 /* Extended byte 9 */
+#define R_EB10 0x19 /* Extended byte 10 */
+#define R_EB11 0x1a /* Extended byte 11 */
+#define R_EB12 0x1b /* Extended byte 12 */
+#define R_EB13 0x1c /* Extended byte 13 */
+#define R_EB14 0x1d /* Extended byte 14 */
+#define R_EB15 0x1e /* Extended byte 15 */
+#define R_EB16 0x1f /* Extended byte 16 */
+#define R_EB17 0x20 /* Extended byte 17 */
+#define R_EB18 0x21 /* Extended byte 18 */
+#define R_EB19 0x22 /* Extended byte 19 */
+#define R_EB20 0x23 /* Extended byte 20 */
+#define R_EB21 0x24 /* Extended byte 21 */
+#define R_EB22 0x25 /* Extended byte 22 */
+#define R_EB23 0x26 /* Extended byte 23 */
+
+#define TDA18271_NUM_REGS 39
+
+struct tda18271_pll_map {
+ u32 lomax;
+ u8 pd; /* post div */
+ u8 d; /* div */
+};
+
+extern struct tda18271_pll_map tda18271_main_pll[];
+extern struct tda18271_pll_map tda18271_cal_pll[];
+
+struct tda18271_map {
+ u32 rfmax;
+ u8 val;
+};
+
+extern struct tda18271_map tda18271_bp_filter[];
+extern struct tda18271_map tda18271_km[];
+extern struct tda18271_map tda18271_rf_band[];
+extern struct tda18271_map tda18271_gain_taper[];
+extern struct tda18271_map tda18271_rf_cal[];
+
+#endif /* __TDA18271_PRIV_H__ */
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/drivers/media/dvb/frontends/tda18271-tables.c b/drivers/media/dvb/frontends/tda18271-tables.c
new file mode 100644
index 000000000000..a018b5140873
--- /dev/null
+++ b/drivers/media/dvb/frontends/tda18271-tables.c
@@ -0,0 +1,253 @@
+/*
+ tda18271-tables.c - driver for the Philips / NXP TDA18271 silicon tuner
+
+ Copyright (C) 2007 Michael Krufky (mkrufky@linuxtv.org)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "tda18271-priv.h"
+
+struct tda18271_pll_map tda18271_main_pll[] = {
+ { .lomax = 32000, .pd = 0x5f, .d = 0xf0 },
+ { .lomax = 35000, .pd = 0x5e, .d = 0xe0 },
+ { .lomax = 37000, .pd = 0x5d, .d = 0xd0 },
+ { .lomax = 41000, .pd = 0x5c, .d = 0xc0 },
+ { .lomax = 44000, .pd = 0x5b, .d = 0xb0 },
+ { .lomax = 49000, .pd = 0x5a, .d = 0xa0 },
+ { .lomax = 54000, .pd = 0x59, .d = 0x90 },
+ { .lomax = 61000, .pd = 0x58, .d = 0x80 },
+ { .lomax = 65000, .pd = 0x4f, .d = 0x78 },
+ { .lomax = 70000, .pd = 0x4e, .d = 0x70 },
+ { .lomax = 75000, .pd = 0x4d, .d = 0x68 },
+ { .lomax = 82000, .pd = 0x4c, .d = 0x60 },
+ { .lomax = 89000, .pd = 0x4b, .d = 0x58 },
+ { .lomax = 98000, .pd = 0x4a, .d = 0x50 },
+ { .lomax = 109000, .pd = 0x49, .d = 0x48 },
+ { .lomax = 123000, .pd = 0x48, .d = 0x40 },
+ { .lomax = 131000, .pd = 0x3f, .d = 0x3c },
+ { .lomax = 141000, .pd = 0x3e, .d = 0x38 },
+ { .lomax = 151000, .pd = 0x3d, .d = 0x34 },
+ { .lomax = 164000, .pd = 0x3c, .d = 0x30 },
+ { .lomax = 179000, .pd = 0x3b, .d = 0x2c },
+ { .lomax = 197000, .pd = 0x3a, .d = 0x28 },
+ { .lomax = 219000, .pd = 0x39, .d = 0x24 },
+ { .lomax = 246000, .pd = 0x38, .d = 0x20 },
+ { .lomax = 263000, .pd = 0x2f, .d = 0x1e },
+ { .lomax = 282000, .pd = 0x2e, .d = 0x1c },
+ { .lomax = 303000, .pd = 0x2d, .d = 0x1a },
+ { .lomax = 329000, .pd = 0x2c, .d = 0x18 },
+ { .lomax = 359000, .pd = 0x2b, .d = 0x16 },
+ { .lomax = 395000, .pd = 0x2a, .d = 0x14 },
+ { .lomax = 438000, .pd = 0x29, .d = 0x12 },
+ { .lomax = 493000, .pd = 0x28, .d = 0x10 },
+ { .lomax = 526000, .pd = 0x1f, .d = 0x0f },
+ { .lomax = 564000, .pd = 0x1e, .d = 0x0e },
+ { .lomax = 607000, .pd = 0x1d, .d = 0x0d },
+ { .lomax = 658000, .pd = 0x1c, .d = 0x0c },
+ { .lomax = 718000, .pd = 0x1b, .d = 0x0b },
+ { .lomax = 790000, .pd = 0x1a, .d = 0x0a },
+ { .lomax = 877000, .pd = 0x19, .d = 0x09 },
+ { .lomax = 987000, .pd = 0x18, .d = 0x08 },
+ { .lomax = 0, .pd = 0x00, .d = 0x00 }, /* end */
+};
+
+struct tda18271_pll_map tda18271_cal_pll[] = {
+ { .lomax = 33000, .pd = 0xdd, .d = 0xd0 },
+ { .lomax = 36000, .pd = 0xdc, .d = 0xc0 },
+ { .lomax = 40000, .pd = 0xdb, .d = 0xb0 },
+ { .lomax = 44000, .pd = 0xda, .d = 0xa0 },
+ { .lomax = 49000, .pd = 0xd9, .d = 0x90 },
+ { .lomax = 55000, .pd = 0xd8, .d = 0x80 },
+ { .lomax = 63000, .pd = 0xd3, .d = 0x70 },
+ { .lomax = 67000, .pd = 0xcd, .d = 0x68 },
+ { .lomax = 73000, .pd = 0xcc, .d = 0x60 },
+ { .lomax = 80000, .pd = 0xcb, .d = 0x58 },
+ { .lomax = 88000, .pd = 0xca, .d = 0x50 },
+ { .lomax = 98000, .pd = 0xc9, .d = 0x48 },
+ { .lomax = 110000, .pd = 0xc8, .d = 0x40 },
+ { .lomax = 126000, .pd = 0xc3, .d = 0x38 },
+ { .lomax = 135000, .pd = 0xbd, .d = 0x34 },
+ { .lomax = 147000, .pd = 0xbc, .d = 0x30 },
+ { .lomax = 160000, .pd = 0xbb, .d = 0x2c },
+ { .lomax = 176000, .pd = 0xba, .d = 0x28 },
+ { .lomax = 196000, .pd = 0xb9, .d = 0x24 },
+ { .lomax = 220000, .pd = 0xb8, .d = 0x20 },
+ { .lomax = 252000, .pd = 0xb3, .d = 0x1c },
+ { .lomax = 271000, .pd = 0xad, .d = 0x1a },
+ { .lomax = 294000, .pd = 0xac, .d = 0x18 },
+ { .lomax = 321000, .pd = 0xab, .d = 0x16 },
+ { .lomax = 353000, .pd = 0xaa, .d = 0x14 },
+ { .lomax = 392000, .pd = 0xa9, .d = 0x12 },
+ { .lomax = 441000, .pd = 0xa8, .d = 0x10 },
+ { .lomax = 505000, .pd = 0xa3, .d = 0x0e },
+ { .lomax = 543000, .pd = 0x9d, .d = 0x0d },
+ { .lomax = 589000, .pd = 0x9c, .d = 0x0c },
+ { .lomax = 642000, .pd = 0x9b, .d = 0x0b },
+ { .lomax = 707000, .pd = 0x9a, .d = 0x0a },
+ { .lomax = 785000, .pd = 0x99, .d = 0x09 },
+ { .lomax = 883000, .pd = 0x98, .d = 0x08 },
+ { .lomax = 1010000, .pd = 0x93, .d = 0x07 },
+ { .lomax = 0, .pd = 0x00, .d = 0x00 }, /* end */
+};
+
+struct tda18271_map tda18271_bp_filter[] = {
+ { .rfmax = 62000, .val = 0x00 },
+ { .rfmax = 84000, .val = 0x01 },
+ { .rfmax = 100000, .val = 0x02 },
+ { .rfmax = 140000, .val = 0x03 },
+ { .rfmax = 170000, .val = 0x04 },
+ { .rfmax = 180000, .val = 0x05 },
+ { .rfmax = 865000, .val = 0x06 },
+ { .rfmax = 0, .val = 0x00 }, /* end */
+};
+
+struct tda18271_map tda18271_km[] = {
+ { .rfmax = 61100, .val = 0x74 },
+ { .rfmax = 350000, .val = 0x40 },
+ { .rfmax = 720000, .val = 0x30 },
+ { .rfmax = 865000, .val = 0x40 },
+ { .rfmax = 0, .val = 0x00 }, /* end */
+};
+
+struct tda18271_map tda18271_rf_band[] = {
+ { .rfmax = 47900, .val = 0x00 },
+ { .rfmax = 61100, .val = 0x01 },
+/* { .rfmax = 152600, .val = 0x02 }, */
+ { .rfmax = 121200, .val = 0x02 },
+ { .rfmax = 164700, .val = 0x03 },
+ { .rfmax = 203500, .val = 0x04 },
+ { .rfmax = 457800, .val = 0x05 },
+ { .rfmax = 865000, .val = 0x06 },
+ { .rfmax = 0, .val = 0x00 }, /* end */
+};
+
+struct tda18271_map tda18271_gain_taper[] = {
+ { .rfmax = 45400, .val = 0x1f },
+ { .rfmax = 45800, .val = 0x1e },
+ { .rfmax = 46200, .val = 0x1d },
+ { .rfmax = 46700, .val = 0x1c },
+ { .rfmax = 47100, .val = 0x1b },
+ { .rfmax = 47500, .val = 0x1a },
+ { .rfmax = 47900, .val = 0x19 },
+ { .rfmax = 49600, .val = 0x17 },
+ { .rfmax = 51200, .val = 0x16 },
+ { .rfmax = 52900, .val = 0x15 },
+ { .rfmax = 54500, .val = 0x14 },
+ { .rfmax = 56200, .val = 0x13 },
+ { .rfmax = 57800, .val = 0x12 },
+ { .rfmax = 59500, .val = 0x11 },
+ { .rfmax = 61100, .val = 0x10 },
+ { .rfmax = 67600, .val = 0x0d },
+ { .rfmax = 74200, .val = 0x0c },
+ { .rfmax = 80700, .val = 0x0b },
+ { .rfmax = 87200, .val = 0x0a },
+ { .rfmax = 93800, .val = 0x09 },
+ { .rfmax = 100300, .val = 0x08 },
+ { .rfmax = 106900, .val = 0x07 },
+ { .rfmax = 113400, .val = 0x06 },
+ { .rfmax = 119900, .val = 0x05 },
+ { .rfmax = 126500, .val = 0x04 },
+ { .rfmax = 133000, .val = 0x03 },
+ { .rfmax = 139500, .val = 0x02 },
+ { .rfmax = 146100, .val = 0x01 },
+ { .rfmax = 152600, .val = 0x00 },
+ { .rfmax = 154300, .val = 0x1f },
+ { .rfmax = 156100, .val = 0x1e },
+ { .rfmax = 157800, .val = 0x1d },
+ { .rfmax = 159500, .val = 0x1c },
+ { .rfmax = 161200, .val = 0x1b },
+ { .rfmax = 163000, .val = 0x1a },
+ { .rfmax = 164700, .val = 0x19 },
+ { .rfmax = 170200, .val = 0x17 },
+ { .rfmax = 175800, .val = 0x16 },
+ { .rfmax = 181300, .val = 0x15 },
+ { .rfmax = 186900, .val = 0x14 },
+ { .rfmax = 192400, .val = 0x13 },
+ { .rfmax = 198000, .val = 0x12 },
+ { .rfmax = 203500, .val = 0x11 },
+ { .rfmax = 216200, .val = 0x14 },
+ { .rfmax = 228900, .val = 0x13 },
+ { .rfmax = 241600, .val = 0x12 },
+ { .rfmax = 254400, .val = 0x11 },
+ { .rfmax = 267100, .val = 0x10 },
+ { .rfmax = 279800, .val = 0x0f },
+ { .rfmax = 292500, .val = 0x0e },
+ { .rfmax = 305200, .val = 0x0d },
+ { .rfmax = 317900, .val = 0x0c },
+ { .rfmax = 330700, .val = 0x0b },
+ { .rfmax = 343400, .val = 0x0a },
+ { .rfmax = 356100, .val = 0x09 },
+ { .rfmax = 368800, .val = 0x08 },
+ { .rfmax = 381500, .val = 0x07 },
+ { .rfmax = 394200, .val = 0x06 },
+ { .rfmax = 406900, .val = 0x05 },
+ { .rfmax = 419700, .val = 0x04 },
+ { .rfmax = 432400, .val = 0x03 },
+ { .rfmax = 445100, .val = 0x02 },
+ { .rfmax = 457800, .val = 0x01 },
+ { .rfmax = 476300, .val = 0x19 },
+ { .rfmax = 494800, .val = 0x18 },
+ { .rfmax = 513300, .val = 0x17 },
+ { .rfmax = 531800, .val = 0x16 },
+ { .rfmax = 550300, .val = 0x15 },
+ { .rfmax = 568900, .val = 0x14 },
+ { .rfmax = 587400, .val = 0x13 },
+ { .rfmax = 605900, .val = 0x12 },
+ { .rfmax = 624400, .val = 0x11 },
+ { .rfmax = 642900, .val = 0x10 },
+ { .rfmax = 661400, .val = 0x0f },
+ { .rfmax = 679900, .val = 0x0e },
+ { .rfmax = 698400, .val = 0x0d },
+ { .rfmax = 716900, .val = 0x0c },
+ { .rfmax = 735400, .val = 0x0b },
+ { .rfmax = 753900, .val = 0x0a },
+ { .rfmax = 772500, .val = 0x09 },
+ { .rfmax = 791000, .val = 0x08 },
+ { .rfmax = 809500, .val = 0x07 },
+ { .rfmax = 828000, .val = 0x06 },
+ { .rfmax = 846500, .val = 0x05 },
+ { .rfmax = 865000, .val = 0x04 },
+ { .rfmax = 0, .val = 0x00 }, /* end */
+};
+
+struct tda18271_map tda18271_rf_cal[] = {
+ { .rfmax = 41000, .val = 0x1e },
+ { .rfmax = 43000, .val = 0x30 },
+ { .rfmax = 45000, .val = 0x43 },
+ { .rfmax = 46000, .val = 0x4d },
+ { .rfmax = 47000, .val = 0x54 },
+ { .rfmax = 47900, .val = 0x64 },
+ { .rfmax = 49100, .val = 0x20 },
+ { .rfmax = 50000, .val = 0x22 },
+ { .rfmax = 51000, .val = 0x2a },
+ { .rfmax = 53000, .val = 0x32 },
+ { .rfmax = 55000, .val = 0x35 },
+ { .rfmax = 56000, .val = 0x3c },
+ { .rfmax = 57000, .val = 0x3f },
+ { .rfmax = 58000, .val = 0x48 },
+ { .rfmax = 59000, .val = 0x4d },
+ { .rfmax = 60000, .val = 0x58 },
+ { .rfmax = 61100, .val = 0x5f },
+ { .rfmax = 0, .val = 0x00 }, /* end */
+};
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */