Commit ae7d4c86 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: tuner update

This is a update for the analog tv tuner module, it adds support for two
new tuner chips.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1b46884a
......@@ -129,7 +129,8 @@ struct tunertype
unsigned char config;
unsigned short IFPCoff; /* 622.4=16*38.90 MHz PAL,
732 =16*45.75 NTSCi,
940 =58.75 NTSC-Japan */
940 =16*58.75 NTSC-Japan
704 =16*44 ATSC */
};
/*
......@@ -244,10 +245,14 @@ static struct tunertype tuners[] = {
{ "Panasonic VP27s/ENGE4324D", Panasonic, NTSC,
16*160.00,16*454.00,0x01,0x02,0x08,0xce,940},
{ "LG NTSC (TAPE series)", LGINNOTEK, NTSC,
16*170.00, 16*450.00, 0x01,0x02,0x04,0x8e,732 },
16*160.00,16*442.00,0x01,0x02,0x04,0xc8,732 },
{ "Tenna TNF 8831 BGFF)", Philips, PAL,
16*161.25,16*463.25,0xa0,0x90,0x30,0x8e,623},
{ "Microtune 4042 FI5 ATSC/NTSC dual in", Microtune, NTSC,
16*162.00,16*457.00,0xa2,0x94,0x31,0x8e,732},
{ "TCL 2002N", TCL, NTSC,
16*172.00,16*448.00,0x01,0x02,0x08,0x88,732},
};
#define TUNERS ARRAY_SIZE(tuners)
......@@ -886,8 +891,12 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
config |= 2;
/* FIXME: input */
break;
}
case TUNER_MICROTUNE_4042FI5:
/* Set the charge pump for fast tuning */
tun->config |= 0x40;
break;
}
/*
* Philips FI1216MK2 remark from specification :
......@@ -921,6 +930,37 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
if (4 != (rc = i2c_master_send(c,buffer,4)))
printk("tuner: i2c i/o error: rc == %d (should be 4)\n",rc);
if (t->type == TUNER_MICROTUNE_4042FI5) {
// FIXME - this may also work for other tuners
unsigned long timeout = jiffies + msecs_to_jiffies(1);
u8 status_byte = 0;
/* Wait until the PLL locks */
for (;;) {
if (time_after(jiffies,timeout))
return;
if (1 != (rc = i2c_master_recv(c,&status_byte,1))) {
dprintk("tuner: i2c i/o read error: rc == %d (should be 1)\n",rc);
break;
}
/* bit 6 is PLL locked indicator */
if (status_byte & 0x40)
break;
udelay(10);
}
/* Set the charge pump for optimized phase noise figure */
tun->config &= ~0x40;
buffer[0] = (div>>8) & 0x7f;
buffer[1] = div & 0xff;
buffer[2] = tun->config;
buffer[3] = config;
dprintk("tuner: tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
buffer[0],buffer[1],buffer[2],buffer[3]);
if (4 != (rc = i2c_master_send(c,buffer,4)))
dprintk("tuner: i2c i/o error: rc == %d (should be 4)\n",rc);
}
}
static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
......
/*
tuner.h - definition for different tuners
......@@ -69,9 +70,12 @@
#define TUNER_PHILIPS_ATSC 42
#define TUNER_PHILIPS_FM1236_MK3 43
#define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */
/* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */
#define TUNER_MICROTUNE_4049FM5 45
#define TUNER_LG_NTSC_TAPE 47
#define TUNER_TNF_8831BGFF 48
#define TUNER_MICROTUNE_4042FI5 49 /* FusionHDTV 3 Gold - 4042 FI5 (3X 8147) */
#define TUNER_TCL_2002N 50
#define NOTUNER 0
#define PAL 1 /* PAL_BG */
......@@ -91,6 +95,7 @@
#define Microtune 8
#define HITACHI 9
#define Panasonic 10
#define TCL 11
#define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */
#define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */
......
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