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>
        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;
 
 
                fe->tuner_priv = priv;
 
+               if (cfg)
+                       priv->small_i2c = cfg->small_i2c;
+
                if (tda18271_get_id(fe) < 0)
                        goto fail;
 
 
 
        unsigned int tm_rfcal;
        unsigned int cal_initialized:1;
+       unsigned int small_i2c:1;
 
        struct tda18271_map_layout *maps;
        struct tda18271_std_map std;
 
 
        /* 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))