Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2276bf70 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] tuner-xc2028: Don't read status if device is powered down



That removes those timeout errors:

[ 3675.930940] xc2028 19-0061: Device is Xceive 3028 version 1.0, firmware version 2.7
[ 3676.060487] xc2028 19-0061: divisor= 00 00 8d d0 (freq=567.250)
[ 3676.349449] xc2028 19-0061: Putting xc2028/3028 into poweroff mode.
[ 3698.247645] xc2028 19-0061: xc2028_get_reg 0002 called
[ 3698.253276] em2860 #0: I2C transfer timeout on writing to addr 0xc2
[ 3698.253301] xc2028 19-0061: i2c input error: rc = -121 (should be 2)
[ 3698.253327] xc2028 19-0061: xc2028_signal called
[ 3698.253339] xc2028 19-0061: xc2028_get_reg 0002 called
[ 3698.259283] em2860 #0: I2C transfer timeout on writing to addr 0xc2
[ 3698.259312] xc2028 19-0061: i2c input error: rc = -121 (should be 2)

Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent ebf044f4
Loading
Loading
Loading
Loading
+17 −4
Original line number Original line Diff line number Diff line
@@ -267,6 +267,7 @@ static int check_device_status(struct xc2028_data *priv)
	case XC2028_WAITING_FIRMWARE:
	case XC2028_WAITING_FIRMWARE:
		return -EAGAIN;
		return -EAGAIN;
	case XC2028_ACTIVE:
	case XC2028_ACTIVE:
		return 1;
	case XC2028_SLEEP:
	case XC2028_SLEEP:
		return 0;
		return 0;
	case XC2028_NODEV:
	case XC2028_NODEV:
@@ -913,6 +914,12 @@ static int xc2028_signal(struct dvb_frontend *fe, u16 *strength)
	if (rc < 0)
	if (rc < 0)
		return rc;
		return rc;


	/* If the device is sleeping, no channel is tuned */
	if (!rc) {
		*strength = 0;
		return 0;
	}

	mutex_lock(&priv->lock);
	mutex_lock(&priv->lock);


	/* Sync Lock Indicator */
	/* Sync Lock Indicator */
@@ -960,6 +967,12 @@ static int xc2028_get_afc(struct dvb_frontend *fe, s32 *afc)
	if (rc < 0)
	if (rc < 0)
		return rc;
		return rc;


	/* If the device is sleeping, no channel is tuned */
	if (!rc) {
		*afc = 0;
		return 0;
	}

	mutex_lock(&priv->lock);
	mutex_lock(&priv->lock);


	/* Sync Lock Indicator */
	/* Sync Lock Indicator */
@@ -1277,12 +1290,12 @@ static int xc2028_sleep(struct dvb_frontend *fe)
	if (rc < 0)
	if (rc < 0)
		return rc;
		return rc;


	/* Avoid firmware reload on slow devices or if PM disabled */
	/* Device is already in sleep mode */
	if (no_poweroff || priv->ctrl.disable_power_mgmt)
	if (!rc)
		return 0;
		return 0;


	/* Device is already in sleep mode */
	/* Avoid firmware reload on slow devices or if PM disabled */
	if (priv->state == XC2028_SLEEP)
	if (no_poweroff || priv->ctrl.disable_power_mgmt)
		return 0;
		return 0;


	tuner_dbg("Putting xc2028/3028 into poweroff mode.\n");
	tuner_dbg("Putting xc2028/3028 into poweroff mode.\n");