Skip to content

Commit b35f45f

Browse files
mchehabsashalevin
authored andcommitted
[media] tda1004x: only update the frontend properties if locked
[ 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: [email protected] Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 8552bea commit b35f45f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/media/dvb-frontends/tda1004x.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,9 +903,18 @@ static int tda1004x_get_fe(struct dvb_frontend *fe)
903903
{
904904
struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
905905
struct tda1004x_state* state = fe->demodulator_priv;
906+
int status;
906907

907908
dprintk("%s\n", __func__);
908909

910+
status = tda1004x_read_byte(state, TDA1004X_STATUS_CD);
911+
if (status == -1)
912+
return -EIO;
913+
914+
/* Only update the properties cache if device is locked */
915+
if (!(status & 8))
916+
return 0;
917+
909918
// inversion status
910919
fe_params->inversion = INVERSION_OFF;
911920
if (tda1004x_read_byte(state, TDA1004X_CONFC1) & 0x20)

0 commit comments

Comments
 (0)