public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: linux-omap@vger.kernel.org
Cc: Eduardo Valentin <eduardo.valentin@indt.org.br>
Subject: [PATCH 2/3] tea5761 tuner: fix registers utilization
Date: Mon,  9 Jun 2008 16:05:42 -0400	[thread overview]
Message-ID: <1213041943-31218-3-git-send-email-edubezval@gmail.com> (raw)
In-Reply-To: <1213041943-31218-2-git-send-email-edubezval@gmail.com>

From: Eduardo Valentin <eduardo.valentin@indt.org.br>

Fix registers utilization.
tnctrl register was supposed to be used but it was
right shifted. frqset also was being configured using
incorrect equation.

Signed-off-by: Eduardo Valentin <eduardo.valentin@indt.org.br>
---
 drivers/media/common/tuners/tea5761.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/media/common/tuners/tea5761.c b/drivers/media/common/tuners/tea5761.c
index 8e86cb2..b3d4786 100644
--- a/drivers/media/common/tuners/tea5761.c
+++ b/drivers/media/common/tuners/tea5761.c
@@ -101,6 +101,8 @@ struct tea5761_priv {
 
 	/* All zero = no test mode */
 
+#define TEA5761_TESTREG_TRIGFR		0x08
+
 /* MANID - Read: bytes 12 and 13 */
 
 	/* First byte - should be 0x10 */
@@ -147,20 +149,21 @@ static int set_radio_freq(struct dvb_frontend *fe,
 
 	if (params->mode == T_STANDBY) {
 		tuner_dbg("TEA5761 set to standby mode\n");
-		buffer[5] |= TEA5761_TNCTRL_MU;
+		buffer[4] |= TEA5761_TNCTRL_MU;
 	} else {
-		buffer[4] |= TEA5761_TNCTRL_PUPD_0;
+		buffer[3] |= TEA5761_TNCTRL_PUPD_0;
 	}
 
+	buffer[5] = TEA5761_TESTREG_TRIGFR;
 
 	if (params->audmode == V4L2_TUNER_MODE_MONO) {
 		tuner_dbg("TEA5761 set to mono\n");
-		buffer[5] |= TEA5761_TNCTRL_MST;
+		buffer[4] |= TEA5761_TNCTRL_MST;
 	} else {
 		tuner_dbg("TEA5761 set to stereo\n");
 	}
 
-	div = (1000 * (frq * 4 / 16 + 700 + 225) ) >> 15;
+	div = (frq * 125 / 2 - 225000) >> 13;
 	buffer[1] = (div >> 8) & 0x3f;
 	buffer[2] = div & 0xff;
 
-- 
1.5.6.rc0.84.g06f60.dirty


  reply	other threads:[~2008-06-09 20:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09 20:05 [PATCH 0/3] Updates for tea5761 (take #2) Eduardo Valentin
2008-06-09 20:05 ` [PATCH 1/3] tea5761: Add init and sleep callbacks on tea5761 tuner Eduardo Valentin
2008-06-09 20:05   ` Eduardo Valentin [this message]
2008-06-09 20:05     ` [PATCH 3/3] radio-tea5761: Update driver Eduardo Valentin
2008-06-09 23:40       ` Felipe Balbi
2008-06-10  1:14         ` Eduardo Valentin
2008-06-10  2:07           ` Felipe Balbi
2008-06-10 17:42             ` Eduardo Valentin
  -- strict thread matches above, loose matches on Subject: below --
2008-06-10 17:42 [PATCH 0/3] Updates for tea5761 (take #3) Eduardo Valentin
2008-06-10 17:42 ` [PATCH 1/3] tea5761: Add init and sleep callbacks on tea5761 tuner Eduardo Valentin
2008-06-10 17:42   ` [PATCH 2/3] tea5761 tuner: fix registers utilization Eduardo Valentin

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=1213041943-31218-3-git-send-email-edubezval@gmail.com \
    --to=edubezval@gmail.com \
    --cc=eduardo.valentin@indt.org.br \
    --cc=linux-omap@vger.kernel.org \
    /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