summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-03-15 20:32:40 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2008-03-15 20:32:40 -0400
commit3bed52b90bed30c92f1a8e5814aa11e766b44547 (patch)
tree52a1efd29f0e0bc36a08ebddf391f2a994505b44 /linux/drivers/media
parent48ec32d387d424a6b051d1f1d59bdaa28dadf228 (diff)
downloadmediapointer-dvb-s2-3bed52b90bed30c92f1a8e5814aa11e766b44547.tar.gz
mediapointer-dvb-s2-3bed52b90bed30c92f1a8e5814aa11e766b44547.tar.bz2
tuner-simple: warn if tuner can't be probed during attach
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/tuner-simple.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c
index 98cfa1b5b..efa63e9f4 100644
--- a/linux/drivers/media/video/tuner-simple.c
+++ b/linux/drivers/media/video/tuner-simple.c
@@ -1022,6 +1022,28 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
return NULL;
}
+ /* If i2c_adap is set, check that the tuner is at the correct address.
+ * Otherwise, if i2c_adap is NULL, the tuner will be programmed directly
+ * by the digital demod via calc_regs.
+ */
+ if (i2c_adap != NULL) {
+ u8 b[1];
+ struct i2c_msg msg = {
+ .addr = i2c_addr, .flags = I2C_M_RD,
+ .buf = b, .len = 1,
+ };
+
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 1);
+
+ if (1 != i2c_transfer(i2c_adap, &msg, 1))
+ tuner_warn("unable to probe %s, proceeding anyway.",
+ tuners[type].name);
+
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 0);
+ }
+
mutex_lock(&tuner_simple_list_mutex);
instance = hybrid_tuner_request_state(struct tuner_simple_priv, priv,