diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2008-01-25 18:56:21 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:22 -0500 |
commit | b359325d1e4a67942626421ea1f203b41adc9712 (patch) | |
tree | b8ef01f1c0e61d862721c94fe13cbc179b64faae /drivers/media/dvb/frontends | |
parent | 3d6a3bebda2093cf563266bbfa0f1f1b1ae8fd41 (diff) |
V4L/DVB (9455): Cleanup: remove some superfluous stuff and dead commented out code
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r-- | drivers/media/dvb/frontends/stb0899_algo.c | 36 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stb0899_priv.h | 1 |
2 files changed, 5 insertions, 32 deletions
diff --git a/drivers/media/dvb/frontends/stb0899_algo.c b/drivers/media/dvb/frontends/stb0899_algo.c index 65bc032964b1..b7752473f7a7 100644 --- a/drivers/media/dvb/frontends/stb0899_algo.c +++ b/drivers/media/dvb/frontends/stb0899_algo.c | |||
@@ -73,20 +73,16 @@ u32 stb0899_get_srate(struct stb0899_state *state) | |||
73 | */ | 73 | */ |
74 | static u32 stb0899_set_srate(struct stb0899_state *state, u32 master_clk, u32 srate) | 74 | static u32 stb0899_set_srate(struct stb0899_state *state, u32 master_clk, u32 srate) |
75 | { | 75 | { |
76 | u32 tmp, tmp_up, srate_up; | 76 | u32 tmp; |
77 | u8 sfr_up[3], sfr[3]; | 77 | u8 sfr[3]; |
78 | 78 | ||
79 | // srate_up = srate; | ||
80 | dprintk(state->verbose, FE_DEBUG, 1, "-->"); | 79 | dprintk(state->verbose, FE_DEBUG, 1, "-->"); |
81 | /* | 80 | /* |
82 | * in order to have the maximum precision, the symbol rate entered into | 81 | * in order to have the maximum precision, the symbol rate entered into |
83 | * the chip is computed as the closest value of the "true value". | 82 | * the chip is computed as the closest value of the "true value". |
84 | * In this purpose, the symbol rate value is rounded (1 is added on the bit | 83 | * In this purpose, the symbol rate value is rounded (1 is added on the bit |
85 | * below the LSB ) | 84 | * below the LSB ) |
86 | */ | 85 | * |
87 | // srate_up += (srate_up * 3) / 100; | ||
88 | |||
89 | /* | ||
90 | * srate = (SFR * master_clk) >> 20 | 86 | * srate = (SFR * master_clk) >> 20 |
91 | * <=> | 87 | * <=> |
92 | * SFR = srate << 20 / master_clk | 88 | * SFR = srate << 20 / master_clk |
@@ -97,41 +93,20 @@ static u32 stb0899_set_srate(struct stb0899_state *state, u32 master_clk, u32 sr | |||
97 | * stored as 20 bit number with an offset of 4 bit: | 93 | * stored as 20 bit number with an offset of 4 bit: |
98 | * sfr = SFR << 4; | 94 | * sfr = SFR << 4; |
99 | */ | 95 | */ |
100 | // tmp_up = stb0899_do_div((((u64)srate_up) << 21) + master_clk, 2 * master_clk); | ||
101 | // tmp_up <<= 4; | ||
102 | 96 | ||
103 | tmp = stb0899_do_div((((u64)srate) << 21) + master_clk, 2 * master_clk); | 97 | tmp = stb0899_do_div((((u64)srate) << 21) + master_clk, 2 * master_clk); |
104 | tmp <<= 4; | 98 | tmp <<= 4; |
105 | 99 | ||
106 | // sfr_up[0] = tmp_up >> 16; | ||
107 | // sfr_up[1] = tmp_up >> 8; | ||
108 | // sfr_up[2] = tmp_up; | ||
109 | |||
110 | sfr[0] = tmp >> 16; | 100 | sfr[0] = tmp >> 16; |
111 | sfr[1] = tmp >> 8; | 101 | sfr[1] = tmp >> 8; |
112 | sfr[2] = tmp; | 102 | sfr[2] = tmp; |
113 | 103 | ||
114 | // stb0899_write_regs(state, STB0899_SFRUPH, sfr_up, 3); | ||
115 | stb0899_write_regs(state, STB0899_SFRH, sfr, 3); | 104 | stb0899_write_regs(state, STB0899_SFRH, sfr, 3); |
116 | 105 | ||
117 | return srate; | 106 | return srate; |
118 | } | 107 | } |
119 | 108 | ||
120 | /* | 109 | /* |
121 | * stb0899_calc_loop_time | ||
122 | * Compute the amount of time needed by the timing loop to lock | ||
123 | * SymbolRate: Symbol rate | ||
124 | * return: timing loop time constant (ms) | ||
125 | */ | ||
126 | static long stb0899_calc_loop_time(long srate) | ||
127 | { | ||
128 | if (srate > 0) | ||
129 | return (100000 / (srate / 1000)); | ||
130 | else | ||
131 | return 0; | ||
132 | } | ||
133 | |||
134 | /* | ||
135 | * stb0899_calc_derot_time | 110 | * stb0899_calc_derot_time |
136 | * Compute the amount of time needed by the derotator to lock | 111 | * Compute the amount of time needed by the derotator to lock |
137 | * SymbolRate: Symbol rate | 112 | * SymbolRate: Symbol rate |
@@ -197,7 +172,7 @@ static enum stb0899_status stb0899_check_tmg(struct stb0899_state *state) | |||
197 | u8 reg; | 172 | u8 reg; |
198 | s8 timing; | 173 | s8 timing; |
199 | 174 | ||
200 | msleep(internal->t_timing); | 175 | msleep(internal->t_derot); |
201 | 176 | ||
202 | stb0899_write_reg(state, STB0899_RTF, 0xf2); | 177 | stb0899_write_reg(state, STB0899_RTF, 0xf2); |
203 | reg = stb0899_read_reg(state, STB0899_TLIR); | 178 | reg = stb0899_read_reg(state, STB0899_TLIR); |
@@ -574,7 +549,6 @@ enum stb0899_status stb0899_dvbs_algo(struct stb0899_state *state) | |||
574 | 549 | ||
575 | /* Initial calculations */ | 550 | /* Initial calculations */ |
576 | internal->derot_step = internal->derot_percent * (params->srate / 1000L) / internal->mclk; /* DerotStep/1000 * Fsymbol */ | 551 | internal->derot_step = internal->derot_percent * (params->srate / 1000L) / internal->mclk; /* DerotStep/1000 * Fsymbol */ |
577 | internal->t_timing = stb0899_calc_loop_time(params->srate); | ||
578 | internal->t_derot = stb0899_calc_derot_time(params->srate); | 552 | internal->t_derot = stb0899_calc_derot_time(params->srate); |
579 | internal->t_data = 500; | 553 | internal->t_data = 500; |
580 | 554 | ||
@@ -617,7 +591,7 @@ enum stb0899_status stb0899_dvbs_algo(struct stb0899_state *state) | |||
617 | if (state->config->tuner_get_frequency) | 591 | if (state->config->tuner_get_frequency) |
618 | state->config->tuner_get_frequency(&state->frontend, &internal->freq); | 592 | state->config->tuner_get_frequency(&state->frontend, &internal->freq); |
619 | 593 | ||
620 | msleep(internal->t_agc1 + internal->t_agc2 + internal->t_timing); /* AGC1, AGC2 and timing loop */ | 594 | msleep(internal->t_agc1 + internal->t_agc2 + internal->t_derot); /* AGC1, AGC2 and timing loop */ |
621 | dprintk(state->verbose, FE_DEBUG, 1, "current derot freq=%d", internal->derot_freq); | 595 | dprintk(state->verbose, FE_DEBUG, 1, "current derot freq=%d", internal->derot_freq); |
622 | internal->status = AGC1OK; | 596 | internal->status = AGC1OK; |
623 | 597 | ||
diff --git a/drivers/media/dvb/frontends/stb0899_priv.h b/drivers/media/dvb/frontends/stb0899_priv.h index f9b8f51446a6..8a7c4ee087d8 100644 --- a/drivers/media/dvb/frontends/stb0899_priv.h +++ b/drivers/media/dvb/frontends/stb0899_priv.h | |||
@@ -182,7 +182,6 @@ struct stb0899_internal { | |||
182 | 182 | ||
183 | s16 direction; /* Current derotator search direction */ | 183 | s16 direction; /* Current derotator search direction */ |
184 | s16 derot_step; /* Derotator step (binary value) */ | 184 | s16 derot_step; /* Derotator step (binary value) */ |
185 | s16 t_timing; /* Timing loop time constant (ms) */ | ||
186 | s16 t_derot; /* Derotator time constant (ms) */ | 185 | s16 t_derot; /* Derotator time constant (ms) */ |
187 | s16 t_data; /* Data recovery time constant (ms) */ | 186 | s16 t_data; /* Data recovery time constant (ms) */ |
188 | s16 sub_dir; /* Direction of the next sub range */ | 187 | s16 sub_dir; /* Direction of the next sub range */ |