Skip to content

Commit

Permalink
[media] tda1004x: only update the frontend properties if locked
Browse files Browse the repository at this point in the history
[ Upstream commit e8beb02 ]

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>
  • Loading branch information
Mauro Carvalho Chehab authored and Sasha Levin committed Feb 15, 2016
1 parent 8552bea commit b35f45f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/media/dvb-frontends/tda1004x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b35f45f

Please sign in to comment.