diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2010-01-10 13:40:28 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:38 -0500 |
commit | d8b5a8e449a08a1a87170144a42d0a0b167bcad6 (patch) | |
tree | 0ffbcd5c8f7f46a8c50b56dcf2660a9fff9975d0 /drivers/media/dvb | |
parent | 41894b97009adcabc51c6a4943045fd944c46236 (diff) |
V4L/DVB (13988): [STV090x] Configuration parameters adc1_range, adc2_range, tuner_bbgain
Add parameters adc1_range, adc2_range and tuner_bbgain to the config struct.
Defaults: adc1_range = adc2_range = 2Vpp, tuner_bbgain = 10db
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/frontends/stv090x.c | 19 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv090x.h | 9 |
2 files changed, 27 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index a5bae404701c..e1d4647b1a99 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c | |||
@@ -3237,7 +3237,10 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state) | |||
3237 | goto err; | 3237 | goto err; |
3238 | 3238 | ||
3239 | if (state->config->tuner_set_bbgain) { | 3239 | if (state->config->tuner_set_bbgain) { |
3240 | if (state->config->tuner_set_bbgain(fe, 10) < 0) /* 10dB */ | 3240 | reg = state->config->tuner_bbgain; |
3241 | if (reg == 0) | ||
3242 | reg = 10; /* default: 10dB */ | ||
3243 | if (state->config->tuner_set_bbgain(fe, reg) < 0) | ||
3241 | goto err_gateoff; | 3244 | goto err_gateoff; |
3242 | } | 3245 | } |
3243 | 3246 | ||
@@ -4446,6 +4449,20 @@ static int stv090x_setup(struct dvb_frontend *fe) | |||
4446 | state->internal->dev_ver); | 4449 | state->internal->dev_ver); |
4447 | } | 4450 | } |
4448 | 4451 | ||
4452 | /* ADC1 range */ | ||
4453 | reg = stv090x_read_reg(state, STV090x_TSTTNR1); | ||
4454 | STV090x_SETFIELD(reg, ADC1_INMODE_FIELD, | ||
4455 | (config->adc1_range == STV090x_ADC_1Vpp) ? 0 : 1); | ||
4456 | if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) | ||
4457 | goto err; | ||
4458 | |||
4459 | /* ADC2 range */ | ||
4460 | reg = stv090x_read_reg(state, STV090x_TSTTNR3); | ||
4461 | STV090x_SETFIELD(reg, ADC2_INMODE_FIELD, | ||
4462 | (config->adc2_range == STV090x_ADC_1Vpp) ? 0 : 1); | ||
4463 | if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) | ||
4464 | goto err; | ||
4465 | |||
4449 | if (stv090x_write_reg(state, STV090x_TSTRES0, 0x80) < 0) | 4466 | if (stv090x_write_reg(state, STV090x_TSTRES0, 0x80) < 0) |
4450 | goto err; | 4467 | goto err; |
4451 | if (stv090x_write_reg(state, STV090x_TSTRES0, 0x00) < 0) | 4468 | if (stv090x_write_reg(state, STV090x_TSTRES0, 0x00) < 0) |
diff --git a/drivers/media/dvb/frontends/stv090x.h b/drivers/media/dvb/frontends/stv090x.h index 96e3dc758e08..30f01a6902ac 100644 --- a/drivers/media/dvb/frontends/stv090x.h +++ b/drivers/media/dvb/frontends/stv090x.h | |||
@@ -60,6 +60,11 @@ enum stv090x_i2crpt { | |||
60 | STV090x_RPTLEVEL_2 = 7, | 60 | STV090x_RPTLEVEL_2 = 7, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | enum stv090x_adc_range { | ||
64 | STV090x_ADC_2Vpp = 0, | ||
65 | STV090x_ADC_1Vpp = 1 | ||
66 | }; | ||
67 | |||
63 | struct stv090x_config { | 68 | struct stv090x_config { |
64 | enum stv090x_device device; | 69 | enum stv090x_device device; |
65 | enum stv090x_mode demod_mode; | 70 | enum stv090x_mode demod_mode; |
@@ -75,6 +80,10 @@ struct stv090x_config { | |||
75 | 80 | ||
76 | enum stv090x_i2crpt repeater_level; | 81 | enum stv090x_i2crpt repeater_level; |
77 | 82 | ||
83 | u8 tuner_bbgain; /* default: 10db */ | ||
84 | enum stv090x_adc_range adc1_range; /* default: 2Vpp */ | ||
85 | enum stv090x_adc_range adc2_range; /* default: 2Vpp */ | ||
86 | |||
78 | bool diseqc_envelope_mode; | 87 | bool diseqc_envelope_mode; |
79 | 88 | ||
80 | int (*tuner_init) (struct dvb_frontend *fe); | 89 | int (*tuner_init) (struct dvb_frontend *fe); |