diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-03 17:33:48 -0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-02-15 15:45:34 -0500 |
commit | b35f45f2ebf224e06836ced6ccebb05ec700a6a9 (patch) | |
tree | 5d6b696a1cc1a77e0e013b9a80188ae7f0cc415a /drivers/media | |
parent | 8552bea30320cc866c7fb5d9a687c3e6d15fb5c1 (diff) |
[media] tda1004x: only update the frontend properties if locked
[ Upstream commit e8beb02343e7582980c6705816cd957cf4f74c7a ]
The tda1004x was updating the properties cache before locking.
If the device is not locked, the data at the registers are just
random values with no real meaning.
This caused the driver to fail with libdvbv5, as such library
calls GET_PROPERTY from time to time, in order to return the
DVB stats.
Tested with a saa7134 card 78:
ASUSTeK P7131 Dual, vendor PCI ID: 1043:4862
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb-frontends/tda1004x.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/tda1004x.c b/drivers/media/dvb-frontends/tda1004x.c index a2631be7ffac..08e0f0dd8728 100644 --- a/drivers/media/dvb-frontends/tda1004x.c +++ b/drivers/media/dvb-frontends/tda1004x.c @@ -903,9 +903,18 @@ static int tda1004x_get_fe(struct dvb_frontend *fe) { struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache; struct tda1004x_state* state = fe->demodulator_priv; + int status; dprintk("%s\n", __func__); + status = tda1004x_read_byte(state, TDA1004X_STATUS_CD); + if (status == -1) + return -EIO; + + /* Only update the properties cache if device is locked */ + if (!(status & 8)) + return 0; + // inversion status fe_params->inversion = INVERSION_OFF; if (tda1004x_read_byte(state, TDA1004X_CONFC1) & 0x20) |