aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-06 04:52:43 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-10 03:05:13 -0500
commit2276bf70a7433c2afec541257eab28a43ed6c9cf (patch)
tree6b3ca891415c16a5d0bb7d4563a8ea447fe443a3
parentebf044f46f138b2c034c544b6cb79e563f1f21fa (diff)
[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: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/tuners/tuner-xc2028.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c
index 75afab718ba6..cca508d4aafb 100644
--- a/drivers/media/tuners/tuner-xc2028.c
+++ b/drivers/media/tuners/tuner-xc2028.c
@@ -267,6 +267,7 @@ static int check_device_status(struct xc2028_data *priv)
267 case XC2028_WAITING_FIRMWARE: 267 case XC2028_WAITING_FIRMWARE:
268 return -EAGAIN; 268 return -EAGAIN;
269 case XC2028_ACTIVE: 269 case XC2028_ACTIVE:
270 return 1;
270 case XC2028_SLEEP: 271 case XC2028_SLEEP:
271 return 0; 272 return 0;
272 case XC2028_NODEV: 273 case XC2028_NODEV:
@@ -913,6 +914,12 @@ static int xc2028_signal(struct dvb_frontend *fe, u16 *strength)
913 if (rc < 0) 914 if (rc < 0)
914 return rc; 915 return rc;
915 916
917 /* If the device is sleeping, no channel is tuned */
918 if (!rc) {
919 *strength = 0;
920 return 0;
921 }
922
916 mutex_lock(&priv->lock); 923 mutex_lock(&priv->lock);
917 924
918 /* Sync Lock Indicator */ 925 /* Sync Lock Indicator */
@@ -960,6 +967,12 @@ static int xc2028_get_afc(struct dvb_frontend *fe, s32 *afc)
960 if (rc < 0) 967 if (rc < 0)
961 return rc; 968 return rc;
962 969
970 /* If the device is sleeping, no channel is tuned */
971 if (!rc) {
972 *afc = 0;
973 return 0;
974 }
975
963 mutex_lock(&priv->lock); 976 mutex_lock(&priv->lock);
964 977
965 /* Sync Lock Indicator */ 978 /* Sync Lock Indicator */
@@ -1277,12 +1290,12 @@ static int xc2028_sleep(struct dvb_frontend *fe)
1277 if (rc < 0) 1290 if (rc < 0)
1278 return rc; 1291 return rc;
1279 1292
1280 /* Avoid firmware reload on slow devices or if PM disabled */ 1293 /* Device is already in sleep mode */
1281 if (no_poweroff || priv->ctrl.disable_power_mgmt) 1294 if (!rc)
1282 return 0; 1295 return 0;
1283 1296
1284 /* Device is already in sleep mode */ 1297 /* Avoid firmware reload on slow devices or if PM disabled */
1285 if (priv->state == XC2028_SLEEP) 1298 if (no_poweroff || priv->ctrl.disable_power_mgmt)
1286 return 0; 1299 return 0;
1287 1300
1288 tuner_dbg("Putting xc2028/3028 into poweroff mode.\n"); 1301 tuner_dbg("Putting xc2028/3028 into poweroff mode.\n");