diff options
author | Manu Abraham <manu@linuxtv.org> | 2009-04-09 03:30:29 +0400 |
---|---|---|
committer | Manu Abraham <manu@linuxtv.org> | 2009-04-09 03:30:29 +0400 |
commit | 0d047c69b6b735f6fc53dcbc268fe5a106e9efde (patch) | |
tree | 052758effe90ed004873abacb389ced9655441de /linux | |
parent | a4d648b94c25506bd0bfa3665c4481d1be4924bd (diff) | |
download | mediapointer-dvb-s2-0d047c69b6b735f6fc53dcbc268fe5a106e9efde.tar.gz mediapointer-dvb-s2-0d047c69b6b735f6fc53dcbc268fe5a106e9efde.tar.bz2 |
Code Simplification
From: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv090x.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv090x.c b/linux/drivers/media/dvb/frontends/stv090x.c index 2044288a3..2c7b5e6e3 100644 --- a/linux/drivers/media/dvb/frontends/stv090x.c +++ b/linux/drivers/media/dvb/frontends/stv090x.c @@ -3007,23 +3007,22 @@ static enum stv090x_delsys stv090x_get_std(struct stv090x_state *state) static s32 stv090x_get_car_freq(struct stv090x_state *state, u32 mclk) { s32 derot, int_1, int_2, tmp_1, tmp_2; - u32 pow2; derot = STV090x_READ_DEMOD(state, CFR2) << 16; derot |= STV090x_READ_DEMOD(state, CFR1) << 8; derot |= STV090x_READ_DEMOD(state, CFR0); derot = comp2(derot, 24); - pow2 = 1 << 12; - int_1 = state->mclk / pow2; - int_2 = derot / pow2; + int_1 = state->mclk >> 12; + int_2 = derot >> 12; - tmp_1 = state->mclk % pow2; - tmp_2 = derot % pow2; + /* carrier_frequency = MasterClock * Reg / 2^24 */ + tmp_1 = state->mclk % 0x1000; + tmp_2 = derot % 0x1000; derot = (int_1 * int_2) + - ((int_1 * tmp_2) / pow2) + - ((int_1 * tmp_1) / pow2); + ((int_1 * tmp_2) >> 12) + + ((int_1 * tmp_1) >> 12); return derot; } |