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

V4L/DVB (12098): Create table for customize stv0900 ts registers.

Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Igor M. Liplianin and committed by
Mauro Carvalho Chehab
f867c3f4 ee1ebcfe

+42 -5
+6 -1
drivers/media/dvb/frontends/stv0900.h
··· 29 29 #include <linux/dvb/frontend.h> 30 30 #include "dvb_frontend.h" 31 31 32 + struct stv0900_reg { 33 + u16 addr; 34 + u8 val; 35 + }; 36 + 32 37 struct stv0900_config { 33 38 u8 demod_address; 34 39 u32 xtal; ··· 43 38 44 39 u8 path1_mode; 45 40 u8 path2_mode; 46 - 41 + struct stv0900_reg *ts_config_regs; 47 42 u8 tun1_maddress;/* 0, 1, 2, 3 for 0xc0, 0xc2, 0xc4, 0xc6 */ 48 43 u8 tun2_maddress; 49 44 u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */
+19 -2
drivers/media/dvb/frontends/stv0900_core.c
··· 1393 1393 struct stv0900_state *state = fe->demodulator_priv; 1394 1394 enum fe_stv0900_error error = STV0900_NO_ERROR; 1395 1395 enum fe_stv0900_error demodError = STV0900_NO_ERROR; 1396 - int selosci; 1396 + int selosci, i; 1397 1397 1398 1398 struct stv0900_inode *temp_int = find_inode(state->i2c_adap, 1399 1399 state->config->demod_address); ··· 1440 1440 stv0900_write_bits(state->internal, F0900_P1_ROLLOFF_CONTROL, p_init->rolloff); 1441 1441 stv0900_write_bits(state->internal, F0900_P2_ROLLOFF_CONTROL, p_init->rolloff); 1442 1442 1443 - stv0900_set_ts_parallel_serial(state->internal, p_init->path1_ts_clock, p_init->path2_ts_clock); 1443 + state->internal->ts_config = p_init->ts_config; 1444 + if (state->internal->ts_config == NULL) 1445 + stv0900_set_ts_parallel_serial(state->internal, 1446 + p_init->path1_ts_clock, 1447 + p_init->path2_ts_clock); 1448 + else { 1449 + for (i = 0; state->internal->ts_config[i].addr != 0xffff; i++) 1450 + stv0900_write_reg(state->internal, 1451 + state->internal->ts_config[i].addr, 1452 + state->internal->ts_config[i].val); 1453 + 1454 + stv0900_write_bits(state->internal, F0900_P2_RST_HWARE, 1); 1455 + stv0900_write_bits(state->internal, F0900_P2_RST_HWARE, 0); 1456 + stv0900_write_bits(state->internal, F0900_P1_RST_HWARE, 1); 1457 + stv0900_write_bits(state->internal, F0900_P1_RST_HWARE, 0); 1458 + } 1459 + 1444 1460 stv0900_write_bits(state->internal, F0900_P1_TUN_MADDRESS, p_init->tun1_maddress); 1445 1461 switch (p_init->tuner1_adc) { 1446 1462 case 1: ··· 1970 1954 init_params.tun1_iq_inversion = STV0900_IQ_NORMAL; 1971 1955 init_params.tuner1_adc = config->tun1_adc; 1972 1956 init_params.path2_ts_clock = config->path2_mode; 1957 + init_params.ts_config = config->ts_config_regs; 1973 1958 init_params.tun2_maddress = config->tun2_maddress; 1974 1959 init_params.tuner2_adc = config->tun2_adc; 1975 1960 init_params.tun2_iq_inversion = STV0900_IQ_SWAPPED;
+2
drivers/media/dvb/frontends/stv0900_priv.h
··· 271 271 272 272 /* IQ from the tuner2 to the demod */ 273 273 enum stv0900_iq_inversion tun2_iq_inversion; 274 + struct stv0900_reg *ts_config; 274 275 }; 275 276 276 277 struct stv0900_search_params { ··· 364 363 u8 i2c_addr; 365 364 u8 clkmode;/* 0 for CLKI, 2 for XTALI */ 366 365 u8 chip_id; 366 + struct stv0900_reg *ts_config; 367 367 enum fe_stv0900_error errs; 368 368 int dmds_used; 369 369 };
+15 -2
drivers/media/video/cx23885/cx23885-dvb.c
··· 45 45 #include "dibx000_common.h" 46 46 #include "zl10353.h" 47 47 #include "stv0900.h" 48 + #include "stv0900_reg.h" 48 49 #include "stv6110.h" 49 50 #include "lnbh24.h" 50 51 #include "cx24116.h" ··· 371 370 .disable_i2c_gate_ctrl = 1, 372 371 }; 373 372 373 + static struct stv0900_reg stv0900_ts_regs[] = { 374 + { R0900_TSGENERAL, 0x00 }, 375 + { R0900_P1_TSSPEED, 0x40 }, 376 + { R0900_P2_TSSPEED, 0x40 }, 377 + { R0900_P1_TSCFGM, 0xc0 }, 378 + { R0900_P2_TSCFGM, 0xc0 }, 379 + { R0900_P1_TSCFGH, 0xe0 }, 380 + { R0900_P2_TSCFGH, 0xe0 }, 381 + { R0900_P1_TSCFGL, 0x20 }, 382 + { R0900_P2_TSCFGL, 0x20 }, 383 + { 0xffff, 0xff }, /* terminate */ 384 + }; 385 + 374 386 static struct stv0900_config netup_stv0900_config = { 375 387 .demod_address = 0x68, 376 388 .xtal = 27000000, 377 389 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */ 378 390 .diseqc_mode = 2,/* 2/3 PWM */ 379 - .path1_mode = 2,/*Serial continues clock */ 380 - .path2_mode = 2,/*Serial continues clock */ 391 + .ts_config_regs = stv0900_ts_regs, 381 392 .tun1_maddress = 0,/* 0x60 */ 382 393 .tun2_maddress = 3,/* 0x63 */ 383 394 .tun1_adc = 1,/* 1 Vpp */