diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 08:19:55 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 08:19:55 -0300 |
commit | d7c1b099832047eb2644beb7e990533b73e00b8d (patch) | |
tree | 5e2890ae95970c94ad8660fe2bf05a8efea2d427 /linux | |
parent | fad46ff52688fe9e5ad50d6fccad48bf1923ca1f (diff) | |
download | mediapointer-dvb-s2-d7c1b099832047eb2644beb7e990533b73e00b8d.tar.gz mediapointer-dvb-s2-d7c1b099832047eb2644beb7e990533b73e00b8d.tar.bz2 |
Fix signal strength
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/tuner-xc2028.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/linux/drivers/media/video/tuner-xc2028.c b/linux/drivers/media/video/tuner-xc2028.c index ce066dc97..797cb3203 100644 --- a/linux/drivers/media/video/tuner-xc2028.c +++ b/linux/drivers/media/video/tuner-xc2028.c @@ -859,21 +859,28 @@ static int xc2028_signal(struct dvb_frontend *fe, u16 *strength) /* Sync Lock Indicator */ rc = xc2028_get_reg(priv, 0x0002, &frq_lock); - if (rc < 0 || frq_lock == 0) + if (rc < 0) goto ret; - /* Frequency is locked. Return signal quality */ + /* Frequency is locked */ + if (frq_lock == 1) + signal = 32768; /* Get SNR of the video signal */ rc = xc2028_get_reg(priv, 0x0040, &signal); if (rc < 0) - signal = -frq_lock; + goto ret; + + /* Use both frq_lock and signal to generate the result */ + signal = signal || ((signal & 0x07) << 12); ret: mutex_unlock(&priv->lock); *strength = signal; + tuner_dbg("signal strength is %d\n", signal); + return rc; } |