From: Eduardo Valentin <edubezval@gmail.com>
To: Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Cc: Eduardo Valentin <eduardo.valentin@indt.org.br>
Subject: [PATCH 1/3] tea5761: Add init and sleep callbacks on tea5761 tuner
Date: Tue, 10 Jun 2008 13:42:10 -0400 [thread overview]
Message-ID: <1213119732-13198-2-git-send-email-edubezval@gmail.com> (raw)
In-Reply-To: <1213119732-13198-1-git-send-email-edubezval@gmail.com>
From: Eduardo Valentin <eduardo.valentin@indt.org.br>
Add init and sleep callbacks on tea5761 tuner
Signed-off-by: Eduardo Valentin <eduardo.valentin@indt.org.br>
---
drivers/media/common/tuners/tea5761.c | 44 +++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/drivers/media/common/tuners/tea5761.c b/drivers/media/common/tuners/tea5761.c
index b93cdef..8e86cb2 100644
--- a/drivers/media/common/tuners/tea5761.c
+++ b/drivers/media/common/tuners/tea5761.c
@@ -175,6 +175,48 @@ static int set_radio_freq(struct dvb_frontend *fe,
return 0;
}
+static int tea5761_init(struct dvb_frontend *fe)
+{
+ struct tea5761_priv *priv = fe->tuner_priv;
+ unsigned char buffer[] = {0, 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ tuner_dbg("Power up radio\n");
+
+ buffer[3] = TEA5761_TNCTRL_PUPD_0;
+
+ if (debug)
+ tea5761_status_dump(buffer);
+
+ rc = tuner_i2c_xfer_send(&priv->i2c_props, buffer, ARRAY_SIZE(buffer));
+ if (rc != ARRAY_SIZE(buffer))
+ tuner_warn("i2c i/o error: rc == %d (should be %d)\n", rc,
+ ARRAY_SIZE(buffer));
+
+ return 0;
+}
+
+static int tea5761_sleep(struct dvb_frontend *fe)
+{
+ struct tea5761_priv *priv = fe->tuner_priv;
+ unsigned char buffer[] = {0, 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ tuner_dbg("Power down radio\n");
+
+ buffer[3] &= ~TEA5761_TNCTRL_PUPD_0;
+
+ if (debug)
+ tea5761_status_dump(buffer);
+
+ rc = tuner_i2c_xfer_send(&priv->i2c_props, buffer, ARRAY_SIZE(buffer));
+ if (rc != ARRAY_SIZE(buffer))
+ tuner_warn("i2c i/o error: rc == %d (should be %d)\n", rc,
+ ARRAY_SIZE(buffer));
+
+ return 0;
+}
+
static int tea5761_read_status(struct dvb_frontend *fe, char *buffer)
{
struct tea5761_priv *priv = fe->tuner_priv;
@@ -287,6 +329,8 @@ static struct dvb_tuner_ops tea5761_tuner_ops = {
.get_frequency = tea5761_get_frequency,
.get_status = tea5761_get_status,
.get_rf_strength = tea5761_get_rf_strength,
+ .init = tea5761_init,
+ .sleep = tea5761_sleep,
};
struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
--
1.5.6.rc0.84.g06f60.dirty
next prev parent reply other threads:[~2008-06-10 17:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 17:42 [PATCH 0/3] Updates for tea5761 (take #3) Eduardo Valentin
2008-06-10 17:42 ` Eduardo Valentin [this message]
2008-06-10 17:42 ` [PATCH 2/3] tea5761 tuner: fix registers utilization Eduardo Valentin
2008-06-10 17:42 ` [PATCH 3/3] radio-tea5761: Update driver Eduardo Valentin
2008-06-23 10:42 ` [PATCH 0/3] Updates for tea5761 (take #3) Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
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
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=1213119732-13198-2-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