OSDN Git Service

media: dvb-frontends/stv0367: improve QAM fe_status
authorDaniel Scheller <d.scheller@gmx.net>
Fri, 14 Jul 2017 21:23:36 +0000 (17:23 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 20 Jul 2017 19:16:48 +0000 (15:16 -0400)
commitd105d083448e79ec3f4b1d3f501b869a4515a1d0
tree3cf1a6a324ae81c48821f0897a339e0bcdcaaf2b
parent552636be7afc86531d1931b5104d7002850d3af7
media: dvb-frontends/stv0367: improve QAM fe_status

While cab_state->state gives a quite accurate indication of the demod
signal status, it might be incorrect if cab_algo() wasn't able to
determine the exact status, with cab_algo() being the only place where
this status was updated from, and it is only called upon tuning to new
parameters passed to set_frontend(). Thus, the status will be wrong
until the demod is retuned. With the cab_signal_type parsing in
read_status(), this results in unusual fe_states like FE_HAS_SIGNAL |
FE_HAS_CARRIER | FE_HAS_LOCK, which, while userspace applications check
for FE_HAS_LOCK and work fine, leads to missing CNR or UCB stats.

Fix this by re-reading CAB_FSM_STATUS and updating cab_state->state() in
read_status(). While at it, refactor the fsm/qamfeclock and the
fsm->signaltype parsing into separate functions to make things cleaner
and deduplicate code. Also, assume full QAM FEC lock equals full
FE_STATUS.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/stv0367.c