diff options
-rw-r--r-- | linux/drivers/media/video/tea5767.c | 31 | ||||
-rw-r--r-- | v4l/ChangeLog | 10 |
2 files changed, 31 insertions, 10 deletions
diff --git a/linux/drivers/media/video/tea5767.c b/linux/drivers/media/video/tea5767.c index 7e68f1cd8..ae60613f9 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.2 2005/06/06 04:54:42 mchehab Exp $ + * $Id: tea5767.c,v 1.3 2005/06/07 02:45:36 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 @@ -135,6 +135,18 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq) tuner_warn("This tuner doesn't support TV freq.\n"); } +/* Closest value table */ +/* int radio_frq[16]={ 0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18 }; */ +/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ + +/* radio adjust freq for odd channel frequencies used in US, Brazil, ... */ +int radio_frq[16]={ 0, 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19 }; +/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ + +/* radio adjust freq for even channel frequencies */ +/* int radio_frq[16]={ 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 19 }; */ +/ * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ + static void set_radio_freq(struct i2c_client *c, unsigned int frq) { struct tuner *t = i2c_get_clientdata(c); @@ -142,29 +154,31 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) unsigned div; int rc; + /* Rounds freq to next decimal value */ + 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[4]=0; switch (t->type) { - case TEA5767_HIGH_LO_13MHz: tuner_dbg("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); buffer[2] |= TEA5767_HIGH_LO_INJECT; buffer[4] |= TEA5767_PLLREF_ENABLE; - div = (frq*4000/16+225+25)/50; + div = (frq*4000/20+225+25)/50; break; case TEA5767_LOW_LO_13MHz: tuner_dbg("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); buffer[4] |= TEA5767_PLLREF_ENABLE; - div = (frq*4000/16-225+25)/50; + div = (frq*4000/20-225+25)/50; break; case TEA5767_LOW_LO_32768: tuner_dbg("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); - buffer[3] |= TEA5767_XTAL_32768; - div = (1000*(frq*4000/16+225)+16384)/32768; + /* const 700=4000*175 Khz - to adjust freq to right value */ + div = (1000*(frq*4000/20-700-225)+16384)>>15; break; case TEA5767_HIGH_LO_32768: default: @@ -172,7 +186,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/16+225)+16384)/32768; + div = (1000*(frq*4000/20+225)+16384)/32768; break; } buffer[0] = (div>>8) & 0x3f; @@ -265,8 +279,7 @@ int tea5767_tuner_init(struct i2c_client *c) /*************************************************************************** HACKING FOR TESTING PURPOSES ONLY. Should have an option to configure ***************************************************************************/ - t->type= TEA5767_HIGH_LO_32768; -// t->type= TEA5767_LOW_LO_32768; + t->type= TEA5767_LOW_LO_32768; strlcpy(c->name, "TEA5767", sizeof("TEA5767")); tuner_info("type set to TEA5797\n"); diff --git a/v4l/ChangeLog b/v4l/ChangeLog index d90d195a2..8dd947a3f 100644 --- a/v4l/ChangeLog +++ b/v4l/ChangeLog @@ -1,3 +1,11 @@ +2005-06-06 02:40 mchehab + * tea5767.c: + - Frequency select now is correct for TEA5767_LOW_LO_32768 on + PV Ultra Pro + - Frequency is multiple of 62,5 Khz instead of 50Khz. This patch + provides a table to increment at 50Khz + - there are an odd table and an even table + 2005-06-06 05:05 mchehab * doc/V4L2_API.html: - Included V4L2 API from http://v4l2spec.bytesex.org @@ -1186,7 +1194,7 @@ saa7134-reg.h, saa7134-ts.c, saa7134-tvaudio.c, saa7134-vbi.c, saa7134-video.c, saa7134.h, video-buf.c, video-buf.h: - - added a bunch of $Id: ChangeLog,v 1.24 2005/06/06 05:06:27 mchehab Exp $ tags. + - added a bunch of $Id: ChangeLog,v 1.25 2005/06/07 02:45:36 mchehab Exp $ tags. 2004-09-15 17:35 kraxel |