aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-05-18 15:02:55 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-20 09:24:53 -0400
commitc188637dc5a25aec6a21279524405c8fe96f2f4b (patch)
tree2097a31d4598283633185b8b4b4857fca4254894 /drivers/media/dvb
parent631a2b611288f87de4ef1098d1fb4bc4d246b103 (diff)
[media] rtl2830: prevent hw access when sleeping
to prevent I/O errors... Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/rtl2830.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/rtl2830.c b/drivers/media/dvb/frontends/rtl2830.c
index 507ef4bb047a..93612ebac519 100644
--- a/drivers/media/dvb/frontends/rtl2830.c
+++ b/drivers/media/dvb/frontends/rtl2830.c
@@ -381,6 +381,9 @@ static int rtl2830_get_frontend(struct dvb_frontend *fe)
381 int ret; 381 int ret;
382 u8 buf[3]; 382 u8 buf[3];
383 383
384 if (priv->sleeping)
385 return 0;
386
384 ret = rtl2830_rd_regs(priv, 0x33c, buf, 2); 387 ret = rtl2830_rd_regs(priv, 0x33c, buf, 2);
385 if (ret) 388 if (ret)
386 goto err; 389 goto err;
@@ -525,6 +528,9 @@ static int rtl2830_read_snr(struct dvb_frontend *fe, u16 *snr)
525 { 92888734, 92888734, 95487525, 99770748 }, 528 { 92888734, 92888734, 95487525, 99770748 },
526 }; 529 };
527 530
531 if (priv->sleeping)
532 return 0;
533
528 /* reports SNR in resolution of 0.1 dB */ 534 /* reports SNR in resolution of 0.1 dB */
529 535
530 ret = rtl2830_rd_reg(priv, 0x33c, &tmp); 536 ret = rtl2830_rd_reg(priv, 0x33c, &tmp);
@@ -563,6 +569,9 @@ static int rtl2830_read_ber(struct dvb_frontend *fe, u32 *ber)
563 int ret; 569 int ret;
564 u8 buf[2]; 570 u8 buf[2];
565 571
572 if (priv->sleeping)
573 return 0;
574
566 ret = rtl2830_rd_regs(priv, 0x34e, buf, 2); 575 ret = rtl2830_rd_regs(priv, 0x34e, buf, 2);
567 if (ret) 576 if (ret)
568 goto err; 577 goto err;
@@ -588,6 +597,9 @@ static int rtl2830_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
588 u8 buf[2]; 597 u8 buf[2];
589 u16 if_agc_raw, if_agc; 598 u16 if_agc_raw, if_agc;
590 599
600 if (priv->sleeping)
601 return 0;
602
591 ret = rtl2830_rd_regs(priv, 0x359, buf, 2); 603 ret = rtl2830_rd_regs(priv, 0x359, buf, 2);
592 if (ret) 604 if (ret)
593 goto err; 605 goto err;