Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333747
b: refs/heads/master
c: 182b967
h: refs/heads/master
i:
  333745: 3819fbc
  333743: 81a4f03
v: v3
  • Loading branch information
Hans-Frieder Vogt authored and Mauro Carvalho Chehab committed Oct 5, 2012
1 parent 9c5d7a6 commit c6eeea4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b6faacd759933841c531c662c7eaa3046676fcc
refs/heads/master: 182b967e1119d22889e334c8f1c1b75df41f9165
16 changes: 9 additions & 7 deletions trunk/drivers/media/dvb-frontends/af9033.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
{
struct af9033_state *state = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i, spec_inv;
int ret, i, spec_inv, sampling_freq;
u8 tmp, buf[3], bandwidth_reg_val;
u32 if_frequency, freq_cw, adc_freq;

Expand Down Expand Up @@ -465,18 +465,20 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
else
if_frequency = 0;

while (if_frequency > (adc_freq / 2))
if_frequency -= adc_freq;
sampling_freq = if_frequency;

if (if_frequency >= 0)
while (sampling_freq > (adc_freq / 2))
sampling_freq -= adc_freq;

if (sampling_freq >= 0)
spec_inv *= -1;
else
if_frequency *= -1;
sampling_freq *= -1;

freq_cw = af9033_div(state, if_frequency, adc_freq, 23ul);
freq_cw = af9033_div(state, sampling_freq, adc_freq, 23ul);

if (spec_inv == -1)
freq_cw *= -1;
freq_cw = 0x800000 - freq_cw;

/* get adc multiplies */
ret = af9033_rd_reg(state, 0x800045, &tmp);
Expand Down

0 comments on commit c6eeea4

Please sign in to comment.