[media] drxd: provide ability to disable the i2c gate control function
If the tuner is not actually behind an i2c gate, using the i2c gate control
function can wedge the i2c bus. Provide the ability to control on a per-board
basis whether it should be used.
Problem was noticed on the HVR-900 R2, where it resulted in the first tuning
attempt succeeding, and then all subsequent attempts to access the xc3028
being treated as failures (including the call to sleep the tuner).
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/dvb/frontends/drxd.h b/drivers/media/dvb/frontends/drxd.h
index 81093b9..b21c853 100644
--- a/drivers/media/dvb/frontends/drxd.h
+++ b/drivers/media/dvb/frontends/drxd.h
@@ -44,6 +44,10 @@
u8 demoda_address;
u8 demod_revision;
+ /* If the tuner is not behind an i2c gate, be sure to flip this bit
+ or else the i2c bus could get wedged */
+ u8 disable_i2c_gate_ctrl;
+
u32 IF;
int (*pll_set) (void *priv, void *priv_params,
u8 pll_addr, u8 demoda_addr, s32 *off);
diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c
index 994195f..b8baafe 100644
--- a/drivers/media/dvb/frontends/drxd_hard.c
+++ b/drivers/media/dvb/frontends/drxd_hard.c
@@ -2662,6 +2662,9 @@
{
struct drxd_state *state=fe->demodulator_priv;
+ if (state->config.disable_i2c_gate_ctrl == 1)
+ return 0;
+
return DRX_ConfigureI2CBridge(state, onoff);
}