summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-09 10:53:31 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-05-04 11:09:54 -0400
commitdb9c1007bc07436119aa897959369408b70a6fc4 (patch)
tree8f7f013958bfcec5b236cea6f83e778fdbb6be44
parent23ba635d45f5c2fb157c40b1b98130ba660024e7 (diff)
downloadlinux-db9c1007bc07436119aa897959369408b70a6fc4.tar.bz2
media: lgdt330x: do some cleanups at status logic
Simplify a few ifs there. While here, add debug messages for the 8-vsb and qam log status flags. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--drivers/media/dvb-frontends/lgdt330x.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/dvb-frontends/lgdt330x.c b/drivers/media/dvb-frontends/lgdt330x.c
index a6fd5a239026..e93ffe8891e5 100644
--- a/drivers/media/dvb-frontends/lgdt330x.c
+++ b/drivers/media/dvb-frontends/lgdt330x.c
@@ -515,10 +515,8 @@ static int lgdt3302_read_status(struct dvb_frontend *fe,
*status |= FE_HAS_SYNC;
/* FEC error status */
- if ((buf[2] & 0x0c) == 0x08) {
- *status |= FE_HAS_LOCK;
- *status |= FE_HAS_VITERBI;
- }
+ if ((buf[2] & 0x0c) == 0x08)
+ *status |= FE_HAS_LOCK | FE_HAS_VITERBI;
/* Carrier Recovery Lock Status Register */
i2c_read_demod_bytes(state, CARRIER_LOCK, buf, 1);
@@ -578,6 +576,8 @@ static int lgdt3303_read_status(struct dvb_frontend *fe,
else
break;
i2c_read_demod_bytes(state, 0x8a, buf, 1);
+ dprintk(state, "QAM LOCK = 0x%02x\n", buf[0]);
+
if ((buf[0] & 0x04) == 0x04)
*status |= FE_HAS_SYNC;
if ((buf[0] & 0x01) == 0x01)
@@ -591,12 +591,12 @@ static int lgdt3303_read_status(struct dvb_frontend *fe,
else
break;
i2c_read_demod_bytes(state, 0x38, buf, 1);
+ dprintk(state, "8-VSB LOCK = 0x%02x\n", buf[0]);
+
if ((buf[0] & 0x02) == 0x00)
*status |= FE_HAS_SYNC;
- if ((buf[0] & 0x01) == 0x01) {
- *status |= FE_HAS_LOCK;
- *status |= FE_HAS_VITERBI;
- }
+ if ((buf[0] & 0xfd) == 0x01)
+ *status |= FE_HAS_VITERBI | FE_HAS_LOCK;
break;
default:
dev_warn(&state->client->dev,