aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMarco Schluessler <marco@lordzodiac.de>2007-02-13 07:31:07 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:35:31 -0500
commit89e4d59f2c082be9472c4de4dafb832e01bfbe01 (patch)
tree26c6846aff429836e1f0616a8eb8b103ccef805a /drivers/media
parentb61901024776b25ce7b8edc31bb1757c7382a88e (diff)
V4L/DVB (5245): Dvb-ttpci: use i2c gate ctrl from stv0297 frontend driver
Use i2c gate ctrl from stv0297 frontend driver. Signed-off-by: Marco Schluessler <marco@lordzodiac.de> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index d78b8f15dae5..cde5d3ae7ec7 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -140,17 +140,6 @@ static int ves1820_writereg(struct saa7146_dev *dev, u8 addr, u8 reg, u8 data)
140 return 0; 140 return 0;
141} 141}
142 142
143static int stv0297_writereg(struct saa7146_dev *dev, u8 addr, u8 reg, u8 data)
144{
145 u8 buf [] = { reg, data };
146 struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = 2 };
147
148 if (1 != saa7146_i2c_transfer(dev, &msg, 1, 1))
149 return -1;
150 return 0;
151}
152
153
154static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data [4]) 143static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data [4])
155{ 144{
156 struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = data, .len = 4 }; 145 struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = data, .len = 4 };
@@ -193,6 +182,7 @@ static int ves1820_set_tv_freq(struct saa7146_dev *dev, u32 freq)
193 182
194static int stv0297_set_tv_freq(struct saa7146_dev *dev, u32 freq) 183static int stv0297_set_tv_freq(struct saa7146_dev *dev, u32 freq)
195{ 184{
185 struct av7110 *av7110 = (struct av7110*)dev->ext_priv;
196 u32 div; 186 u32 div;
197 u8 data[4]; 187 u8 data[4];
198 188
@@ -213,8 +203,8 @@ static int stv0297_set_tv_freq(struct saa7146_dev *dev, u32 freq)
213 else 203 else
214 return -EINVAL; 204 return -EINVAL;
215 205
216 stv0297_writereg(dev, 0x1C, 0x87, 0x78); 206 if (av7110->fe->ops.i2c_gate_ctrl)
217 stv0297_writereg(dev, 0x1C, 0x86, 0xc8); 207 av7110->fe->ops.i2c_gate_ctrl(av7110->fe, 1);
218 return tuner_write(dev, 0x63, data); 208 return tuner_write(dev, 0x63, data);
219} 209}
220 210