aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/tuner-xc2028.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index a32094e545f7..cc3db7d79a0d 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -844,21 +844,28 @@ static int xc2028_signal(struct dvb_frontend *fe, u16 *strength)
844 844
845 /* Sync Lock Indicator */ 845 /* Sync Lock Indicator */
846 rc = xc2028_get_reg(priv, 0x0002, &frq_lock); 846 rc = xc2028_get_reg(priv, 0x0002, &frq_lock);
847 if (rc < 0 || frq_lock == 0) 847 if (rc < 0)
848 goto ret; 848 goto ret;
849 849
850 /* Frequency is locked. Return signal quality */ 850 /* Frequency is locked */
851 if (frq_lock == 1)
852 signal = 32768;
851 853
852 /* Get SNR of the video signal */ 854 /* Get SNR of the video signal */
853 rc = xc2028_get_reg(priv, 0x0040, &signal); 855 rc = xc2028_get_reg(priv, 0x0040, &signal);
854 if (rc < 0) 856 if (rc < 0)
855 signal = -frq_lock; 857 goto ret;
858
859 /* Use both frq_lock and signal to generate the result */
860 signal = signal || ((signal & 0x07) << 12);
856 861
857ret: 862ret:
858 mutex_unlock(&priv->lock); 863 mutex_unlock(&priv->lock);
859 864
860 *strength = signal; 865 *strength = signal;
861 866
867 tuner_dbg("signal strength is %d\n", signal);
868
862 return rc; 869 return rc;
863} 870}
864 871