From cad4a4110faf2672fc6dec4d5ca6c09ccac2e3e2 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Wed, 17 Aug 2005 19:42:11 +0000 Subject: * cx88-dvb.c: (lgdt330x_pll_set): * cx88-video.c: (video_release): * mt20xx.c: (microtune_init): * saa7134-video.c: (video_release): * tda8290.c: (standby), (tda8290_init): * tda9887.c: (tda9887_set_tvnorm), (tda9887_configure), (tda9887_command): * tea5767.c: (set_radio_freq), (tea5767_standby), (tea5767_tuner_init): * tuner-core.c: (set_addr), (check_mode), (set_mode), (tuner_command): * tuner-simple.c: (default_tuner_init): * tuner.h: - New tuner standby API. --- linux/drivers/media/video/tea5767.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'linux/drivers/media/video/tea5767.c') diff --git a/linux/drivers/media/video/tea5767.c b/linux/drivers/media/video/tea5767.c index 4327d50be..a8c23b0a8 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.28 2005/08/01 02:58:21 mchehab Exp $ + * $Id: tea5767.c,v 1.29 2005/08/17 19:42:11 nsh Exp $ * * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) * This code is placed under the terms of the GNU General Public License @@ -206,11 +206,6 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) TEA5767_ST_NOISE_CTL | TEA5767_JAPAN_BAND; buffer[4] = 0; - if (t->mode == T_STANDBY) { - tuner_dbg("TEA5767 set to standby mode\n"); - buffer[3] |= TEA5767_STDBY; - } - if (t->audmode == V4L2_TUNER_MODE_MONO) { tuner_dbg("TEA5767 set to mono\n"); buffer[2] |= TEA5767_MONO; @@ -291,6 +286,24 @@ static int tea5767_stereo(struct i2c_client *c) return ((buffer[2] & TEA5767_STEREO_MASK) ? V4L2_TUNER_SUB_STEREO : 0); } +static void tea5767_standby(struct i2c_client *c) +{ + unsigned char buffer[5]; + struct tuner *t = i2c_get_clientdata(c); + unsigned div, rc; + + div = (87500 * 4 + 700 + 225 + 25) / 50; /* Set frequency to 87.5 MHz */ + buffer[0] = (div >> 8) & 0x3f; + buffer[1] = div & 0xff; + buffer[2] = TEA5767_PORT1_HIGH; + buffer[3] = TEA5767_PORT2_HIGH | TEA5767_HIGH_CUT_CTRL | + TEA5767_ST_NOISE_CTL | TEA5767_JAPAN_BAND | TEA5767_STDBY; + buffer[4] = 0; + + if (5 != (rc = i2c_master_send(c, buffer, 5))) + tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); +} + int tea5767_autodetection(struct i2c_client *c) { unsigned char buffer[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -375,6 +388,7 @@ int tea5767_tuner_init(struct i2c_client *c) t->radio_freq = set_radio_freq; t->has_signal = tea5767_signal; t->is_stereo = tea5767_stereo; + t->standby = tea5767_standby; return (0); } -- cgit v1.2.3