summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/cxd2841er.c
diff options
context:
space:
mode:
authorAbylay Ospan <aospan@netup.ru>2016-04-05 15:02:37 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-06-07 12:12:25 -0300
commit30ae3307adcf500229e95731a5e116bc3a8c31f8 (patch)
tree765b3a9862caab28b0ed0f07f4c6efc34ec2e496 /drivers/media/dvb-frontends/cxd2841er.c
parentc5ea46dae94875fa6656b014fee53a5847ee683c (diff)
downloadlinux-30ae3307adcf500229e95731a5e116bc3a8c31f8.tar.gz
linux-30ae3307adcf500229e95731a5e116bc3a8c31f8.tar.bz2
linux-30ae3307adcf500229e95731a5e116bc3a8c31f8.zip
[media] Sanity check when initializing DVB-S/S2 demodulator
Avoid error message: cxd2841er_read_status_s(): invalid state 1 Always force demod to shutdown state before initializing Signed-off-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/cxd2841er.c')
-rw-r--r--drivers/media/dvb-frontends/cxd2841er.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c
index b87d99066d44..94613af6900d 100644
--- a/drivers/media/dvb-frontends/cxd2841er.c
+++ b/drivers/media/dvb-frontends/cxd2841er.c
@@ -3133,6 +3133,18 @@ static int cxd2841er_init_s(struct dvb_frontend *fe)
{
struct cxd2841er_priv *priv = fe->demodulator_priv;
+ /* sanity. force demod to SHUTDOWN state */
+ if (priv->state == STATE_SLEEP_S) {
+ dev_dbg(&priv->i2c->dev, "%s() forcing sleep->shutdown\n",
+ __func__);
+ cxd2841er_sleep_s_to_shutdown(priv);
+ } else if (priv->state == STATE_ACTIVE_S) {
+ dev_dbg(&priv->i2c->dev, "%s() forcing active->sleep->shutdown\n",
+ __func__);
+ cxd2841er_active_s_to_sleep_s(priv);
+ cxd2841er_sleep_s_to_shutdown(priv);
+ }
+
dev_dbg(&priv->i2c->dev, "%s()\n", __func__);
cxd2841er_shutdown_to_sleep_s(priv);
/* SONY_DEMOD_CONFIG_SAT_IFAGCNEG set to 1 */