diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:46:06 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:52 -0400 |
commit | 5555309c9adcf9bb7f6b449ef45b09d5c26ef4ae (patch) | |
tree | 43cde0dd327dffe23bcbaf9612e64299566f7485 | |
parent | ab8b870e430d3e2cfb299f81e0ae0aef7fe5bfda (diff) |
V4L/DVB (7383): tda18271: add attach-time parameter to limit i2c transfer size
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/frontends/tda18271-common.c | 7 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda18271-fe.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda18271-priv.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda18271.h | 3 |
4 files changed, 13 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-common.c b/drivers/media/dvb/frontends/tda18271-common.c index 39496463ccf3..bbfc22a5f6db 100644 --- a/drivers/media/dvb/frontends/tda18271-common.c +++ b/drivers/media/dvb/frontends/tda18271-common.c | |||
@@ -311,7 +311,12 @@ int tda18271_init_regs(struct dvb_frontend *fe) | |||
311 | regs[R_EB22] = 0x48; | 311 | regs[R_EB22] = 0x48; |
312 | regs[R_EB23] = 0xb0; | 312 | regs[R_EB23] = 0xb0; |
313 | 313 | ||
314 | tda18271_write_regs(fe, 0x00, TDA18271_NUM_REGS); | 314 | if (priv->small_i2c) { |
315 | tda18271_write_regs(fe, 0x00, 0x10); | ||
316 | tda18271_write_regs(fe, 0x10, 0x10); | ||
317 | tda18271_write_regs(fe, 0x20, 0x07); | ||
318 | } else | ||
319 | tda18271_write_regs(fe, 0x00, TDA18271_NUM_REGS); | ||
315 | 320 | ||
316 | /* setup agc1 gain */ | 321 | /* setup agc1 gain */ |
317 | regs[R_EB17] = 0x00; | 322 | regs[R_EB17] = 0x00; |
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c index b5d69a8108d9..bb0a65310b71 100644 --- a/drivers/media/dvb/frontends/tda18271-fe.c +++ b/drivers/media/dvb/frontends/tda18271-fe.c | |||
@@ -1081,6 +1081,9 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, | |||
1081 | 1081 | ||
1082 | fe->tuner_priv = priv; | 1082 | fe->tuner_priv = priv; |
1083 | 1083 | ||
1084 | if (cfg) | ||
1085 | priv->small_i2c = cfg->small_i2c; | ||
1086 | |||
1084 | if (tda18271_get_id(fe) < 0) | 1087 | if (tda18271_get_id(fe) < 0) |
1085 | goto fail; | 1088 | goto fail; |
1086 | 1089 | ||
diff --git a/drivers/media/dvb/frontends/tda18271-priv.h b/drivers/media/dvb/frontends/tda18271-priv.h index 840b1803d171..ecb588e5f7d5 100644 --- a/drivers/media/dvb/frontends/tda18271-priv.h +++ b/drivers/media/dvb/frontends/tda18271-priv.h | |||
@@ -110,6 +110,7 @@ struct tda18271_priv { | |||
110 | 110 | ||
111 | unsigned int tm_rfcal; | 111 | unsigned int tm_rfcal; |
112 | unsigned int cal_initialized:1; | 112 | unsigned int cal_initialized:1; |
113 | unsigned int small_i2c:1; | ||
113 | 114 | ||
114 | struct tda18271_map_layout *maps; | 115 | struct tda18271_map_layout *maps; |
115 | struct tda18271_std_map std; | 116 | struct tda18271_std_map std; |
diff --git a/drivers/media/dvb/frontends/tda18271.h b/drivers/media/dvb/frontends/tda18271.h index 24b0e35a2ab3..e79441e22718 100644 --- a/drivers/media/dvb/frontends/tda18271.h +++ b/drivers/media/dvb/frontends/tda18271.h | |||
@@ -58,6 +58,9 @@ struct tda18271_config { | |||
58 | 58 | ||
59 | /* use i2c gate provided by analog or digital demod */ | 59 | /* use i2c gate provided by analog or digital demod */ |
60 | enum tda18271_i2c_gate gate; | 60 | enum tda18271_i2c_gate gate; |
61 | |||
62 | /* some i2c providers cant write all 39 registers at once */ | ||
63 | unsigned int small_i2c:1; | ||
61 | }; | 64 | }; |
62 | 65 | ||
63 | #if defined(CONFIG_DVB_TDA18271) || (defined(CONFIG_DVB_TDA18271_MODULE) && defined(MODULE)) | 66 | #if defined(CONFIG_DVB_TDA18271) || (defined(CONFIG_DVB_TDA18271_MODULE) && defined(MODULE)) |