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);
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)
{
u8 tmp;
*status = 0;
+ if (priv->sleeping)
+ return 0;
+
ret = rtl2830_rd_reg_mask(priv, 0x351, &tmp, 0x78); /* [6:3] */
if (ret)
goto err;
goto err;
}
+ priv->sleeping = true;
+
return &priv->fe;
err:
dbg("%s: failed=%d", __func__, ret);
.release = rtl2830_release,
.init = rtl2830_init,
+ .sleep = rtl2830_sleep,
.get_tune_settings = rtl2830_get_tune_settings,