Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (9174): Allow custom inittab for ST STV0288 demodulator.

Allow custom inittab for ST STV0288 demodulator,
as it is needed for DvbWorld USB card.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Igor M. Liplianin and committed by
Mauro Carvalho Chehab
de9be0ea 82d7669d

+18 -4
+16 -4
drivers/media/dvb/frontends/stv0288.c
··· 328 328 { 329 329 struct stv0288_state *state = fe->demodulator_priv; 330 330 int i; 331 + u8 reg; 332 + u8 val; 331 333 332 334 dprintk("stv0288: init chip\n"); 333 335 stv0288_writeregI(state, 0x41, 0x04); 334 336 msleep(50); 335 337 336 - for (i = 0; !(stv0288_inittab[i] == 0xff && 338 + /* we have default inittab */ 339 + if (state->config->inittab == NULL) { 340 + for (i = 0; !(stv0288_inittab[i] == 0xff && 337 341 stv0288_inittab[i + 1] == 0xff); i += 2) 338 - stv0288_writeregI(state, stv0288_inittab[i], 339 - stv0288_inittab[i + 1]); 340 - 342 + stv0288_writeregI(state, stv0288_inittab[i], 343 + stv0288_inittab[i + 1]); 344 + } else { 345 + for (i = 0; ; i += 2) { 346 + reg = state->config->inittab[i]; 347 + val = state->config->inittab[i+1]; 348 + if (reg == 0xff && val == 0xff) 349 + break; 350 + stv0288_writeregI(state, reg, val); 351 + } 352 + } 341 353 return 0; 342 354 } 343 355
+2
drivers/media/dvb/frontends/stv0288.h
··· 34 34 /* the demodulator's i2c address */ 35 35 u8 demod_address; 36 36 37 + u8* inittab; 38 + 37 39 /* minimum delay before retuning */ 38 40 int min_delay_ms; 39 41