From: Ondrej Zary <linux@rainbow-software.org>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: [PATCH 1/4] tda8290: Allow disabling I2C gate
Date: Sun, 20 Jan 2013 22:22:16 +0100 [thread overview]
Message-ID: <1358716939-2133-2-git-send-email-linux@rainbow-software.org> (raw)
In-Reply-To: <1358716939-2133-1-git-send-email-linux@rainbow-software.org>
Allow disabling I2C gate handling by external configuration.
This is required by cards that have all devices on a single I2C bus,
like AverMedia A706.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
drivers/media/tuners/tda8290.c | 13 +++++++++++--
drivers/media/tuners/tda8290.h | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c
index 8c48521..16dfbf2 100644
--- a/drivers/media/tuners/tda8290.c
+++ b/drivers/media/tuners/tda8290.c
@@ -54,6 +54,7 @@ struct tda8290_priv {
#define TDA18271 16
struct tda827x_config cfg;
+ bool no_i2c_gate;
};
/*---------------------------------------------------------------------*/
@@ -66,6 +67,9 @@ static int tda8290_i2c_bridge(struct dvb_frontend *fe, int close)
unsigned char disable[2] = { 0x21, 0x00 };
unsigned char *msg;
+ if (priv->no_i2c_gate)
+ return 0;
+
if (close) {
msg = enable;
tuner_i2c_xfer_send(&priv->i2c_props, msg, 2);
@@ -88,6 +92,9 @@ static int tda8295_i2c_bridge(struct dvb_frontend *fe, int close)
unsigned char buf[3] = { 0x45, 0x01, 0x00 };
unsigned char *msg;
+ if (priv->no_i2c_gate)
+ return 0;
+
if (close) {
msg = enable;
tuner_i2c_xfer_send(&priv->i2c_props, msg, 2);
@@ -740,8 +747,10 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
priv->i2c_props.addr = i2c_addr;
priv->i2c_props.adap = i2c_adap;
priv->i2c_props.name = "tda829x";
- if (cfg)
- priv->cfg.config = cfg->lna_cfg;
+ if (cfg) {
+ priv->cfg.config = cfg->lna_cfg;
+ priv->no_i2c_gate = cfg->no_i2c_gate;
+ }
if (tda8290_probe(&priv->i2c_props) == 0) {
priv->ver = TDA8290;
diff --git a/drivers/media/tuners/tda8290.h b/drivers/media/tuners/tda8290.h
index 7e288b2..9959cc8 100644
--- a/drivers/media/tuners/tda8290.h
+++ b/drivers/media/tuners/tda8290.h
@@ -26,6 +26,7 @@ struct tda829x_config {
unsigned int probe_tuner:1;
#define TDA829X_PROBE_TUNER 0
#define TDA829X_DONT_PROBE 1
+ unsigned int no_i2c_gate:1;
};
#if defined(CONFIG_MEDIA_TUNER_TDA8290) || (defined(CONFIG_MEDIA_TUNER_TDA8290_MODULE) && defined(MODULE))
--
Ondrej Zary
next prev parent reply other threads:[~2013-01-20 21:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-20 21:22 [PATCH 0/4] saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM Ondrej Zary
2013-01-20 21:22 ` Ondrej Zary [this message]
2013-01-21 8:06 ` [PATCH 1/4] tda8290: Allow disabling I2C gate Antti Palosaari
2013-01-21 8:18 ` Ondrej Zary
2013-01-21 9:06 ` Antti Palosaari
2013-01-21 18:28 ` Ondrej Zary
2013-01-23 17:31 ` Antti Palosaari
2013-01-20 21:22 ` [PATCH 2/4] tda8290: Allow custom std_map for tda18271 Ondrej Zary
2013-01-20 21:22 ` [PATCH 3/4] tuner-core: Change config from unsigned int to void * Ondrej Zary
2013-01-20 21:22 ` [PATCH 4/4] saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM Ondrej Zary
2013-01-27 21:45 ` [PATCH 4/4 v2] " Ondrej Zary
-- strict thread matches above, loose matches on Subject: below --
2013-02-01 20:21 [PATCH v2 0/4] " Ondrej Zary
2013-02-01 20:21 ` [PATCH 1/4] tda8290: Allow disabling I2C gate Ondrej Zary
2013-02-04 2:19 ` Michael Krufky
2013-02-04 18:56 ` Ondrej Zary
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=1358716939-2133-2-git-send-email-linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).