diff options
author | Igor M. Liplianin <liplianin@netup.ru> | 2009-06-19 04:45:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-23 02:14:12 -0400 |
commit | f867c3f4eab1d5006df4f3734fab1134feffbeba (patch) | |
tree | 201173fa992dab326ec674def03247e58863149e /drivers/media/dvb | |
parent | ee1ebcfea6ee16491f88e8023554dd214e1ba85c (diff) |
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>
Diffstat (limited to 'drivers/media/dvb')
-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 |
3 files changed, 27 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/stv0900.h b/drivers/media/dvb/frontends/stv0900.h index 8a1332c2031d..bf4e9b633044 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 9ab4f3014673..1da045fbb4ef 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 67dc8ec634e2..5ed7a145c7d3 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 | }; |