The patch number 9455 was added via Manu Abraham <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]
------
From: Manu Abraham <[EMAIL PROTECTED]>
Cleanup: remove some superfluous stuff and dead commented out code
Signed-off-by: Manu Abraham <[EMAIL PROTECTED]>
---
linux/drivers/media/dvb/frontends/stb0899_algo.c | 48 +++------------
linux/drivers/media/dvb/frontends/stb0899_priv.h | 1
2 files changed, 11 insertions(+), 38 deletions(-)
diff -r 41663c61cebb -r b06284fcee4a
linux/drivers/media/dvb/frontends/stb0899_algo.c
--- a/linux/drivers/media/dvb/frontends/stb0899_algo.c Sat Jan 26 03:39:16
2008 +0400
+++ b/linux/drivers/media/dvb/frontends/stb0899_algo.c Sat Jan 26 03:56:21
2008 +0400
@@ -73,20 +73,16 @@ u32 stb0899_get_srate(struct stb0899_sta
*/
static u32 stb0899_set_srate(struct stb0899_state *state, u32 master_clk, u32
srate)
{
- u32 tmp, tmp_up, srate_up;
- u8 sfr_up[3], sfr[3];
-
-// srate_up = srate;
+ u32 tmp;
+ u8 sfr[3];
+
dprintk(state->verbose, FE_DEBUG, 1, "-->");
/*
* in order to have the maximum precision, the symbol rate entered into
* the chip is computed as the closest value of the "true value".
* In this purpose, the symbol rate value is rounded (1 is added on the
bit
* below the LSB )
- */
-// srate_up += (srate_up * 3) / 100;
-
- /*
+ *
* srate = (SFR * master_clk) >> 20
* <=>
* SFR = srate << 20 / master_clk
@@ -97,33 +93,26 @@ static u32 stb0899_set_srate(struct stb0
* stored as 20 bit number with an offset of 4 bit:
* sfr = SFR << 4;
*/
-// tmp_up = stb0899_do_div((((u64)srate_up) << 21) + master_clk, 2 *
master_clk);
-// tmp_up <<= 4;
tmp = stb0899_do_div((((u64)srate) << 21) + master_clk, 2 * master_clk);
tmp <<= 4;
-
-// sfr_up[0] = tmp_up >> 16;
-// sfr_up[1] = tmp_up >> 8;
-// sfr_up[2] = tmp_up;
sfr[0] = tmp >> 16;
sfr[1] = tmp >> 8;
sfr[2] = tmp;
-// stb0899_write_regs(state, STB0899_SFRUPH, sfr_up, 3);
stb0899_write_regs(state, STB0899_SFRH, sfr, 3);
return srate;
}
/*
- * stb0899_calc_loop_time
- * Compute the amount of time needed by the timing loop to lock
+ * stb0899_calc_derot_time
+ * Compute the amount of time needed by the derotator to lock
* SymbolRate: Symbol rate
- * return: timing loop time constant (ms)
- */
-static long stb0899_calc_loop_time(long srate)
+ * return: derotator time constant (ms)
+ */
+static long stb0899_calc_derot_time(long srate)
{
if (srate > 0)
return (100000 / (srate / 1000));
@@ -132,20 +121,6 @@ static long stb0899_calc_loop_time(long
}
/*
- * stb0899_calc_derot_time
- * Compute the amount of time needed by the derotator to lock
- * SymbolRate: Symbol rate
- * return: derotator time constant (ms)
- */
-static long stb0899_calc_derot_time(long srate)
-{
- if (srate > 0)
- return (100000 / (srate / 1000));
- else
- return 0;
-}
-
-/*
* stb0899_carr_width
* Compute the width of the carrier
* return: width of carrier (kHz or Mhz)
@@ -197,7 +172,7 @@ static enum stb0899_status stb0899_check
u8 reg;
s8 timing;
- msleep(internal->t_timing);
+ msleep(internal->t_derot);
stb0899_write_reg(state, STB0899_RTF, 0xf2);
reg = stb0899_read_reg(state, STB0899_TLIR);
@@ -574,7 +549,6 @@ enum stb0899_status stb0899_dvbs_algo(st
/* Initial calculations */
internal->derot_step = internal->derot_percent * (params->srate /
1000L) / internal->mclk; /* DerotStep/1000 * Fsymbol */
- internal->t_timing = stb0899_calc_loop_time(params->srate);
internal->t_derot = stb0899_calc_derot_time(params->srate);
internal->t_data = 500;
@@ -617,7 +591,7 @@ enum stb0899_status stb0899_dvbs_algo(st
if (state->config->tuner_get_frequency)
state->config->tuner_get_frequency(&state->frontend,
&internal->freq);
- msleep(internal->t_agc1 + internal->t_agc2 +
internal->t_timing); /* AGC1, AGC2 and timing loop */
+ msleep(internal->t_agc1 + internal->t_agc2 +
internal->t_derot); /* AGC1, AGC2 and timing loop */
dprintk(state->verbose, FE_DEBUG, 1, "current derot freq=%d",
internal->derot_freq);
internal->status = AGC1OK;
diff -r 41663c61cebb -r b06284fcee4a
linux/drivers/media/dvb/frontends/stb0899_priv.h
--- a/linux/drivers/media/dvb/frontends/stb0899_priv.h Sat Jan 26 03:39:16
2008 +0400
+++ b/linux/drivers/media/dvb/frontends/stb0899_priv.h Sat Jan 26 03:56:21
2008 +0400
@@ -182,7 +182,6 @@ struct stb0899_internal {
s16 direction; /* Current derotator
search direction */
s16 derot_step; /* Derotator step
(binary value) */
- s16 t_timing; /* Timing loop time
constant (ms) */
s16 t_derot; /* Derotator time
constant (ms) */
s16 t_data; /* Data recovery time
constant (ms) */
s16 sub_dir; /* Direction of the
next sub range */
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/b06284fcee4a9241018f32b7751a4d3e2b740ba7
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits