Commit 6cff2b97 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] tuner update

Update for the tuner module: add support for a new tuner chip.
Signed-off-by: default avatarGerd Knorr <kraxel@bytesex.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9973261a
......@@ -246,6 +246,7 @@ static void dump_read_message(unsigned char *buf)
printk(PREFIX "read: 0x%2x\n", buf[0]);
printk(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no");
printk(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]);
printk(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low");
printk(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out");
printk(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low");
}
......
/*
* $Id: tuner.c,v 1.29 2004/11/07 13:17:15 kraxel Exp $
* $Id: tuner.c,v 1.31 2004/11/10 11:07:24 kraxel Exp $
*/
#include <linux/module.h>
......@@ -262,6 +262,8 @@ static struct tunertype tuners[] = {
16*162.00,16*457.00,0xa2,0x94,0x31,0x8e,732},
{ "TCL 2002N", TCL, NTSC,
16*172.00,16*448.00,0x01,0x02,0x08,0x8e,732},
{ "Philips PAL/SECAM_D (FM 1256 I-H3)", Philips, PAL,
16*160.00,16*442.00,0x01,0x02,0x04,0x8e,623 },
};
#define TUNERS ARRAY_SIZE(tuners)
......@@ -986,14 +988,18 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
tun=&tuners[t->type];
div = freq + (int)(16*10.7);
buffer[0] = (div>>8) & 0x7f;
buffer[1] = div & 0xff;
buffer[2] = tun->config;
switch (t->type) {
case TUNER_PHILIPS_FM1216ME_MK3:
case TUNER_PHILIPS_FM1236_MK3:
buffer[3] = 0x19;
break;
case TUNER_PHILIPS_FM1256_IH3:
div = (20 * freq)/16 + 333 * 2;
buffer[2] = 0x80;
buffer[3] = 0x19;
break;
case TUNER_LG_PAL_FM:
buffer[3] = 0xa5;
break;
......@@ -1001,6 +1007,8 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
buffer[3] = 0xa4;
break;
}
buffer[0] = (div>>8) & 0x7f;
buffer[1] = div & 0xff;
dprintk("tuner: radio 0x%02x 0x%02x 0x%02x 0x%02x\n",
buffer[0],buffer[1],buffer[2],buffer[3]);
......@@ -1077,7 +1085,7 @@ static void set_type(struct i2c_client *c, unsigned int type, char *source)
{
struct tuner *t = i2c_get_clientdata(c);
if (t->type != UNSET) {
if (t->type != UNSET && t->type != TUNER_ABSENT) {
if (t->type != type)
printk("tuner: type already set to %d, "
"ignoring request for %d\n", t->type, type);
......
......@@ -76,6 +76,7 @@
#define TUNER_TNF_8831BGFF 48
#define TUNER_MICROTUNE_4042FI5 49 /* FusionHDTV 3 Gold - 4042 FI5 (3X 8147) */
#define TUNER_TCL_2002N 50
#define TUNER_PHILIPS_FM1256_IH3 51
#define NOTUNER 0
#define PAL 1 /* PAL_BG */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment