diff options
author | Daniel Scheller <d.scheller@gmx.net> | 2017-03-29 13:43:08 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-20 09:24:19 -0300 |
commit | cae7a901cd630b3df37e4b8dea0be3cc489a51be (patch) | |
tree | 3799d55e2b6c82719c142fce0e311a24df271ece /drivers/media/dvb-frontends/stv0367.c | |
parent | b16338e3d346ced3956e21408f265c7f308f9ba4 (diff) | |
download | linux-stable-cae7a901cd630b3df37e4b8dea0be3cc489a51be.tar.gz linux-stable-cae7a901cd630b3df37e4b8dea0be3cc489a51be.tar.bz2 linux-stable-cae7a901cd630b3df37e4b8dea0be3cc489a51be.zip |
[media] dvb-frontends/stv0367: selectable QAM FEC Lock status register
In some configurations (due to different PIN config, wiring or so), the
QAM FECLock might be signalled using a different register than
F367CAB_QAMFEC_LOCK (e.g. F367CAB_DESCR_SYNCSTATE on Digital Devices hw),
so make that register selectable.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-frontends/stv0367.c')
-rw-r--r-- | drivers/media/dvb-frontends/stv0367.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index 74fee3f953db..fb41c7b1b89b 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -57,6 +57,7 @@ struct stv0367cab_state { u32 freq_khz; /* found frequency (in kHz) */ u32 symbol_rate; /* found symbol rate (in Bds) */ enum fe_spectral_inversion spect_inv; /* Spectrum Inversion */ + u32 qamfec_status_reg; /* status reg to poll for FEC Lock */ }; struct stv0367ter_state { @@ -2145,7 +2146,8 @@ static int stv0367cab_read_status(struct dvb_frontend *fe, *status = 0; - if (stv0367_readbits(state, F367CAB_QAMFEC_LOCK)) { + if (stv0367_readbits(state, (state->cab_state->qamfec_status_reg ? + state->cab_state->qamfec_status_reg : F367CAB_QAMFEC_LOCK))) { *status |= FE_HAS_LOCK; dprintk("%s: stv0367 has locked\n", __func__); } @@ -2410,7 +2412,9 @@ enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state, usleep_range(5000, 7000); LockTime += 5; QAMFEC_Lock = stv0367_readbits(state, - F367CAB_QAMFEC_LOCK); + (state->cab_state->qamfec_status_reg ? + state->cab_state->qamfec_status_reg : + F367CAB_QAMFEC_LOCK)); } while (!QAMFEC_Lock && (LockTime < FECTimeOut)); } else QAMFEC_Lock = 0; @@ -2849,6 +2853,7 @@ struct dvb_frontend *stv0367cab_attach(const struct stv0367_config *config, state->i2c = i2c; state->config = config; cab_state->search_range = 280000; + cab_state->qamfec_status_reg = F367CAB_QAMFEC_LOCK; state->cab_state = cab_state; state->fe.ops = stv0367cab_ops; state->fe.demodulator_priv = state; |