From c6da65df6a8380382f240d6c087db140cb14b054 Mon Sep 17 00:00:00 2001 From: Holger Waechtler Date: Wed, 4 Jun 2003 12:47:38 +0000 Subject: fix charge pump and band switch setting bug, catched by Robert Schlabbach --- linux/drivers/media/dvb/frontends/grundig_29504-401.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'linux/drivers') 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); } -- cgit v1.2.3