diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2017-04-20 01:13:50 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-06 12:50:19 +0200 |
commit | b01052ab0924f07a80538974806f9681d8ea74d1 (patch) | |
tree | 9acac16f46393b4dcfb610ad3af3f5e112787687 | |
parent | [media] au8522 Remove 0x4 bit for register reads (diff) | |
download | linux-b01052ab0924f07a80538974806f9681d8ea74d1.tar.xz linux-b01052ab0924f07a80538974806f9681d8ea74d1.zip |
[media] au8522: fix lock detection to be more reliable
Only looking at the lock register causes the status to float
between locked and not locked when there is no signal. So improve
the logic to also examine the state of the FSC PLL, which results
in the lock status being consistently reported.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/dvb-frontends/au8522_decoder.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c index 5e2164044fc6..343dc92ef54e 100644 --- a/drivers/media/dvb-frontends/au8522_decoder.c +++ b/drivers/media/dvb-frontends/au8522_decoder.c @@ -623,10 +623,12 @@ static int au8522_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) int val = 0; struct au8522_state *state = to_state(sd); u8 lock_status; + u8 pll_status; /* Interrogate the decoder to see if we are getting a real signal */ lock_status = au8522_readreg(state, 0x00); - if (lock_status == 0xa2) + pll_status = au8522_readreg(state, 0x7e); + if ((lock_status == 0xa2) && (pll_status & 0x10)) vt->signal = 0xffff; else vt->signal = 0x00; |