summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-03-16 00:13:09 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2008-03-16 00:13:09 -0400
commiteb7c9b051872740cb59da357e90b5dae2d67ac12 (patch)
treeb605917607b73ea856b457a62c3d9f2ad770c3d3 /linux/drivers/media/dvb/frontends
parentcafc731a90a72a074c05cf2d7e4a67f3fa596b76 (diff)
downloadmediapointer-dvb-s2-eb7c9b051872740cb59da357e90b5dae2d67ac12.tar.gz
mediapointer-dvb-s2-eb7c9b051872740cb59da357e90b5dae2d67ac12.tar.bz2
tda18271: add attach-time parameter to limit i2c transfer size
From: Michael Krufky <mkrufky@linuxtv.org> Add attach-time parameter, "small_i2c" to limit i2c transfer size to write at most 16 registers at a time during initialization. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r--linux/drivers/media/dvb/frontends/tda18271-common.c7
-rw-r--r--linux/drivers/media/dvb/frontends/tda18271-fe.c3
-rw-r--r--linux/drivers/media/dvb/frontends/tda18271-priv.h1
-rw-r--r--linux/drivers/media/dvb/frontends/tda18271.h3
4 files changed, 13 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda18271-common.c b/linux/drivers/media/dvb/frontends/tda18271-common.c
index d0596b999..e5e8a7497 100644
--- a/linux/drivers/media/dvb/frontends/tda18271-common.c
+++ b/linux/drivers/media/dvb/frontends/tda18271-common.c
@@ -311,7 +311,12 @@ int tda18271_init_regs(struct dvb_frontend *fe)
regs[R_EB22] = 0x48;
regs[R_EB23] = 0xb0;
- tda18271_write_regs(fe, 0x00, TDA18271_NUM_REGS);
+ if (priv->small_i2c) {
+ tda18271_write_regs(fe, 0x00, 0x10);
+ tda18271_write_regs(fe, 0x10, 0x10);
+ tda18271_write_regs(fe, 0x20, 0x07);
+ } else
+ tda18271_write_regs(fe, 0x00, TDA18271_NUM_REGS);
/* setup agc1 gain */
regs[R_EB17] = 0x00;
diff --git a/linux/drivers/media/dvb/frontends/tda18271-fe.c b/linux/drivers/media/dvb/frontends/tda18271-fe.c
index dfa7456de..201207fd6 100644
--- a/linux/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/linux/drivers/media/dvb/frontends/tda18271-fe.c
@@ -1105,6 +1105,9 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
fe->tuner_priv = priv;
+ if (cfg)
+ priv->small_i2c = cfg->small_i2c;
+
if (tda18271_get_id(fe) < 0)
goto fail;
diff --git a/linux/drivers/media/dvb/frontends/tda18271-priv.h b/linux/drivers/media/dvb/frontends/tda18271-priv.h
index 5f8af8140..85eb24af7 100644
--- a/linux/drivers/media/dvb/frontends/tda18271-priv.h
+++ b/linux/drivers/media/dvb/frontends/tda18271-priv.h
@@ -115,6 +115,7 @@ struct tda18271_priv {
unsigned int tm_rfcal;
unsigned int cal_initialized:1;
+ unsigned int small_i2c:1;
struct tda18271_map_layout *maps;
struct tda18271_std_map std;
diff --git a/linux/drivers/media/dvb/frontends/tda18271.h b/linux/drivers/media/dvb/frontends/tda18271.h
index 24b0e35a2..e79441e22 100644
--- a/linux/drivers/media/dvb/frontends/tda18271.h
+++ b/linux/drivers/media/dvb/frontends/tda18271.h
@@ -58,6 +58,9 @@ struct tda18271_config {
/* use i2c gate provided by analog or digital demod */
enum tda18271_i2c_gate gate;
+
+ /* some i2c providers cant write all 39 registers at once */
+ unsigned int small_i2c:1;
};
#if defined(CONFIG_DVB_TDA18271) || (defined(CONFIG_DVB_TDA18271_MODULE) && defined(MODULE))