aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-11-21 03:35:10 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-10 06:05:02 -0500
commit8949f1a2424a38a4080a2a3561a2698f215a7c4a (patch)
tree206002c4a28df89c339f86c8a89d3e391e8e4250 /drivers/media/dvb
parent499c18698990463b84c23ddc98104517fe759ee8 (diff)
V4L/DVB (4864): TDA826x I2C read with 2 messages
Added a dump I2C message to the TDA826x-driver to fix I2C read for identification with ttusb2-driver. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/tda826x.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/tda826x.c b/drivers/media/dvb/frontends/tda826x.c
index 4f01d7b47cd5..79f971dc52b6 100644
--- a/drivers/media/dvb/frontends/tda826x.c
+++ b/drivers/media/dvb/frontends/tda826x.c
@@ -132,18 +132,21 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2
132{ 132{
133 struct tda826x_priv *priv = NULL; 133 struct tda826x_priv *priv = NULL;
134 u8 b1 [] = { 0, 0 }; 134 u8 b1 [] = { 0, 0 };
135 struct i2c_msg msg = { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 }; 135 struct i2c_msg msg[2] = {
136 { .addr = addr, .flags = 0, .buf = NULL, .len = 0 },
137 { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 }
138 };
136 int ret; 139 int ret;
137 140
138 dprintk("%s:\n", __FUNCTION__); 141 dprintk("%s:\n", __FUNCTION__);
139 142
140 if (fe->ops.i2c_gate_ctrl) 143 if (fe->ops.i2c_gate_ctrl)
141 fe->ops.i2c_gate_ctrl(fe, 1); 144 fe->ops.i2c_gate_ctrl(fe, 1);
142 ret = i2c_transfer (i2c, &msg, 1); 145 ret = i2c_transfer (i2c, msg, 2);
143 if (fe->ops.i2c_gate_ctrl) 146 if (fe->ops.i2c_gate_ctrl)
144 fe->ops.i2c_gate_ctrl(fe, 0); 147 fe->ops.i2c_gate_ctrl(fe, 0);
145 148
146 if (ret != 1) 149 if (ret != 2)
147 return NULL; 150 return NULL;
148 if (!(b1[1] & 0x80)) 151 if (!(b1[1] & 0x80))
149 return NULL; 152 return NULL;