aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorSteven Toth <stoth@linuxtv.org>2008-10-16 22:17:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-21 12:30:48 -0400
commite16c63de928f00075f0ea466581e04b44bb33f75 (patch)
treea2e42b008acef238108cbfaa66357a01789e63a0 /drivers/media
parentc96de5197d038cd1c5538085109c7329434ee94b (diff)
V4L/DVB (9310): s5h1411: read_status() locking detection fixes.
This includes new bit definitions for previously unknown bits. Signed-off-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/s5h1411.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/media/dvb/frontends/s5h1411.c b/drivers/media/dvb/frontends/s5h1411.c
index 25a3fb31e023..c79e23ded4d7 100644
--- a/drivers/media/dvb/frontends/s5h1411.c
+++ b/drivers/media/dvb/frontends/s5h1411.c
@@ -636,28 +636,29 @@ static int s5h1411_read_status(struct dvb_frontend *fe, fe_status_t *status)
636 636
637 *status = 0; 637 *status = 0;
638 638
639 /* Get the demodulator status */ 639 /* Register F2 bit 15 = Master Lock, removed */
640 reg = (s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2) >> 15)
641 & 0x0001;
642 if (reg)
643 *status |= FE_HAS_LOCK | FE_HAS_CARRIER | FE_HAS_SIGNAL;
644 640
645 switch (state->current_modulation) { 641 switch (state->current_modulation) {
646 case QAM_64: 642 case QAM_64:
647 case QAM_256: 643 case QAM_256:
648 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf0); 644 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf0);
649 if (reg & 0x100) 645 if (reg & 0x10) /* QAM FEC Lock */
650 *status |= FE_HAS_VITERBI; 646 *status |= FE_HAS_SYNC | FE_HAS_LOCK;
651 if (reg & 0x10) 647 if (reg & 0x100) /* QAM EQ Lock */
652 *status |= FE_HAS_SYNC; 648 *status |= FE_HAS_VITERBI | FE_HAS_CARRIER | FE_HAS_SIGNAL;
649
653 break; 650 break;
654 case VSB_8: 651 case VSB_8:
655 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0x5e);
656 if (reg & 0x0001)
657 *status |= FE_HAS_SYNC;
658 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2); 652 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2);
659 if (reg & 0x1000) 653 if (reg & 0x1000) /* FEC Lock */
660 *status |= FE_HAS_VITERBI; 654 *status |= FE_HAS_SYNC | FE_HAS_LOCK;
655 if (reg & 0x2000) /* EQ Lock */
656 *status |= FE_HAS_VITERBI | FE_HAS_CARRIER | FE_HAS_SIGNAL;
657
658 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0x53);
659 if (reg & 0x1) /* AFC Lock */
660 *status |= FE_HAS_SIGNAL;
661
661 break; 662 break;
662 default: 663 default:
663 return -EINVAL; 664 return -EINVAL;