[media] drxk: Allow to disable I2C Bridge control switch
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>
diff --git a/drivers/media/dvb/frontends/drxk.h b/drivers/media/dvb/frontends/drxk.h
index dd54512..9c99f31 100644
--- a/drivers/media/dvb/frontends/drxk.h
+++ b/drivers/media/dvb/frontends/drxk.h
@@ -7,6 +7,7 @@
struct drxk_config {
u8 adr;
u32 single_master : 1;
+ u32 no_i2c_bridge : 1;
const char *microcode_name;
};
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index adb454a..5233526 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -2784,6 +2784,8 @@
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 @@
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);
diff --git a/drivers/media/dvb/frontends/drxk_hard.h b/drivers/media/dvb/frontends/drxk_hard.h
index 8cdadce..b042755 100644
--- a/drivers/media/dvb/frontends/drxk_hard.h
+++ b/drivers/media/dvb/frontends/drxk_hard.h
@@ -330,6 +330,7 @@
/* 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;
};
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index 93f0af5..9b2be03 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -304,6 +304,7 @@
struct drxk_config terratec_h5_drxk = {
.adr = 0x29,
.single_master = 1,
+ .no_i2c_bridge = 1,
.microcode_name = "terratec_h5.fw",
};