[media] drxk: Allow to disable I2C Bridge control switch
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 10 Jul 2011 00:59:33 +0000 (21:59 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:55:49 +0000 (17:55 -0300)
On em28xx, tda18271C2 is accessible when the i2c port
is not touched. Touching on it breaks the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/drxk.h
drivers/media/dvb/frontends/drxk_hard.c
drivers/media/dvb/frontends/drxk_hard.h
drivers/media/video/em28xx/em28xx-dvb.c

index dd54512df2a5bb9a8074ad5d1ee439ee2eab60d5..9c99f31369ce01f36e0a5f4fbb8d01b88d55757d 100644 (file)
@@ -7,6 +7,7 @@
 struct drxk_config {
        u8 adr;
        u32 single_master : 1;
+       u32 no_i2c_bridge : 1;
        const char *microcode_name;
 };
 
index adb454a8eb7fd7c10a142bb52238cf77c4095f16..523352670e73ab187bd16f0f947fc114f2c0c4b0 100644 (file)
@@ -2784,6 +2784,8 @@ static int ConfigureI2CBridge(struct drxk_state *state, bool bEnableBridge)
        if (state->m_DrxkState == DRXK_POWERED_DOWN)
                return -1;
 
+       if (state->no_i2c_bridge)
+               return 0;
        do {
                status = write16(state, SIO_HI_RA_RAM_PAR_1__A, SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY);
                if (status < 0)
@@ -6360,6 +6362,7 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config,
        state->demod_address = adr;
        state->single_master = config->single_master;
        state->microcode_name = config->microcode_name;
+       state->no_i2c_bridge = config->no_i2c_bridge;
 
        mutex_init(&state->mutex);
        mutex_init(&state->ctlock);
index 8cdadce2646e6b01782c2d6615929776142e2216..b042755188c43ffcf97bc5953b339af0ee01987a 100644 (file)
@@ -330,6 +330,7 @@ struct drxk_state {
        /* Configurable parameters at the driver */
 
        u32 single_master : 1;          /* Use single master i2c mode */
+       u32 no_i2c_bridge : 1;          /* Tuner is not on port 1, don't use I2C bridge */
        const char *microcode_name;
 
 };
index 93f0af505b00fbac89674c8a4f964511d6574d2c..9b2be03c82e8628e3308c87be84ba9ce5f2946de 100644 (file)
@@ -304,6 +304,7 @@ static struct drxd_config em28xx_drxd = {
 struct drxk_config terratec_h5_drxk = {
        .adr = 0x29,
        .single_master = 1,
+       .no_i2c_bridge = 1,
        .microcode_name = "terratec_h5.fw",
 };