[media] drxd: provide ability to disable the i2c gate control function
authorDevin Heitmueller <dheitmueller@kernellabs.com>
Sun, 13 Mar 2011 05:02:01 +0000 (02:02 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 20 May 2011 10:26:19 +0000 (07:26 -0300)
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>
drivers/media/dvb/frontends/drxd.h
drivers/media/dvb/frontends/drxd_hard.c
drivers/media/video/em28xx/em28xx-dvb.c

index 81093b9b1568f47a839c9b962ee95638b476296b..b21c85315d7630894692998993a9ea5e063d67d4 100644 (file)
@@ -44,6 +44,10 @@ struct drxd_config
        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);
index 994195fe9fbb5fc01185c9dbd2cee4f293f5172a..b8baafe3b54b0d10ebcd5bbdf217d53d5a46e5b9 100644 (file)
@@ -2662,6 +2662,9 @@ int drxd_config_i2c(struct dvb_frontend *fe, int onoff)
 {
        struct drxd_state *state=fe->demodulator_priv;
 
+       if (state->config.disable_i2c_gate_ctrl == 1)
+               return 0;
+
        return DRX_ConfigureI2CBridge(state, onoff);
 }
 
index bdbdb1bd8ec92deb1caa7fce6c0541a233e8cc49..f18e41f0bbc1b1fc92e96f74f6beb179a3245ad0 100644 (file)
@@ -291,6 +291,7 @@ static struct drxd_config em28xx_drxd = {
        .demoda_address = 0x00, .pll_address = 0x00,
        .pll_type = DRXD_PLL_NONE, .clock = 12000, .insert_rs_byte = 1,
        .pll_set = NULL, .osc_deviation = NULL, .IF = 42800000,
+       .disable_i2c_gate_ctrl = 1,
 };
 
 static int mt352_terratec_xs_init(struct dvb_frontend *fe)