summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tda8290.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-08-31 16:53:00 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2007-08-31 16:53:00 -0400
commitcac470f0905c306738799f4b19fc6aa2a082a743 (patch)
treed818238fee19ac605c4adadc96a1e367c5f4239f /linux/drivers/media/video/tda8290.c
parent7435919d5b5f6bdae2461986721ede0b2075b67e (diff)
downloadmediapointer-dvb-s2-cac470f0905c306738799f4b19fc6aa2a082a743.tar.gz
mediapointer-dvb-s2-cac470f0905c306738799f4b19fc6aa2a082a743.tar.bz2
tda8290: add get_rf_strength and improve status reading efficiency
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/video/tda8290.c')
-rw-r--r--linux/drivers/media/video/tda8290.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/linux/drivers/media/video/tda8290.c b/linux/drivers/media/video/tda8290.c
index fc55c6122..e00b3516b 100644
--- a/linux/drivers/media/video/tda8290.c
+++ b/linux/drivers/media/video/tda8290.c
@@ -557,27 +557,35 @@ static int tda8290_set_params(struct dvb_frontend *fe,
static int tda8290_has_signal(struct dvb_frontend *fe)
{
struct tda8290_priv *priv = fe->tuner_priv;
+ int ret;
unsigned char i2c_get_afc[1] = { 0x1B };
unsigned char afc = 0;
+ /* for now, report based on afc status */
tuner_i2c_xfer_send(&priv->i2c_props, i2c_get_afc, ARRAY_SIZE(i2c_get_afc));
tuner_i2c_xfer_recv(&priv->i2c_props, &afc, 1);
- return (afc & 0x80)? 65535:0;
+
+ ret = (afc & 0x80) ? 65535 : 0;
+
+ tuner_dbg("AFC status: %d\n", ret);
+
+ return ret;
}
static int tda8290_get_status(struct dvb_frontend *fe, u32 *status)
{
- struct tda8290_priv *priv = fe->tuner_priv;
-
- int signal = tda8290_has_signal(fe);
*status = 0;
- /* for now, report based on afc status */
- if (signal)
+ if (tda8290_has_signal(fe))
*status = TUNER_STATUS_LOCKED;
- tuner_dbg("tda8290: AFC status: %d\n", signal);
+ return 0;
+}
+
+static int tda8290_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
+{
+ *strength = tda8290_has_signal(fe);
return 0;
}
@@ -660,6 +668,7 @@ static struct dvb_tuner_ops tda8290_tuner_ops = {
.release = tda8290_release,
.get_frequency = tda8290_get_frequency,
.get_status = tda8290_get_status,
+ .get_rf_strength = tda8290_get_rf_strength,
};
struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe,