Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294955
b: refs/heads/master
c: a8567cf
h: refs/heads/master
i:
  294953: ddec6be
  294951: fe171c8
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Feb 28, 2012
1 parent 7ae9b96 commit 7f2bd0e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9935eea5ac300b84036192af1bd98940a64650de
refs/heads/master: a8567cf22e0efb9faafa6cf33b607ca5aee3c2fa
5 changes: 0 additions & 5 deletions trunk/drivers/media/dvb/dvb-usb/rtl28xxu.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,6 @@ static int rtl28xxu_power_ctrl(struct dvb_usb_device *d, int onoff)
sys0 = sys0 & 0x0f;
sys0 |= 0xe0;
} else {
/*
* FIXME: Use .fe_ioctl_override() to prevent demod
* IOCTLs in case of device is powered off. Or change
* RTL2830 demod not perform requestesd IOCTL & IO when sleep.
*/
gpio &= (~0x01); /* GPIO0 = 0 */
gpio |= 0x10; /* GPIO4 = 1 */
sys0 = sys0 & (~0xc0);
Expand Down
15 changes: 15 additions & 0 deletions trunk/drivers/media/dvb/frontends/rtl2830.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,21 @@ static int rtl2830_init(struct dvb_frontend *fe)
if (ret)
goto err;

priv->sleeping = false;

return ret;
err:
dbg("%s: failed=%d", __func__, ret);
return ret;
}

static int rtl2830_sleep(struct dvb_frontend *fe)
{
struct rtl2830_priv *priv = fe->demodulator_priv;
priv->sleeping = true;
return 0;
}

int rtl2830_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *s)
{
Expand Down Expand Up @@ -372,6 +381,9 @@ static int rtl2830_read_status(struct dvb_frontend *fe, fe_status_t *status)
u8 tmp;
*status = 0;

if (priv->sleeping)
return 0;

ret = rtl2830_rd_reg_mask(priv, 0x351, &tmp, 0x78); /* [6:3] */
if (ret)
goto err;
Expand Down Expand Up @@ -498,6 +510,8 @@ struct dvb_frontend *rtl2830_attach(const struct rtl2830_config *cfg,
goto err;
}

priv->sleeping = true;

return &priv->fe;
err:
dbg("%s: failed=%d", __func__, ret);
Expand Down Expand Up @@ -530,6 +544,7 @@ static struct dvb_frontend_ops rtl2830_ops = {
.release = rtl2830_release,

.init = rtl2830_init,
.sleep = rtl2830_sleep,

.get_tune_settings = rtl2830_get_tune_settings,

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/media/dvb/frontends/rtl2830_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ struct rtl2830_priv {
struct rtl2830_config cfg;
struct i2c_adapter tuner_i2c_adapter;

bool sleeping;

u8 page; /* active register page */
};

Expand Down

0 comments on commit 7f2bd0e

Please sign in to comment.