summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorYeasah Pell <yeasah@schwide.net>2006-10-08 14:41:43 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-10-13 13:23:21 -0700
commit17983c7efc5a1e2deace277ade4ac9933c0db68f (patch)
treee498c4b5e3387eea15055d1ac0d0cb58f3ce4604 /drivers/media
parentc998b8df9876512097947fb3cbe3bb4397a05819 (diff)
DVB: cx24123: fix PLL divisor setup
The cx24109 datasheet says: "NOTE: if A=0, then N=N+1" The current code is the result of a misinterpretation of the datasheet to mean exactly the opposite of the requirement -- The actual value of N is 1 greater than the value written when A is 0, so 1 needs to be *subtracted* from it to compensate. Signed-off-by: Yeasah Pell <yeasah@schwide.net> Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/cx24123.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
index 274a87b7a5d5..1e7e79037204 100644
--- a/drivers/media/dvb/frontends/cx24123.c
+++ b/drivers/media/dvb/frontends/cx24123.c
@@ -549,8 +549,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;