diff options
-rw-r--r-- | drivers/media/dvb/frontends/stv0900.h | 7 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0900_core.c | 21 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0900_priv.h | 2 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 17 |
4 files changed, 42 insertions, 5 deletions
diff --git a/drivers/media/dvb/frontends/stv0900.h b/drivers/media/dvb/frontends/stv0900.h index 8a1332c2031..bf4e9b63304 100644 --- a/drivers/media/dvb/frontends/stv0900.h +++ b/drivers/media/dvb/frontends/stv0900.h | |||
@@ -29,6 +29,11 @@ | |||
29 | #include <linux/dvb/frontend.h> | 29 | #include <linux/dvb/frontend.h> |
30 | #include "dvb_frontend.h" | 30 | #include "dvb_frontend.h" |
31 | 31 | ||
32 | struct stv0900_reg { | ||
33 | u16 addr; | ||
34 | u8 val; | ||
35 | }; | ||
36 | |||
32 | struct stv0900_config { | 37 | struct stv0900_config { |
33 | u8 demod_address; | 38 | u8 demod_address; |
34 | u32 xtal; | 39 | u32 xtal; |
@@ -38,7 +43,7 @@ struct stv0900_config { | |||
38 | 43 | ||
39 | u8 path1_mode; | 44 | u8 path1_mode; |
40 | u8 path2_mode; | 45 | u8 path2_mode; |
41 | 46 | struct stv0900_reg *ts_config_regs; | |
42 | u8 tun1_maddress;/* 0, 1, 2, 3 for 0xc0, 0xc2, 0xc4, 0xc6 */ | 47 | u8 tun1_maddress;/* 0, 1, 2, 3 for 0xc0, 0xc2, 0xc4, 0xc6 */ |
43 | u8 tun2_maddress; | 48 | u8 tun2_maddress; |
44 | u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */ | 49 | u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */ |
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c index 9ab4f301467..1da045fbb4e 100644 --- a/drivers/media/dvb/frontends/stv0900_core.c +++ b/drivers/media/dvb/frontends/stv0900_core.c | |||
@@ -1393,7 +1393,7 @@ static enum fe_stv0900_error stv0900_init_internal(struct dvb_frontend *fe, | |||
1393 | struct stv0900_state *state = fe->demodulator_priv; | 1393 | struct stv0900_state *state = fe->demodulator_priv; |
1394 | enum fe_stv0900_error error = STV0900_NO_ERROR; | 1394 | enum fe_stv0900_error error = STV0900_NO_ERROR; |
1395 | enum fe_stv0900_error demodError = STV0900_NO_ERROR; | 1395 | enum fe_stv0900_error demodError = STV0900_NO_ERROR; |
1396 | int selosci; | 1396 | int selosci, i; |
1397 | 1397 | ||
1398 | struct stv0900_inode *temp_int = find_inode(state->i2c_adap, | 1398 | struct stv0900_inode *temp_int = find_inode(state->i2c_adap, |
1399 | state->config->demod_address); | 1399 | state->config->demod_address); |
@@ -1440,7 +1440,23 @@ static enum fe_stv0900_error stv0900_init_internal(struct dvb_frontend *fe, | |||
1440 | stv0900_write_bits(state->internal, F0900_P1_ROLLOFF_CONTROL, p_init->rolloff); | 1440 | stv0900_write_bits(state->internal, F0900_P1_ROLLOFF_CONTROL, p_init->rolloff); |
1441 | stv0900_write_bits(state->internal, F0900_P2_ROLLOFF_CONTROL, p_init->rolloff); | 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 | stv0900_write_bits(state->internal, F0900_P1_TUN_MADDRESS, p_init->tun1_maddress); | 1460 | stv0900_write_bits(state->internal, F0900_P1_TUN_MADDRESS, p_init->tun1_maddress); |
1445 | switch (p_init->tuner1_adc) { | 1461 | switch (p_init->tuner1_adc) { |
1446 | case 1: | 1462 | case 1: |
@@ -1954,6 +1970,7 @@ struct dvb_frontend *stv0900_attach(const struct stv0900_config *config, | |||
1954 | init_params.tun1_iq_inversion = STV0900_IQ_NORMAL; | 1970 | init_params.tun1_iq_inversion = STV0900_IQ_NORMAL; |
1955 | init_params.tuner1_adc = config->tun1_adc; | 1971 | init_params.tuner1_adc = config->tun1_adc; |
1956 | init_params.path2_ts_clock = config->path2_mode; | 1972 | init_params.path2_ts_clock = config->path2_mode; |
1973 | init_params.ts_config = config->ts_config_regs; | ||
1957 | init_params.tun2_maddress = config->tun2_maddress; | 1974 | init_params.tun2_maddress = config->tun2_maddress; |
1958 | init_params.tuner2_adc = config->tun2_adc; | 1975 | init_params.tuner2_adc = config->tun2_adc; |
1959 | init_params.tun2_iq_inversion = STV0900_IQ_SWAPPED; | 1976 | init_params.tun2_iq_inversion = STV0900_IQ_SWAPPED; |
diff --git a/drivers/media/dvb/frontends/stv0900_priv.h b/drivers/media/dvb/frontends/stv0900_priv.h index 67dc8ec634e..5ed7a145c7d 100644 --- a/drivers/media/dvb/frontends/stv0900_priv.h +++ b/drivers/media/dvb/frontends/stv0900_priv.h | |||
@@ -271,6 +271,7 @@ struct stv0900_init_params{ | |||
271 | 271 | ||
272 | /* IQ from the tuner2 to the demod */ | 272 | /* IQ from the tuner2 to the demod */ |
273 | enum stv0900_iq_inversion tun2_iq_inversion; | 273 | enum stv0900_iq_inversion tun2_iq_inversion; |
274 | struct stv0900_reg *ts_config; | ||
274 | }; | 275 | }; |
275 | 276 | ||
276 | struct stv0900_search_params { | 277 | struct stv0900_search_params { |
@@ -363,6 +364,7 @@ struct stv0900_internal{ | |||
363 | u8 i2c_addr; | 364 | u8 i2c_addr; |
364 | u8 clkmode;/* 0 for CLKI, 2 for XTALI */ | 365 | u8 clkmode;/* 0 for CLKI, 2 for XTALI */ |
365 | u8 chip_id; | 366 | u8 chip_id; |
367 | struct stv0900_reg *ts_config; | ||
366 | enum fe_stv0900_error errs; | 368 | enum fe_stv0900_error errs; |
367 | int dmds_used; | 369 | int dmds_used; |
368 | }; | 370 | }; |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index 236eea0c41e..48de57b61f6 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include "dibx000_common.h" | 45 | #include "dibx000_common.h" |
46 | #include "zl10353.h" | 46 | #include "zl10353.h" |
47 | #include "stv0900.h" | 47 | #include "stv0900.h" |
48 | #include "stv0900_reg.h" | ||
48 | #include "stv6110.h" | 49 | #include "stv6110.h" |
49 | #include "lnbh24.h" | 50 | #include "lnbh24.h" |
50 | #include "cx24116.h" | 51 | #include "cx24116.h" |
@@ -370,13 +371,25 @@ static struct zl10353_config dvico_fusionhdtv_xc3028 = { | |||
370 | .disable_i2c_gate_ctrl = 1, | 371 | .disable_i2c_gate_ctrl = 1, |
371 | }; | 372 | }; |
372 | 373 | ||
374 | static struct stv0900_reg stv0900_ts_regs[] = { | ||
375 | { R0900_TSGENERAL, 0x00 }, | ||
376 | { R0900_P1_TSSPEED, 0x40 }, | ||
377 | { R0900_P2_TSSPEED, 0x40 }, | ||
378 | { R0900_P1_TSCFGM, 0xc0 }, | ||
379 | { R0900_P2_TSCFGM, 0xc0 }, | ||
380 | { R0900_P1_TSCFGH, 0xe0 }, | ||
381 | { R0900_P2_TSCFGH, 0xe0 }, | ||
382 | { R0900_P1_TSCFGL, 0x20 }, | ||
383 | { R0900_P2_TSCFGL, 0x20 }, | ||
384 | { 0xffff, 0xff }, /* terminate */ | ||
385 | }; | ||
386 | |||
373 | static struct stv0900_config netup_stv0900_config = { | 387 | static struct stv0900_config netup_stv0900_config = { |
374 | .demod_address = 0x68, | 388 | .demod_address = 0x68, |
375 | .xtal = 27000000, | 389 | .xtal = 27000000, |
376 | .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */ | 390 | .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */ |
377 | .diseqc_mode = 2,/* 2/3 PWM */ | 391 | .diseqc_mode = 2,/* 2/3 PWM */ |
378 | .path1_mode = 2,/*Serial continues clock */ | 392 | .ts_config_regs = stv0900_ts_regs, |
379 | .path2_mode = 2,/*Serial continues clock */ | ||
380 | .tun1_maddress = 0,/* 0x60 */ | 393 | .tun1_maddress = 0,/* 0x60 */ |
381 | .tun2_maddress = 3,/* 0x63 */ | 394 | .tun2_maddress = 3,/* 0x63 */ |
382 | .tun1_adc = 1,/* 1 Vpp */ | 395 | .tun1_adc = 1,/* 1 Vpp */ |