summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorMichael Krufky <devnull@localhost>2005-07-07 02:22:06 +0000
committerMichael Krufky <devnull@localhost>2005-07-07 02:22:06 +0000
commit07cd84707b8961cb002dff94b04762a59aa275b7 (patch)
tree29b9710a22853461422becf7ac157b39978256fb /linux/drivers/media/dvb/frontends
parentf94a9771f5ace472b56b7f68cfe08fa1356f8a4c (diff)
downloadmediapointer-dvb-s2-07cd84707b8961cb002dff94b04762a59aa275b7.tar.gz
mediapointer-dvb-s2-07cd84707b8961cb002dff94b04762a59aa275b7.tar.bz2
Fix bug in lgdt3302_read_status to return correct
FE_HAS_SIGNAL and FS_HAS_CARRIER status. Signed-off-by: Mac Michaels <wmichaels1@earthlink.net> Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r--linux/drivers/media/dvb/frontends/lgdt3302.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/linux/drivers/media/dvb/frontends/lgdt3302.c b/linux/drivers/media/dvb/frontends/lgdt3302.c
index 6cf51a0a0..47ca28ecd 100644
--- a/linux/drivers/media/dvb/frontends/lgdt3302.c
+++ b/linux/drivers/media/dvb/frontends/lgdt3302.c
@@ -1,5 +1,5 @@
/*
- * $Id: lgdt3302.c,v 1.3 2005/07/06 05:41:01 mkrufky Exp $
+ * $Id: lgdt3302.c,v 1.4 2005/07/07 02:22:06 mkrufky Exp $
*
* Support for LGDT3302 (DViCO FustionHDTV 3 Gold) - VSB/QAM
*
@@ -347,11 +347,28 @@ static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status)
* This is done in SwReset();
*/
+ /* AGC status register */
+ i2c_selectreadbytes(state, AGC_STATUS, buf, 1);
+ dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]);
+ if ((buf[0] & 0x0c) == 0x8){
+ /* Test signal does not exist flag */
+ /* as well as the AGC lock flag. */
+ *status |= FE_HAS_SIGNAL;
+ } else {
+ /* Without a signal all other status bits are meaningless */
+ return 0;
+ }
+
/* signal status */
i2c_selectreadbytes(state, TOP_CONTROL, buf, sizeof(buf));
dprintk("%s: TOP_CONTROL = 0x%02x, IRO_MASK = 0x%02x, IRQ_STATUS = 0x%02x\n", __FUNCTION__, buf[0], buf[1], buf[2]);
+
+#if 0
+ /* Alternative method to check for a signal */
+ /* using the SNR good/bad interrupts. */
if ((buf[2] & 0x30) == 0x10)
*status |= FE_HAS_SIGNAL;
+#endif
/* sync status */
if ((buf[2] & 0x03) == 0x01) {
@@ -364,17 +381,6 @@ static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status)
*status |= FE_HAS_VITERBI;
}
-#if 0
- /* Alternative method to check for a signal */
- /* AGC status register */
- i2c_selectreadbytes(state, AGC_STATUS, buf, 1);
- dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]);
- if ((buf[0] & 0x0c) == 0x80) /* Test signal does not exist flag */
- /* Test AGC lock flag */
- *status |= FE_HAS_SIGNAL;
- else
- return 0;
-
/* Carrier Recovery Lock Status Register */
i2c_selectreadbytes(state, CARRIER_LOCK, buf, 1);
dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]);
@@ -384,19 +390,14 @@ static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status)
/* Need to undestand why there are 3 lock levels here */
if ((buf[0] & 0x07) == 0x07)
*status |= FE_HAS_CARRIER;
- else
- return 0;
break;
case VSB_8:
if ((buf[0] & 0x80) == 0x80)
*status |= FE_HAS_CARRIER;
- else
- return 0;
break;
default:
printk("KERN_WARNING lgdt3302: %s: Modulation set to unsupported value\n", __FUNCTION__);
}
-#endif
return 0;
}