summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tea5767.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-06-08 01:28:09 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-06-08 01:28:09 +0000
commitb32a9aff0d1360cb3beb9e3c0f91c84f39b95679 (patch)
tree94b7baa93e855b05f735a89b6ff45e7035833067 /linux/drivers/media/video/tea5767.c
parent874f203c1669f752eeb477bf980cb060b135dc13 (diff)
downloadmediapointer-dvb-s2-b32a9aff0d1360cb3beb9e3c0f91c84f39b95679.tar.gz
mediapointer-dvb-s2-b32a9aff0d1360cb3beb9e3c0f91c84f39b95679.tar.bz2
Lots of change to provide an elegant way to select radio I2C address.
It should be better tested and expanded to other *-cards.c. * cx88-cards.c, cx88-core.c, cx88-i2c.c, cx88-video.c, cx88.h, tea5767.c, tuner-core.c, tuner-simple.c, tuner.h: - Improved radio tuner support. - There is a new option to cx88 radio=xxx,xxx,xxx for radio adapters; - cx88-boards now specifies radio_type, tuner_addr and radio_addr - ADDR_UNSET macro means find default radio/video tuner
Diffstat (limited to 'linux/drivers/media/video/tea5767.c')
-rw-r--r--linux/drivers/media/video/tea5767.c38
1 files changed, 9 insertions, 29 deletions
diff --git a/linux/drivers/media/video/tea5767.c b/linux/drivers/media/video/tea5767.c
index 94b69fb43..3539babce 100644
--- a/linux/drivers/media/video/tea5767.c
+++ b/linux/drivers/media/video/tea5767.c
@@ -2,7 +2,7 @@
* For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview
* I2C address is allways 0xC0.
*
- * $Id: tea5767.c,v 1.4 2005/06/07 18:02:26 nsh Exp $
+ * $Id: tea5767.c,v 1.5 2005/06/08 01:28:09 mchehab Exp $
*
* Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br)
* This code is placed under the terms of the GNU General Public License
@@ -120,14 +120,6 @@
#define TEA5767_RESERVED_MASK 0xff
-enum v4l_radio_tuner {
- RADIO_TUNER_UNSET = 0,
- TEA5767_HIGH_LO_32768 = 1,
- TEA5767_LOW_LO_32768 = 2,
- TEA5767_HIGH_LO_13MHz = 3,
- TEA5767_LOW_LO_13MHz = 4,
-};
-
static void set_tv_freq(struct i2c_client *c, unsigned int freq)
{
struct tuner *t = i2c_get_clientdata(c);
@@ -158,7 +150,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq)
frq = 20*(frq/16)+radio_frq[frq%16];
buffer[2] = TEA5767_PORT1_HIGH;
- buffer[3] = TEA5767_PORT2_HIGH | TEA5767_HIGH_CUT_CTRL | TEA5767_ST_NOISE_CTL;
+ buffer[3] = TEA5767_PORT2_HIGH | TEA5767_HIGH_CUT_CTRL | TEA5767_ST_NOISE_CTL | TEA5767_JAPAN_BAND;
buffer[4]=0;
switch (t->type) {
@@ -186,7 +178,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq)
buffer[2] |= TEA5767_HIGH_LO_INJECT;
buffer[3] |= TEA5767_XTAL_32768;
- div = (1000*(frq*4000/20+225)+16384)/32768;
+ div = (1000*(frq*4000/20+700+225)+16384)/32768;
break;
}
buffer[0] = (div>>8) & 0x3f;
@@ -271,28 +263,16 @@ static int tea5767_stereo(struct i2c_client *c)
int tea5767_tuner_init(struct i2c_client *c)
{
- /* TEA5767 is always on 0xC0, according with Philips datasheet */
- struct tuner_addr tun_addr = { V4L2_TUNER_RADIO, 0xc0>>1 };
-
struct tuner *t = i2c_get_clientdata(c);
- /***************************************************************************
- HACKING FOR TESTING PURPOSES ONLY. Should have an option to configure
- ***************************************************************************/
- t->type= TEA5767_LOW_LO_32768;
- strlcpy(c->name, "TEA5767", sizeof("TEA5767"));
- tuner_info("type set to TEA5797\n");
-
- if (c->driver->command) {
- c->driver->command(c, TUNER_SET_ADDR, &tun_addr);
- } else {
- tuner_warn("TAE5797 Couldn't set Radio tuner I2C address to 0xc0\n");
- return -1;
- }
-
+ tuner_info("type set to %d (%s)\n",
+ t->type, TEA5767_TUNER_NAME);
+ strlcpy(c->name, TEA5767_TUNER_NAME, sizeof(c->name));
+
t->tv_freq = set_tv_freq;
t->radio_freq = set_radio_freq;
t->has_signal = tea5767_signal;
t->is_stereo = tea5767_stereo;
- return 0;
+
+ return (0);
}