From: Michael Krufky <mkrufky@linuxtv.org>
To: stable@kernel.org
Cc: linux-kernel@vger.kernel.org,
v4l-dvb maintainer list <v4l-dvb-maintainer@linuxtv.org>,
Yeasah Pell <yeasah@schwide.net>,
Steven Toth <stoth@hauppauge.com>
Subject: [2.6.18.y PATCH 2/6] cx24123: fix PLL divisor setup
Date: Sun, 08 Oct 2006 14:41:43 -0400 [thread overview]
Message-ID: <45294667.9030503@linuxtv.org> (raw)
>From 1c8f534e446cd69f511c83378bb4501348a97ab1 Mon Sep 17 00:00:00 2001
From: Yeasah Pell <yeasah@schwide.net>
Date: Tue, 3 Oct 2006 21:56:18 -0400
Subject: [PATCH] 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>
---
drivers/media/dvb/frontends/cx24123.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
index 274a87b..1e7e790 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
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;
reply other threads:[~2006-10-08 18:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45294667.9030503@linuxtv.org \
--to=mkrufky@linuxtv.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=stoth@hauppauge.com \
--cc=v4l-dvb-maintainer@linuxtv.org \
--cc=yeasah@schwide.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox