aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tda8290.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tda8290.c')
-rw-r--r--drivers/media/video/tda8290.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index a8b6a8df5109..c65f0c7680a2 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * $Id: tda8290.c,v 1.15 2005/07/08 20:21:33 mchehab Exp $
3 * 2 *
4 * i2c tv tuner chip device driver 3 * i2c tv tuner chip device driver
5 * controls the philips tda8290+75 tuner chip combo. 4 * controls the philips tda8290+75 tuner chip combo.
@@ -9,6 +8,9 @@
9#include <linux/delay.h> 8#include <linux/delay.h>
10#include <media/tuner.h> 9#include <media/tuner.h>
11 10
11#define I2C_ADDR_TDA8290 0x4b
12#define I2C_ADDR_TDA8275 0x61
13
12/* ---------------------------------------------------------------------- */ 14/* ---------------------------------------------------------------------- */
13 15
14struct freq_entry { 16struct freq_entry {
@@ -75,10 +77,12 @@ static unsigned char i2c_init_tda8275[14] = { 0x00, 0x00, 0x00, 0x00,
75static unsigned char i2c_set_VS[2] = { 0x30, 0x6F }; 77static unsigned char i2c_set_VS[2] = { 0x30, 0x6F };
76static unsigned char i2c_set_GP01_CF[2] = { 0x20, 0x0B }; 78static unsigned char i2c_set_GP01_CF[2] = { 0x20, 0x0B };
77static unsigned char i2c_tda8290_reset[2] = { 0x00, 0x00 }; 79static unsigned char i2c_tda8290_reset[2] = { 0x00, 0x00 };
80static unsigned char i2c_tda8290_standby[2] = { 0x00, 0x02 };
78static unsigned char i2c_gainset_off[2] = { 0x28, 0x14 }; 81static unsigned char i2c_gainset_off[2] = { 0x28, 0x14 };
79static unsigned char i2c_gainset_on[2] = { 0x28, 0x54 }; 82static unsigned char i2c_gainset_on[2] = { 0x28, 0x54 };
80static unsigned char i2c_agc3_00[2] = { 0x80, 0x00 }; 83static unsigned char i2c_agc3_00[2] = { 0x80, 0x00 };
81static unsigned char i2c_agc2_BF[2] = { 0x60, 0xBF }; 84static unsigned char i2c_agc2_BF[2] = { 0x60, 0xBF };
85static unsigned char i2c_cb1_D0[2] = { 0x30, 0xD0 };
82static unsigned char i2c_cb1_D2[2] = { 0x30, 0xD2 }; 86static unsigned char i2c_cb1_D2[2] = { 0x30, 0xD2 };
83static unsigned char i2c_cb1_56[2] = { 0x30, 0x56 }; 87static unsigned char i2c_cb1_56[2] = { 0x30, 0x56 };
84static unsigned char i2c_cb1_52[2] = { 0x30, 0x52 }; 88static unsigned char i2c_cb1_52[2] = { 0x30, 0x52 };
@@ -117,6 +121,13 @@ static struct i2c_msg i2c_msg_epilog[] = {
117 { I2C_ADDR_TDA8290, 0, ARRAY_SIZE(i2c_gainset_on), i2c_gainset_on }, 121 { I2C_ADDR_TDA8290, 0, ARRAY_SIZE(i2c_gainset_on), i2c_gainset_on },
118}; 122};
119 123
124static struct i2c_msg i2c_msg_standby[] = {
125 { I2C_ADDR_TDA8290, 0, ARRAY_SIZE(i2c_enable_bridge), i2c_enable_bridge },
126 { I2C_ADDR_TDA8275, 0, ARRAY_SIZE(i2c_cb1_D0), i2c_cb1_D0 },
127 { I2C_ADDR_TDA8290, 0, ARRAY_SIZE(i2c_disable_bridge), i2c_disable_bridge },
128 { I2C_ADDR_TDA8290, 0, ARRAY_SIZE(i2c_tda8290_standby), i2c_tda8290_standby },
129};
130
120static int tda8290_tune(struct i2c_client *c) 131static int tda8290_tune(struct i2c_client *c)
121{ 132{
122 struct tuner *t = i2c_get_clientdata(c); 133 struct tuner *t = i2c_get_clientdata(c);
@@ -205,6 +216,11 @@ static int has_signal(struct i2c_client *c)
205 return (afc & 0x80)? 65535:0; 216 return (afc & 0x80)? 65535:0;
206} 217}
207 218
219static void standby(struct i2c_client *c)
220{
221 i2c_transfer(c->adapter, i2c_msg_standby, ARRAY_SIZE(i2c_msg_standby));
222}
223
208int tda8290_init(struct i2c_client *c) 224int tda8290_init(struct i2c_client *c)
209{ 225{
210 struct tuner *t = i2c_get_clientdata(c); 226 struct tuner *t = i2c_get_clientdata(c);
@@ -214,6 +230,7 @@ int tda8290_init(struct i2c_client *c)
214 t->tv_freq = set_tv_freq; 230 t->tv_freq = set_tv_freq;
215 t->radio_freq = set_radio_freq; 231 t->radio_freq = set_radio_freq;
216 t->has_signal = has_signal; 232 t->has_signal = has_signal;
233 t->standby = standby;
217 234
218 i2c_master_send(c, i2c_enable_bridge, ARRAY_SIZE(i2c_enable_bridge)); 235 i2c_master_send(c, i2c_enable_bridge, ARRAY_SIZE(i2c_enable_bridge));
219 i2c_transfer(c->adapter, i2c_msg_init, ARRAY_SIZE(i2c_msg_init)); 236 i2c_transfer(c->adapter, i2c_msg_init, ARRAY_SIZE(i2c_msg_init));