summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/frontends/grundig_29504-401.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-401.c b/linux/drivers/media/dvb/frontends/grundig_29504-401.c
index 7a244b428..7c0fd1c05 100644
--- a/linux/drivers/media/dvb/frontends/grundig_29504-401.c
+++ b/linux/drivers/media/dvb/frontends/grundig_29504-401.c
@@ -113,15 +113,15 @@ int tsa5060_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
div = (36125000 + freq) / 166666;
cfg = 0x88;
- cpump = div < 175000000 ? 2 : div < 390000000 ? 1 :
- div < 470000000 ? 2 : div < 750000000 ? 1 : 3;
+ cpump = freq < 175000000 ? 2 : freq < 390000000 ? 1 :
+ freq < 470000000 ? 2 : freq < 750000000 ? 1 : 3;
- band_select = div < 175000000 ? 0x0e : div < 470000000 ? 0x05 : 0x03;
+ band_select = freq < 175000000 ? 0x0e : freq < 470000000 ? 0x05 : 0x03;
buf [0] = (div >> 8) & 0x7f;
buf [1] = div & 0xff;
buf [2] = ((div >> 10) & 0x60) | cfg;
- buf [3] = cpump | band_select;
+ buf [3] = (cpump << 6) | band_select;
return tsa5060_write(i2c, buf);
}