From: Steven Toth Date: Tue, 3 Oct 2006 00:35:40 +0000 (-0300) Subject: V4L/DVB (4699): CX24109 patch to eliminate the weird mis-tunings X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9b5a4a676a4d6126664c3df5a11f6fe87da63133;p=linux-beck.git V4L/DVB (4699): CX24109 patch to eliminate the weird mis-tunings A number of people have been reporting wierd tuning problems with various cards. Yeasah tracked down the problem to a miss-read datasheet. This resolves the problems. Signed-off-by: Yeasah Pell Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index 62d69a6ea699..a356d28fc3bb 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c @@ -553,8 +553,8 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa ndiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) / 32) & 0x1ff; adiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) % 32) & 0x1f; - if (adiv == 0) - ndiv++; + if (adiv == 0 && ndiv > 0) + ndiv--; /* control bits 11, refdiv 11, charge pump polarity 1, charge pump current, ndiv, adiv */ state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (pump << 14) | (ndiv << 5) | adiv;