aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 13:46:05 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:51 -0400
commite827931e37295329be0bc0e6c0283bfa4807b8f9 (patch)
tree347be84f51549c5a5ee4d174035cd6bfdd088d2c /drivers/media/video
parentcac2b0eb18e140e2f63146d0f97691e9238570b6 (diff)
V4L/DVB (7380): tuner-simple: warn if tuner can't be probed during attach
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tuner-simple.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index b95ed1f489a..07007d67d45 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -987,6 +987,28 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
987 return NULL; 987 return NULL;
988 } 988 }
989 989
990 /* If i2c_adap is set, check that the tuner is at the correct address.
991 * Otherwise, if i2c_adap is NULL, the tuner will be programmed directly
992 * by the digital demod via calc_regs.
993 */
994 if (i2c_adap != NULL) {
995 u8 b[1];
996 struct i2c_msg msg = {
997 .addr = i2c_addr, .flags = I2C_M_RD,
998 .buf = b, .len = 1,
999 };
1000
1001 if (fe->ops.i2c_gate_ctrl)
1002 fe->ops.i2c_gate_ctrl(fe, 1);
1003
1004 if (1 != i2c_transfer(i2c_adap, &msg, 1))
1005 tuner_warn("unable to probe %s, proceeding anyway.",
1006 tuners[type].name);
1007
1008 if (fe->ops.i2c_gate_ctrl)
1009 fe->ops.i2c_gate_ctrl(fe, 0);
1010 }
1011
990 mutex_lock(&tuner_simple_list_mutex); 1012 mutex_lock(&tuner_simple_list_mutex);
991 1013
992 instance = hybrid_tuner_request_state(struct tuner_simple_priv, priv, 1014 instance = hybrid_tuner_request_state(struct tuner_simple_priv, priv,