From: Patrice Chotard <patrice.chotard@sfr.fr>
Date: Sat, 15 Dec 2012 22:11:28 +0000 (-0300)
Subject: [media] drxd: allow functional gate control after, attach
X-Git-Tag: firefly_0821_release~3680^2~275^2~428
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e7c953d280cea9a79018ae36e2bc7cedc3678de3;p=firefly-linux-kernel-4.4.55.git

[media] drxd: allow functional gate control after, attach

Previously, gate control didn't work until drxd_init()
execution. Migrate necessary set of commands in drxd_attach
to allow gate control to be used by tuner which are
accessible through i2c gate.

Reported-by: frederic.mantegazza@gbiloba.org
Signed-off-by: Patrice Chotard <patricechotard@free.fr>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---

diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c
index e71cc60851e7..487c53b69bf3 100644
--- a/drivers/media/dvb-frontends/drxd_hard.c
+++ b/drivers/media/dvb-frontends/drxd_hard.c
@@ -2980,6 +2980,10 @@ struct dvb_frontend *drxd_attach(const struct drxd_config *config,
 	       sizeof(struct dvb_frontend_ops));
 	state->frontend.demodulator_priv = state;
 	ConfigureMPEGOutput(state, 0);
+	/* add few initialization to allow gate control */
+	CDRXD(state, state->config.IF ? state->config.IF : 36000000);
+	InitHI(state);
+
 	return &state->frontend;
 
 error: