Skip to contentSkip to conversation

saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM

PATCH In review Ondrej Zary 3 participants 13 messages Feb 1, 2013 – Mar 6, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM

Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.

This requires some changes to tda8290 - disabling I2C gate control and passing custom std_map to tda18271.
Also tuner-core needs to be changed because there's currently no way to pass any complex configuration to analog tuners.

Signature · 1 line
Ondrej Zary
#1 lore raw

PATCH v2 1/4 tda8290: Allow disabling I2C gate

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.

---
 drivers/media/tuners/tda8290.c |   49 +++++++++++++++++++++++----------------
 drivers/media/tuners/tda8290.h |    1 +
 2 files changed, 30 insertions(+), 20 deletions(-)
drivers/media/tuners/tda8290.c +29 -20
index 8c48521..a2b7a9f 100644
@@ -233,7 +233,8 @@ static void tda8290_set_params(struct dvb_frontend *fe,
 	}
 
 
-	tda8290_i2c_bridge(fe, 1);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
 	if (fe->ops.tuner_ops.set_analog_params)
 		fe->ops.tuner_ops.set_analog_params(fe, params);
@@ -302,7 +303,8 @@ static void tda8290_set_params(struct dvb_frontend *fe,
 		}
 	}
 
-	tda8290_i2c_bridge(fe, 0);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 	tuner_i2c_xfer_send(&priv->i2c_props, if_agc_set, 2);
 }
 
@@ -424,7 +426,8 @@ static void tda8295_set_params(struct dvb_frontend *fe,
 	tuner_i2c_xfer_send(&priv->i2c_props, blanking_mode, 2);
 	msleep(20);
 
-	tda8295_i2c_bridge(fe, 1);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
 	if (fe->ops.tuner_ops.set_analog_params)
 		fe->ops.tuner_ops.set_analog_params(fe, params);
@@ -437,7 +440,8 @@ static void tda8295_set_params(struct dvb_frontend *fe,
 	else
 		tuner_dbg("tda8295 not locked, no signal?\n");
 
-	tda8295_i2c_bridge(fe, 0);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 }
 
 /*---------------------------------------------------------------------*/
@@ -465,11 +469,13 @@ static void tda8290_standby(struct dvb_frontend *fe)
 	unsigned char tda8290_agc_tri[] = { 0x02, 0x20 };
 	struct i2c_msg msg = {.addr = priv->tda827x_addr, .flags=0, .buf=cb1, .len = 2};
 
-	tda8290_i2c_bridge(fe, 1);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 	if (priv->ver & TDA8275A)
 		cb1[1] = 0x90;
 	i2c_transfer(priv->i2c_props.adap, &msg, 1);
-	tda8290_i2c_bridge(fe, 0);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 	tuner_i2c_xfer_send(&priv->i2c_props, tda8290_agc_tri, 2);
 	tuner_i2c_xfer_send(&priv->i2c_props, tda8290_standby, 2);
 }
@@ -537,9 +543,11 @@ static void tda8290_init_tuner(struct dvb_frontend *fe)
 	if (priv->ver & TDA8275A)
 		msg.buf = tda8275a_init;
 
-	tda8290_i2c_bridge(fe, 1);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 	i2c_transfer(priv->i2c_props.adap, &msg, 1);
-	tda8290_i2c_bridge(fe, 0);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 }
 
 /*---------------------------------------------------------------------*/
@@ -565,19 +573,13 @@ static struct tda18271_config tda829x_tda18271_config = {
 static int tda829x_find_tuner(struct dvb_frontend *fe)
 {
 	struct tda8290_priv *priv = fe->analog_demod_priv;
-	struct analog_demod_ops *analog_ops = &fe->ops.analog_ops;
 	int i, ret, tuners_found;
 	u32 tuner_addrs;
 	u8 data;
 	struct i2c_msg msg = { .flags = I2C_M_RD, .buf = &data, .len = 1 };
 
-	if (!analog_ops->i2c_gate_ctrl) {
-		printk(KERN_ERR "tda8290: no gate control were provided!\n");
-
-		return -EINVAL;
-	}
-
-	analog_ops->i2c_gate_ctrl(fe, 1);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
 	/* probe for tuner chip */
 	tuners_found = 0;
@@ -595,7 +597,8 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
 	   give a response now
 	 */
 
-	analog_ops->i2c_gate_ctrl(fe, 0);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 
 	if (tuners_found > 1)
 		for (i = 0; i < tuners_found; i++) {
@@ -618,12 +621,14 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
 	priv->tda827x_addr = tuner_addrs;
 	msg.addr = tuner_addrs;
 
-	analog_ops->i2c_gate_ctrl(fe, 1);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 	ret = i2c_transfer(priv->i2c_props.adap, &msg, 1);
 
 	if (ret != 1) {
 		tuner_warn("tuner access failed!\n");
-		analog_ops->i2c_gate_ctrl(fe, 0);
+		if (fe->ops.analog_ops.i2c_gate_ctrl)
+			fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 		return -EREMOTEIO;
 	}
 
@@ -648,7 +653,8 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
 	if (fe->ops.tuner_ops.sleep)
 		fe->ops.tuner_ops.sleep(fe);
 
-	analog_ops->i2c_gate_ctrl(fe, 0);
+	if (fe->ops.analog_ops.i2c_gate_ctrl)
+		fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 
 	return 0;
 }
@@ -755,6 +761,9 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
 		       sizeof(struct analog_demod_ops));
 	}
 
+	if (cfg && cfg->no_i2c_gate)
+		fe->ops.analog_ops.i2c_gate_ctrl = NULL;
+
 	if (!(cfg) || (TDA829X_PROBE_TUNER == cfg->probe_tuner)) {
 		tda8295_power(fe, 1);
 		if (tda829x_find_tuner(fe) < 0)
drivers/media/tuners/tda8290.h +1 -0
index 7e288b2..9959cc8 100644
@@ -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))
Signature · 1 line
Ondrej Zary
#4 lore raw

PATCH v2 2/4 tda8290: Allow custom std_map for tda18271

In reply to Ondrej Zary

Allow specifying a custom std_map for tda18271 by external configuration. This is required by cards that require custom std_map for analog TV or radio, like AverMedia A706.

---
 drivers/media/tuners/tda8290.c |    8 ++++++--
 drivers/media/tuners/tda8290.h |    2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/media/tuners/tda8290.c +6 -2
index a2b7a9f..c1ade88 100644
@@ -54,6 +54,7 @@ struct tda8290_priv {
 #define TDA18271 16
 
 	struct tda827x_config cfg;
+	struct tda18271_std_map *tda18271_std_map;
 };
 
 /*---------------------------------------------------------------------*/
@@ -635,6 +636,7 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
 	if ((data == 0x83) || (data == 0x84)) {
 		priv->ver |= TDA18271;
 		tda829x_tda18271_config.config = priv->cfg.config;
+		tda829x_tda18271_config.std_map = priv->tda18271_std_map;
 		dvb_attach(tda18271_attach, fe, priv->tda827x_addr,
 			   priv->i2c_props.adap, &tda829x_tda18271_config);
 	} else {
@@ -746,8 +748,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->tda18271_std_map = cfg->tda18271_std_map;
+	}
 
 	if (tda8290_probe(&priv->i2c_props) == 0) {
 		priv->ver = TDA8290;
drivers/media/tuners/tda8290.h +2 -0
index 9959cc8..280b70d 100644
@@ -19,6 +19,7 @@
 
 #include <linux/i2c.h>
 #include "dvb_frontend.h"
+#include "tda18271.h"
 
 struct tda829x_config {
 	unsigned int lna_cfg;
@@ -27,6 +28,7 @@ struct tda829x_config {
 #define TDA829X_PROBE_TUNER 0
 #define TDA829X_DONT_PROBE  1
 	unsigned int no_i2c_gate:1;
+	struct tda18271_std_map *tda18271_std_map;
 };
 
 #if defined(CONFIG_MEDIA_TUNER_TDA8290) || (defined(CONFIG_MEDIA_TUNER_TDA8290_MODULE) && defined(MODULE))
Signature · 1 line
Ondrej Zary
#5 lore raw

PATCH v2 3/4 tuner-core: Change config from unsigned int to void *

In reply to Ondrej Zary

config looks like a hack that was added to tuner-core to allow some configuration of TDA8290 tuner (it's not used by any other driver). But with the new configuration options of tda8290 driver (no_i2c_gate and std_map), it's no longer sufficient.

Change config to be void * instead, which allows passing tuner-dependent config struct to drivers.

Also update saa7134 driver to reflect this change (no other driver uses this).

---
 drivers/media/pci/saa7134/saa7134-cards.c |   40 ++++++++++++++--------------
 drivers/media/pci/saa7134/saa7134.h       |    3 +-
 drivers/media/v4l2-core/tuner-core.c      |   20 +++++---------
 include/media/tuner.h                     |    2 +-
 4 files changed, 30 insertions(+), 35 deletions(-)
drivers/media/pci/saa7134/saa7134-cards.c +20 -20
index bc08f1d..fe54f88 100644
@@ -2760,7 +2760,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config   = 0,
+		.tda829x_conf   = { .lna_cfg = 0 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -3291,7 +3291,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 1,
+		.tda829x_conf   = { .lna_cfg = 1 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x000200000,
 		.inputs         = {{
@@ -3395,7 +3395,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 1,
+		.tda829x_conf   = { .lna_cfg = 1 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200100,
 		.inputs         = {{
@@ -3426,7 +3426,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 3,
+		.tda829x_conf   = { .lna_cfg = 3 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.ts_type	= SAA7134_MPEG_TS_SERIAL,
 		.ts_force_val   = 1,
@@ -3459,7 +3459,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 3,
+		.tda829x_conf   = { .lna_cfg = 3 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.ts_type	= SAA7134_MPEG_TS_SERIAL,
 		.gpiomask       = 0x0800100, /* GPIO 21 is an INPUT */
@@ -3683,7 +3683,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -3736,7 +3736,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -3754,7 +3754,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.gpiomask	= 1 << 21,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs         = {{
@@ -3887,7 +3887,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 0,
+		.tda829x_conf   = { .lna_cfg = 0 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs = {{
 			.name   = name_tv, /* FIXME: analog tv untested */
@@ -3903,7 +3903,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.gpiomask       = 0x020200000,
 		.inputs         = {{
 			.name = name_tv,
@@ -3937,7 +3937,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type	= UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config	= 0,
+		.tda829x_conf	= { .lna_cfg = 0 },
 		.gpiomask	= 0x020200000,
 		.inputs		= {{
 			.name = name_tv,
@@ -4737,7 +4737,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -4823,7 +4823,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type   = UNSET,
 		.tuner_addr   = ADDR_UNSET,
 		.radio_addr   = ADDR_UNSET,
-		.tuner_config = 0,
+		.tda829x_conf = { .lna_cfg = 0 },
 		.mpeg         = SAA7134_MPEG_DVB,
 		.inputs       = {{
 			.name = name_tv,
@@ -4847,7 +4847,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = { {
@@ -5057,7 +5057,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.gpiomask       = 1 << 21,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs         = {{
@@ -5087,7 +5087,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 2,
+		.tda829x_conf   = { .lna_cfg = 2 },
 		.gpiomask       = 1 << 21,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs         = {{
@@ -5176,7 +5176,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tuner_config   = 0,
+		.tda829x_conf   = { .lna_cfg = 0 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = { {
@@ -5406,7 +5406,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 0,
+		.tda829x_conf   = { .lna_cfg = 0 },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.ts_type	= SAA7134_MPEG_TS_PARALLEL,
 		.inputs         = {{
@@ -5629,7 +5629,7 @@ struct saa7134_board saa7134_boards[] = {
 		.audio_clock	= 0x00187de7,
 		.tuner_type	= TUNER_PHILIPS_TDA8290,
 		.radio_type	= UNSET,
-		.tuner_config	= 3,
+		.tda829x_conf	= { .lna_cfg = 3 },
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
 		.gpiomask	= 0x02050000,
@@ -7616,7 +7616,7 @@ static void saa7134_tuner_setup(struct saa7134_dev *dev)
 	if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type != UNSET)) {
 		tun_setup.type = dev->tuner_type;
 		tun_setup.addr = dev->tuner_addr;
-		tun_setup.config = saa7134_boards[dev->board].tuner_config;
+		tun_setup.config = &saa7134_boards[dev->board].tda829x_conf;
 		tun_setup.tuner_callback = saa7134_tuner_callback;
 
 		tun_setup.mode_mask = mode_mask;
drivers/media/pci/saa7134/saa7134.h +2 -1
index c24b651..ce1b4b5 100644
@@ -44,6 +44,7 @@
 #if defined(CONFIG_VIDEO_SAA7134_DVB) || defined(CONFIG_VIDEO_SAA7134_DVB_MODULE)
 #include <media/videobuf-dvb.h>
 #endif
+#include "tda8290.h"
 
 #define UNSET (-1U)
 
@@ -388,7 +389,7 @@ struct saa7134_board {
 	unsigned char		rds_addr;
 
 	unsigned int            tda9887_conf;
-	unsigned int            tuner_config;
+	struct tda829x_config   tda829x_conf;
 
 	/* peripheral I/O */
 	enum saa7134_video_out  video_out;
drivers/media/v4l2-core/tuner-core.c +7 -13
index b5a819a..14ad8f4 100644
@@ -132,7 +132,7 @@ struct tuner {
 	bool                standby;	/* Standby mode */
 
 	unsigned int        type; /* chip type id */
-	unsigned int        config;
+	void                *config;
 	const char          *name;
 };
 
@@ -272,9 +272,8 @@ static struct analog_demod_ops tuner_analog_ops = {
  * @c:			i2c_client descriptoy
  * @type:		type of the tuner (e. g. tuner number)
  * @new_mode_mask:	Indicates if tuner supports TV and/or Radio
- * @new_config:		an optional parameter ranging from 0-255 used by
-			a few tuners to adjust an internal parameter,
-			like LNA mode
+ * @new_config:		an optional parameter used by a few tuners to adjust
+			internal parameters, like LNA mode
  * @tuner_callback:	an optional function to be called when switching
  *			to analog mode
  *
@@ -282,7 +281,7 @@ static struct analog_demod_ops tuner_analog_ops = {
  * by tun_setup structure. It contains several per-tuner initialization "magic"
  */
 static void set_type(struct i2c_client *c, unsigned int type,
-		     unsigned int new_mode_mask, unsigned int new_config,
+		     unsigned int new_mode_mask, void *new_config,
 		     int (*tuner_callback) (void *dev, int component, int cmd, int arg))
 {
 	struct tuner *t = to_tuner(i2c_get_clientdata(c));
@@ -297,8 +296,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
 	}
 
 	t->type = type;
-	/* prevent invalid config values */
-	t->config = new_config < 256 ? new_config : 0;
+	t->config = new_config;
 	if (tuner_callback != NULL) {
 		tuner_dbg("defining GPIO callback\n");
 		t->fe.callback = tuner_callback;
@@ -316,11 +314,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
 		break;
 	case TUNER_PHILIPS_TDA8290:
 	{
-		struct tda829x_config cfg = {
-			.lna_cfg        = t->config,
-		};
 		if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter,
-				t->i2c->addr, &cfg))
+				t->i2c->addr, t->config))
 			goto attach_failed;
 		break;
 	}
@@ -409,7 +404,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
 	case TUNER_NXP_TDA18271:
 	{
 		struct tda18271_config cfg = {
-			.config = t->config,
 			.small_i2c = TDA18271_03_BYTE_CHUNK_INIT,
 		};
 
@@ -506,7 +500,7 @@ static int tuner_s_type_addr(struct v4l2_subdev *sd,
 	struct tuner *t = to_tuner(sd);
 	struct i2c_client *c = v4l2_get_subdevdata(sd);
 
-	tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=0x%02x\n",
+	tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=%p\n",
 			tun_setup->type,
 			tun_setup->addr,
 			tun_setup->mode_mask,
include/media/tuner.h +1 -1
index 926aff9..c60552b 100644
@@ -188,7 +188,7 @@ struct tuner_setup {
 	unsigned short	addr; 	/* I2C address */
 	unsigned int	type;   /* Tuner type */
 	unsigned int	mode_mask;  /* Allowed tuner modes */
-	unsigned int	config; /* configuraion for more complex tuners */
+	void		*config;    /* configuraion for more complex tuners */
 	int (*tuner_callback) (void *dev, int component, int cmd, int arg);
 };
 
Signature · 1 line
Ondrej Zary
#9 lore raw

PATCH v2 4/4 saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM

In reply to Ondrej Zary

Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.
Working: analog inputs, TV, FM radio and IR remote control.
Untested: DVB-S.

---
 drivers/media/i2c/ir-kbd-i2c.c              |   13 ++++++-
 drivers/media/pci/saa7134/saa7134-cards.c   |   53 +++++++++++++++++++++++++++
 drivers/media/pci/saa7134/saa7134-dvb.c     |   23 ++++++++++++
 drivers/media/pci/saa7134/saa7134-i2c.c     |    1 +
 drivers/media/pci/saa7134/saa7134-input.c   |    3 ++
 drivers/media/pci/saa7134/saa7134-tvaudio.c |    1 +
 drivers/media/pci/saa7134/saa7134.h         |    1 +
 7 files changed, 94 insertions(+), 1 deletions(-)
drivers/media/i2c/ir-kbd-i2c.c +12 -1
index 08ae067..c1f6e7c 100644
@@ -230,7 +230,7 @@ static int get_key_avermedia_cardbus(struct IR_i2c *ir,
 		return 0;
 
 	dprintk(1, "read key 0x%02x/0x%02x\n", key, keygroup);
-	if (keygroup < 2 || keygroup > 3) {
+	if (keygroup < 2 || keygroup > 4) {
 		/* Only a warning */
 		dprintk(1, "warning: invalid key group 0x%02x for key 0x%02x\n",
 								keygroup, key);
@@ -239,6 +239,10 @@ static int get_key_avermedia_cardbus(struct IR_i2c *ir,
 
 	*ir_key = key;
 	*ir_raw = key;
+	if (!strcmp(ir->ir_codes, RC_MAP_AVERMEDIA_M733A_RM_K6)) {
+		*ir_key |= keygroup << 8;
+		*ir_raw |= keygroup << 8;
+	}
 	return 1;
 }
 
@@ -332,6 +336,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		rc_type     = RC_BIT_OTHER;
 		ir_codes    = RC_MAP_AVERMEDIA_CARDBUS;
 		break;
+	case 0x41:
+		name        = "AVerMedia EM78P153";
+		ir->get_key = get_key_avermedia_cardbus;
+		rc_type     = RC_BIT_OTHER;
+		/* RM-KV remote, seems to be same as RM-K6 */
+		ir_codes    = RC_MAP_AVERMEDIA_M733A_RM_K6;
+		break;
 	case 0x71:
 		name        = "Hauppauge/Zilog Z8";
 		ir->get_key = get_key_haup_xvr;
drivers/media/pci/saa7134/saa7134-cards.c +53 -0

77 lines not on this page · raw message

drivers/media/pci/saa7134/saa7134-dvb.c +23 -0
index b209de4..547f470 100644
@@ -1070,6 +1070,10 @@ static struct mt312_config zl10313_compro_s350_config = {
 	.demod_address = 0x0e,
 };
 
+static struct mt312_config zl10313_avermedia_a706_config = {
+	.demod_address = 0x0e,
+};
+
 static struct lgdt3305_config hcw_lgdt3305_config = {
 	.i2c_addr           = 0x0e,
 	.mpeg_mode          = LGDT3305_MPEG_SERIAL,
@@ -1817,6 +1821,25 @@ static int dvb_init(struct saa7134_dev *dev)
 				   &prohdtv_pro2_tda18271_config);
 		}
 		break;
+	case SAA7134_BOARD_AVERMEDIA_A706:
+		/* Enable all DVB-S devices now */
+		/* CE5039 DVB-S tuner SLEEP pin low */
+		saa7134_set_gpio(dev, 23, 0);
+		/* CE6313 DVB-S demod SLEEP pin low */
+		saa7134_set_gpio(dev, 9, 0);
+		/* CE6313 DVB-S demod RESET# pin high */
+		saa7134_set_gpio(dev, 25, 1);
+		msleep(1);
+		fe0->dvb.frontend = dvb_attach(mt312_attach,
+				&zl10313_avermedia_a706_config, &dev->i2c_adap);
+		if (fe0->dvb.frontend) {
+			fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
+			if (dvb_attach(zl10039_attach, fe0->dvb.frontend,
+					0x60, &dev->i2c_adap) == NULL)
+				wprintk("%s: No zl10039 found!\n",
+					__func__);
+		}
+		break;
 	default:
 		wprintk("Huh? unknown DVB card?\n");
 		break;
drivers/media/pci/saa7134/saa7134-i2c.c +1 -0
index a176ec3..c68169d 100644
@@ -256,6 +256,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
 				addr |= 1;
 			if (i > 0 && msgs[i].flags &
 			    I2C_M_RD && msgs[i].addr != 0x40 &&
+			    msgs[i].addr != 0x41 &&
 			    msgs[i].addr != 0x19) {
 				/* workaround for a saa7134 i2c bug
 				 * needed to talk to the mt352 demux
drivers/media/pci/saa7134/saa7134-input.c +3 -0
index e761262..6f43126 100644
@@ -997,6 +997,9 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
 	case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
 		info.addr = 0x40;
 		break;
+	case SAA7134_BOARD_AVERMEDIA_A706:
+		info.addr = 0x41;
+		break;
 	case SAA7134_BOARD_FLYDVB_TRIO:
 		dev->init_data.name = "FlyDVB Trio";
 		dev->init_data.get_key = get_key_flydvb_trio;
drivers/media/pci/saa7134/saa7134-tvaudio.c +1 -0
index b7a99be..0f34e09 100644
@@ -796,6 +796,7 @@ static int tvaudio_thread_ddep(void *data)
 			dprintk("FM Radio\n");
 			if (dev->tuner_type == TUNER_PHILIPS_TDA8290) {
 				norms = (0x11 << 2) | 0x01;
+				/* set IF frequency to 5.5 MHz */
 				saa_dsp_writel(dev, 0x42c >> 2, 0x729555);
 			} else {
 				norms = (0x0f << 2) | 0x01;
drivers/media/pci/saa7134/saa7134.h +1 -0
index ce1b4b5..9059d08 100644
@@ -333,6 +333,7 @@ struct saa7134_card_ir {
 #define SAA7134_BOARD_SENSORAY811_911       188
 #define SAA7134_BOARD_KWORLD_PC150U         189
 #define SAA7134_BOARD_ASUSTeK_PS3_100      190
+#define SAA7134_BOARD_AVERMEDIA_A706		191
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
Signature · 1 line
Ondrej Zary
maintainer Reviewed-by on v2 3/4
#6 lore raw

Re: [PATCH 3/4] tuner-core: Change config from unsigned int to void *

In reply to Ondrej Zary
Quoted 302 lines · Ondrej Zary

config looks like a hack that was added to tuner-core to allow some configuration of TDA8290 tuner (it's not used by any other driver). But with the new configuration options of tda8290 driver (no_i2c_gate and std_map), it's no longer sufficient.

Change config to be void * instead, which allows passing tuner-dependent config struct to drivers.

Also update saa7134 driver to reflect this change (no other driver uses this).

---
 drivers/media/pci/saa7134/saa7134-cards.c |   40 ++++++++++++++--------------
 drivers/media/pci/saa7134/saa7134.h       |    3 +-
 drivers/media/v4l2-core/tuner-core.c      |   20 +++++---------
 include/media/tuner.h                     |    2 +-
 4 files changed, 30 insertions(+), 35 deletions(-)
drivers/media/pci/saa7134/saa7134-cards.c +20 -20
index bc08f1d..fe54f88 100644
@@ -2760,7 +2760,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -3291,7 +3291,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 1,
+               .tda829x_conf   = { .lna_cfg = 1 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x000200000,
                .inputs         = {{
@@ -3395,7 +3395,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 1,
+               .tda829x_conf   = { .lna_cfg = 1 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200100,
                .inputs         = {{
@@ -3426,7 +3426,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 3,
+               .tda829x_conf   = { .lna_cfg = 3 },
                .mpeg           = SAA7134_MPEG_DVB,
                .ts_type        = SAA7134_MPEG_TS_SERIAL,
                .ts_force_val   = 1,
@@ -3459,7 +3459,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 3,
+               .tda829x_conf   = { .lna_cfg = 3 },
                .mpeg           = SAA7134_MPEG_DVB,
                .ts_type        = SAA7134_MPEG_TS_SERIAL,
                .gpiomask       = 0x0800100, /* GPIO 21 is an INPUT */
@@ -3683,7 +3683,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -3736,7 +3736,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -3754,7 +3754,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 1 << 21,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
@@ -3887,7 +3887,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs = {{
                        .name   = name_tv, /* FIXME: analog tv untested */
@@ -3903,7 +3903,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 0x020200000,
                .inputs         = {{
                        .name = name_tv,
@@ -3937,7 +3937,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .gpiomask       = 0x020200000,
                .inputs         = {{
                        .name = name_tv,
@@ -4737,7 +4737,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -4823,7 +4823,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type   = UNSET,
                .tuner_addr   = ADDR_UNSET,
                .radio_addr   = ADDR_UNSET,
-               .tuner_config = 0,
+               .tda829x_conf = { .lna_cfg = 0 },
                .mpeg         = SAA7134_MPEG_DVB,
                .inputs       = {{
                        .name = name_tv,
@@ -4847,7 +4847,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = { {
@@ -5057,7 +5057,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 1 << 21,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
@@ -5087,7 +5087,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 1 << 21,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
@@ -5176,7 +5176,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = { {
@@ -5406,7 +5406,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .ts_type        = SAA7134_MPEG_TS_PARALLEL,
                .inputs         = {{
@@ -5629,7 +5629,7 @@ struct saa7134_board saa7134_boards[] = {
                .audio_clock    = 0x00187de7,
                .tuner_type     = TUNER_PHILIPS_TDA8290,
                .radio_type     = UNSET,
-               .tuner_config   = 3,
+               .tda829x_conf   = { .lna_cfg = 3 },
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
                .gpiomask       = 0x02050000,
@@ -7616,7 +7616,7 @@ static void saa7134_tuner_setup(struct saa7134_dev *dev)
        if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type != UNSET)) {
                tun_setup.type = dev->tuner_type;
                tun_setup.addr = dev->tuner_addr;
-               tun_setup.config = saa7134_boards[dev->board].tuner_config;
+               tun_setup.config = &saa7134_boards[dev->board].tda829x_conf;
                tun_setup.tuner_callback = saa7134_tuner_callback;
 
                tun_setup.mode_mask = mode_mask;
drivers/media/pci/saa7134/saa7134.h +2 -1
index c24b651..ce1b4b5 100644
@@ -44,6 +44,7 @@
 #if defined(CONFIG_VIDEO_SAA7134_DVB) || defined(CONFIG_VIDEO_SAA7134_DVB_MODULE)
 #include <media/videobuf-dvb.h>
 #endif
+#include "tda8290.h"
 
 #define UNSET (-1U)
 
@@ -388,7 +389,7 @@ struct saa7134_board {
        unsigned char           rds_addr;
 
        unsigned int            tda9887_conf;
-       unsigned int            tuner_config;
+       struct tda829x_config   tda829x_conf;
 
        /* peripheral I/O */
        enum saa7134_video_out  video_out;
drivers/media/v4l2-core/tuner-core.c +7 -13
index b5a819a..14ad8f4 100644
@@ -132,7 +132,7 @@ struct tuner {
        bool                standby;    /* Standby mode */
 
        unsigned int        type; /* chip type id */
-       unsigned int        config;
+       void                *config;
        const char          *name;
 };
 
@@ -272,9 +272,8 @@ static struct analog_demod_ops tuner_analog_ops = {
  * @c:                 i2c_client descriptoy
  * @type:              type of the tuner (e. g. tuner number)
  * @new_mode_mask:     Indicates if tuner supports TV and/or Radio
- * @new_config:                an optional parameter ranging from 0-255 used by
-                       a few tuners to adjust an internal parameter,
-                       like LNA mode
+ * @new_config:                an optional parameter used by a few tuners to adjust
+                       internal parameters, like LNA mode
  * @tuner_callback:    an optional function to be called when switching
  *                     to analog mode
  *
@@ -282,7 +281,7 @@ static struct analog_demod_ops tuner_analog_ops = {
  * by tun_setup structure. It contains several per-tuner initialization "magic"
  */
 static void set_type(struct i2c_client *c, unsigned int type,
-                    unsigned int new_mode_mask, unsigned int new_config,
+                    unsigned int new_mode_mask, void *new_config,
                     int (*tuner_callback) (void *dev, int component, int cmd, int arg))
 {
        struct tuner *t = to_tuner(i2c_get_clientdata(c));
@@ -297,8 +296,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
        }
 
        t->type = type;
-       /* prevent invalid config values */
-       t->config = new_config < 256 ? new_config : 0;
+       t->config = new_config;
        if (tuner_callback != NULL) {
                tuner_dbg("defining GPIO callback\n");
                t->fe.callback = tuner_callback;
@@ -316,11 +314,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
                break;
        case TUNER_PHILIPS_TDA8290:
        {
-               struct tda829x_config cfg = {
-                       .lna_cfg        = t->config,
-               };
                if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter,
-                               t->i2c->addr, &cfg))
+                               t->i2c->addr, t->config))
                        goto attach_failed;
                break;
        }
@@ -409,7 +404,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
        case TUNER_NXP_TDA18271:
        {
                struct tda18271_config cfg = {
-                       .config = t->config,
                        .small_i2c = TDA18271_03_BYTE_CHUNK_INIT,
                };
 
@@ -506,7 +500,7 @@ static int tuner_s_type_addr(struct v4l2_subdev *sd,
        struct tuner *t = to_tuner(sd);
        struct i2c_client *c = v4l2_get_subdevdata(sd);
 
-       tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=0x%02x\n",
+       tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=%p\n",
                        tun_setup->type,
                        tun_setup->addr,
                        tun_setup->mode_mask,
include/media/tuner.h +0 -0
index 926aff9..c60552b 100644

include/media/tuner.h struct tuner_setup { · line 193

Quoted 7 lines
include/media/tuner.h +1 -1
@@ -188,7 +188,7 @@ struct tuner_setup {
        unsigned short  addr;   /* I2C address */
        unsigned int    type;   /* Tuner type */
        unsigned int    mode_mask;  /* Allowed tuner modes */
-       unsigned int    config; /* configuraion for more complex tuners */
+       void            *config;    /* configuraion for more complex tuners */
        int (*tuner_callback) (void *dev, int component, int cmd, int arg);
 };

I pushed patch 1 & 2 into the 'zary' branch of my 'dvb' git tree on linuxtv.org -- I am going to do some testing and then issue a merge request to Mauro if all is OK.

As for this patch, I think this is a good idea, but I think the patch should be resent with RFC in the title, to ensure that everybody sees that you're proposing a tuner internal API change (unless Mauro has any comments in this thread)

I'm still digging a bit to make sure this doesn't have any negative effect on the tda827x driver, but it looks safe to me right now.

I'd like to hear Mauro's comments on this too, but it looks good to me.

maintainer
#2 lore raw

Re: [PATCH 1/4] tda8290: Allow disabling I2C gate

In reply to Ondrej Zary
Quoted 158 lines · Ondrej Zary

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.

---
 drivers/media/tuners/tda8290.c |   49 +++++++++++++++++++++++----------------
 drivers/media/tuners/tda8290.h |    1 +
 2 files changed, 30 insertions(+), 20 deletions(-)
drivers/media/tuners/tda8290.c +29 -20
index 8c48521..a2b7a9f 100644
@@ -233,7 +233,8 @@ static void tda8290_set_params(struct dvb_frontend *fe,
        }
 
 
-       tda8290_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
        if (fe->ops.tuner_ops.set_analog_params)
                fe->ops.tuner_ops.set_analog_params(fe, params);
@@ -302,7 +303,8 @@ static void tda8290_set_params(struct dvb_frontend *fe,
                }
        }
 
-       tda8290_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
        tuner_i2c_xfer_send(&priv->i2c_props, if_agc_set, 2);
 }
 
@@ -424,7 +426,8 @@ static void tda8295_set_params(struct dvb_frontend *fe,
        tuner_i2c_xfer_send(&priv->i2c_props, blanking_mode, 2);
        msleep(20);
 
-       tda8295_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
        if (fe->ops.tuner_ops.set_analog_params)
                fe->ops.tuner_ops.set_analog_params(fe, params);
@@ -437,7 +440,8 @@ static void tda8295_set_params(struct dvb_frontend *fe,
        else
                tuner_dbg("tda8295 not locked, no signal?\n");
 
-       tda8295_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 }
 
 /*---------------------------------------------------------------------*/
@@ -465,11 +469,13 @@ static void tda8290_standby(struct dvb_frontend *fe)
        unsigned char tda8290_agc_tri[] = { 0x02, 0x20 };
        struct i2c_msg msg = {.addr = priv->tda827x_addr, .flags=0, .buf=cb1, .len = 2};
 
-       tda8290_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
        if (priv->ver & TDA8275A)
                cb1[1] = 0x90;
        i2c_transfer(priv->i2c_props.adap, &msg, 1);
-       tda8290_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
        tuner_i2c_xfer_send(&priv->i2c_props, tda8290_agc_tri, 2);
        tuner_i2c_xfer_send(&priv->i2c_props, tda8290_standby, 2);
 }
@@ -537,9 +543,11 @@ static void tda8290_init_tuner(struct dvb_frontend *fe)
        if (priv->ver & TDA8275A)
                msg.buf = tda8275a_init;
 
-       tda8290_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
        i2c_transfer(priv->i2c_props.adap, &msg, 1);
-       tda8290_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 }
 
 /*---------------------------------------------------------------------*/
@@ -565,19 +573,13 @@ static struct tda18271_config tda829x_tda18271_config = {
 static int tda829x_find_tuner(struct dvb_frontend *fe)
 {
        struct tda8290_priv *priv = fe->analog_demod_priv;
-       struct analog_demod_ops *analog_ops = &fe->ops.analog_ops;
        int i, ret, tuners_found;
        u32 tuner_addrs;
        u8 data;
        struct i2c_msg msg = { .flags = I2C_M_RD, .buf = &data, .len = 1 };
 
-       if (!analog_ops->i2c_gate_ctrl) {
-               printk(KERN_ERR "tda8290: no gate control were provided!\n");
-
-               return -EINVAL;
-       }
-
-       analog_ops->i2c_gate_ctrl(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
        /* probe for tuner chip */
        tuners_found = 0;
@@ -595,7 +597,8 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
           give a response now
         */
 
-       analog_ops->i2c_gate_ctrl(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 
        if (tuners_found > 1)
                for (i = 0; i < tuners_found; i++) {
@@ -618,12 +621,14 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
        priv->tda827x_addr = tuner_addrs;
        msg.addr = tuner_addrs;
 
-       analog_ops->i2c_gate_ctrl(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
        ret = i2c_transfer(priv->i2c_props.adap, &msg, 1);
 
        if (ret != 1) {
                tuner_warn("tuner access failed!\n");
-               analog_ops->i2c_gate_ctrl(fe, 0);
+               if (fe->ops.analog_ops.i2c_gate_ctrl)
+                       fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
                return -EREMOTEIO;
        }
 
@@ -648,7 +653,8 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
        if (fe->ops.tuner_ops.sleep)
                fe->ops.tuner_ops.sleep(fe);
 
-       analog_ops->i2c_gate_ctrl(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 
        return 0;
 }
@@ -755,6 +761,9 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
                       sizeof(struct analog_demod_ops));
        }
 
+       if (cfg && cfg->no_i2c_gate)
+               fe->ops.analog_ops.i2c_gate_ctrl = NULL;
+
        if (!(cfg) || (TDA829X_PROBE_TUNER == cfg->probe_tuner)) {
                tda8295_power(fe, 1);
                if (tda829x_find_tuner(fe) < 0)
drivers/media/tuners/tda8290.h +0 -0
index 7e288b2..9959cc8 100644

drivers/media/tuners/tda8290.h struct tda829x_config { · line 32

Quoted 7 lines
drivers/media/tuners/tda8290.h +1 -0
@@ -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))

For the most part, this patch is fine and makes good sense to me. However, instead of adding the option to the config structure, I think you should just set the pointer to i2c_gate_ctrl to NULL from within the bridge driver -- this is what other drivers do when they want to disable a single function in the _ops struct.

I already pushed your patch as-is to the zary branch of my dvb tree on linuxtv.org. If you want to push a new patch that incorporates my suggestion above, then I'll replace the patch. Otherwise, you can also just provide a separate patch against that tree to just remove the config struct change and the NULL assignment in the attach().

-Mike Kruky

#7 lore raw

Re: [PATCH 3/4] tuner-core: Change config from unsigned int to void *

In reply to Michael Krufky

Em Sun, 3 Feb 2013 20:59:12 -0500
Michael Krufky <[email protected]> escreveu:

Quoted 320 lines · Ondrej Zary
Quoted 302 lines

config looks like a hack that was added to tuner-core to allow some configuration of TDA8290 tuner (it's not used by any other driver). But with the new configuration options of tda8290 driver (no_i2c_gate and std_map), it's no longer sufficient.

Change config to be void * instead, which allows passing tuner-dependent config struct to drivers.

Also update saa7134 driver to reflect this change (no other driver uses this).

---
 drivers/media/pci/saa7134/saa7134-cards.c |   40 ++++++++++++++--------------
 drivers/media/pci/saa7134/saa7134.h       |    3 +-
 drivers/media/v4l2-core/tuner-core.c      |   20 +++++---------
 include/media/tuner.h                     |    2 +-
 4 files changed, 30 insertions(+), 35 deletions(-)
drivers/media/pci/saa7134/saa7134-cards.c +20 -20
index bc08f1d..fe54f88 100644
@@ -2760,7 +2760,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -3291,7 +3291,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 1,
+               .tda829x_conf   = { .lna_cfg = 1 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x000200000,
                .inputs         = {{
@@ -3395,7 +3395,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 1,
+               .tda829x_conf   = { .lna_cfg = 1 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200100,
                .inputs         = {{
@@ -3426,7 +3426,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 3,
+               .tda829x_conf   = { .lna_cfg = 3 },
                .mpeg           = SAA7134_MPEG_DVB,
                .ts_type        = SAA7134_MPEG_TS_SERIAL,
                .ts_force_val   = 1,
@@ -3459,7 +3459,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 3,
+               .tda829x_conf   = { .lna_cfg = 3 },
                .mpeg           = SAA7134_MPEG_DVB,
                .ts_type        = SAA7134_MPEG_TS_SERIAL,
                .gpiomask       = 0x0800100, /* GPIO 21 is an INPUT */
@@ -3683,7 +3683,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -3736,7 +3736,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -3754,7 +3754,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 1 << 21,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
@@ -3887,7 +3887,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs = {{
                        .name   = name_tv, /* FIXME: analog tv untested */
@@ -3903,7 +3903,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 0x020200000,
                .inputs         = {{
                        .name = name_tv,
@@ -3937,7 +3937,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .gpiomask       = 0x020200000,
                .inputs         = {{
                        .name = name_tv,
@@ -4737,7 +4737,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = {{
@@ -4823,7 +4823,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type   = UNSET,
                .tuner_addr   = ADDR_UNSET,
                .radio_addr   = ADDR_UNSET,
-               .tuner_config = 0,
+               .tda829x_conf = { .lna_cfg = 0 },
                .mpeg         = SAA7134_MPEG_DVB,
                .inputs       = {{
                        .name = name_tv,
@@ -4847,7 +4847,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = { {
@@ -5057,7 +5057,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 1 << 21,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
@@ -5087,7 +5087,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 2,
+               .tda829x_conf   = { .lna_cfg = 2 },
                .gpiomask       = 1 << 21,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
@@ -5176,7 +5176,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .gpiomask       = 0x0200000,
                .inputs = { {
@@ -5406,7 +5406,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tuner_config   = 0,
+               .tda829x_conf   = { .lna_cfg = 0 },
                .mpeg           = SAA7134_MPEG_DVB,
                .ts_type        = SAA7134_MPEG_TS_PARALLEL,
                .inputs         = {{
@@ -5629,7 +5629,7 @@ struct saa7134_board saa7134_boards[] = {
                .audio_clock    = 0x00187de7,
                .tuner_type     = TUNER_PHILIPS_TDA8290,
                .radio_type     = UNSET,
-               .tuner_config   = 3,
+               .tda829x_conf   = { .lna_cfg = 3 },
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
                .gpiomask       = 0x02050000,
@@ -7616,7 +7616,7 @@ static void saa7134_tuner_setup(struct saa7134_dev *dev)
        if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type != UNSET)) {
                tun_setup.type = dev->tuner_type;
                tun_setup.addr = dev->tuner_addr;
-               tun_setup.config = saa7134_boards[dev->board].tuner_config;
+               tun_setup.config = &saa7134_boards[dev->board].tda829x_conf;
                tun_setup.tuner_callback = saa7134_tuner_callback;
 
                tun_setup.mode_mask = mode_mask;
drivers/media/pci/saa7134/saa7134.h +2 -1
index c24b651..ce1b4b5 100644
@@ -44,6 +44,7 @@
 #if defined(CONFIG_VIDEO_SAA7134_DVB) || defined(CONFIG_VIDEO_SAA7134_DVB_MODULE)
 #include <media/videobuf-dvb.h>
 #endif
+#include "tda8290.h"
 
 #define UNSET (-1U)
 
@@ -388,7 +389,7 @@ struct saa7134_board {
        unsigned char           rds_addr;
 
        unsigned int            tda9887_conf;
-       unsigned int            tuner_config;
+       struct tda829x_config   tda829x_conf;
 
        /* peripheral I/O */
        enum saa7134_video_out  video_out;
drivers/media/v4l2-core/tuner-core.c +7 -13
index b5a819a..14ad8f4 100644
@@ -132,7 +132,7 @@ struct tuner {
        bool                standby;    /* Standby mode */
 
        unsigned int        type; /* chip type id */
-       unsigned int        config;
+       void                *config;
        const char          *name;
 };
 
@@ -272,9 +272,8 @@ static struct analog_demod_ops tuner_analog_ops = {
  * @c:                 i2c_client descriptoy
  * @type:              type of the tuner (e. g. tuner number)
  * @new_mode_mask:     Indicates if tuner supports TV and/or Radio
- * @new_config:                an optional parameter ranging from 0-255 used by
-                       a few tuners to adjust an internal parameter,
-                       like LNA mode
+ * @new_config:                an optional parameter used by a few tuners to adjust
+                       internal parameters, like LNA mode
  * @tuner_callback:    an optional function to be called when switching
  *                     to analog mode
  *
@@ -282,7 +281,7 @@ static struct analog_demod_ops tuner_analog_ops = {
  * by tun_setup structure. It contains several per-tuner initialization "magic"
  */
 static void set_type(struct i2c_client *c, unsigned int type,
-                    unsigned int new_mode_mask, unsigned int new_config,
+                    unsigned int new_mode_mask, void *new_config,
                     int (*tuner_callback) (void *dev, int component, int cmd, int arg))
 {
        struct tuner *t = to_tuner(i2c_get_clientdata(c));
@@ -297,8 +296,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
        }
 
        t->type = type;
-       /* prevent invalid config values */
-       t->config = new_config < 256 ? new_config : 0;
+       t->config = new_config;
        if (tuner_callback != NULL) {
                tuner_dbg("defining GPIO callback\n");
                t->fe.callback = tuner_callback;
@@ -316,11 +314,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
                break;
        case TUNER_PHILIPS_TDA8290:
        {
-               struct tda829x_config cfg = {
-                       .lna_cfg        = t->config,
-               };
                if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter,
-                               t->i2c->addr, &cfg))
+                               t->i2c->addr, t->config))
                        goto attach_failed;
                break;
        }
@@ -409,7 +404,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
        case TUNER_NXP_TDA18271:
        {
                struct tda18271_config cfg = {
-                       .config = t->config,
                        .small_i2c = TDA18271_03_BYTE_CHUNK_INIT,
                };
 
@@ -506,7 +500,7 @@ static int tuner_s_type_addr(struct v4l2_subdev *sd,
        struct tuner *t = to_tuner(sd);
        struct i2c_client *c = v4l2_get_subdevdata(sd);
 
-       tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=0x%02x\n",
+       tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=%p\n",
                        tun_setup->type,
                        tun_setup->addr,
                        tun_setup->mode_mask,
include/media/tuner.h +0 -0
index 926aff9..c60552b 100644

include/media/tuner.h struct tuner_setup { · line 193

Quoted 7 lines
include/media/tuner.h +1 -1
@@ -188,7 +188,7 @@ struct tuner_setup {
        unsigned short  addr;   /* I2C address */
        unsigned int    type;   /* Tuner type */
        unsigned int    mode_mask;  /* Allowed tuner modes */
-       unsigned int    config; /* configuraion for more complex tuners */
+       void            *config;    /* configuraion for more complex tuners */
        int (*tuner_callback) (void *dev, int component, int cmd, int arg);
 };

I pushed patch 1 & 2 into the 'zary' branch of my 'dvb' git tree on linuxtv.org -- I am going to do some testing and then issue a merge request to Mauro if all is OK.

As for this patch, I think this is a good idea, but I think the patch should be resent with RFC in the title, to ensure that everybody sees that you're proposing a tuner internal API change (unless Mauro has any comments in this thread)

Quoted 4 lines

I'm still digging a bit to make sure this doesn't have any negative effect on the tda827x driver, but it looks safe to me right now.

I'd like to hear Mauro's comments on this too, but it looks good to me.

It looks good to me, as it makes clearer for what purpose the config is being used.

I would also change the magic values for LNA config to some enum, as "0", "1", "2", "3" doesn't bring any meaning.
It would be better to call it with something like:

enum tda8290_lna {
	TDA8290_LNA_OFF = 0,
	TDA8290_LNA_GP0_HIGH_ON = 1,
	TDA8290_LNA_GP0_HIGH_OFF = 2,
	TDA8290_LNA_ON_BRIDGE = 3,
};

and replace the magic number occurrences at tda8290, tda827x and saa713x.

Quoted 2 lines
Signature · 2 lines
Cheers,
Mauro
#3 lore raw

Re: [PATCH 1/4] tda8290: Allow disabling I2C gate

In reply to Michael Krufky
Quoted 1 line · On Monday 04 February 2013 03:19:37 Michael Krufky wrote:

On Fri, Feb 1, 2013 at 3:21 PM, Ondrej Zary <[email protected]>

Quoted 169 lines · wrote:
Quoted 169 lines

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.

---
 drivers/media/tuners/tda8290.c |   49
+++++++++++++++++++++++---------------- drivers/media/tuners/tda8290.h | 
  1 +
 2 files changed, 30 insertions(+), 20 deletions(-)
(quoted diff) +0 -0

b/drivers/media/tuners/tda8290.c index 8c48521..a2b7a9f 100644

drivers/media/tuners/tda8290.c +8 -4
@@ -233,7 +233,8 @@ static void tda8290_set_params(struct dvb_frontend
 *fe, }
 
 
-       tda8290_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
        if (fe->ops.tuner_ops.set_analog_params)
                fe->ops.tuner_ops.set_analog_params(fe, params);
@@ -302,7 +303,8 @@ static void tda8290_set_params(struct dvb_frontend
 *fe, }
        }
 
-       tda8290_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
        tuner_i2c_xfer_send(&priv->i2c_props, if_agc_set, 2);
 }
 
@@ -424,7 +426,8 @@ static void tda8295_set_params(struct dvb_frontend
 *fe, tuner_i2c_xfer_send(&priv->i2c_props, blanking_mode, 2); msleep(20);
 
-       tda8295_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
        if (fe->ops.tuner_ops.set_analog_params)
                fe->ops.tuner_ops.set_analog_params(fe, params);
@@ -437,7 +440,8 @@ static void tda8295_set_params(struct dvb_frontend
 *fe, else
                tuner_dbg("tda8295 not locked, no signal?\n");
 
-       tda8295_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 }
 
 

/*---------------------------------------------------------------------*/

drivers/media/tuners/tda8290.c +4 -2
@@ -465,11 +469,13 @@ static void tda8290_standby(struct dvb_frontend
 *fe) unsigned char tda8290_agc_tri[] = { 0x02, 0x20 };
        struct i2c_msg msg = {.addr = priv->tda827x_addr, .flags=0,
 .buf=cb1, .len = 2};
 
-       tda8290_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
        if (priv->ver & TDA8275A)
                cb1[1] = 0x90;
        i2c_transfer(priv->i2c_props.adap, &msg, 1);
-       tda8290_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
        tuner_i2c_xfer_send(&priv->i2c_props, tda8290_agc_tri, 2);
        tuner_i2c_xfer_send(&priv->i2c_props, tda8290_standby, 2);

}

drivers/media/tuners/tda8290.c +4 -2
@@ -537,9 +543,11 @@ static void tda8290_init_tuner(struct dvb_frontend
 *fe) if (priv->ver & TDA8275A)
                msg.buf = tda8275a_init;
 
-       tda8290_i2c_bridge(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
        i2c_transfer(priv->i2c_props.adap, &msg, 1);
-       tda8290_i2c_bridge(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 }
 
 

/*---------------------------------------------------------------------*/

drivers/media/tuners/tda8290.c +0 -0
@@ -565,19 +573,13 @@ static struct tda18271_config

tda829x_tda18271_config = { static int tda829x_find_tuner(struct dvb_frontend *fe)

 {
        struct tda8290_priv *priv = fe->analog_demod_priv;
-       struct analog_demod_ops *analog_ops = &fe->ops.analog_ops;
        int i, ret, tuners_found;
        u32 tuner_addrs;
        u8 data;
        struct i2c_msg msg = { .flags = I2C_M_RD, .buf = &data, .len = 1
};
drivers/media/tuners/tda8290.c +0 -2
-       if (!analog_ops->i2c_gate_ctrl) {
-               printk(KERN_ERR "tda8290: no gate control were

provided!\n"); -

drivers/media/tuners/tda8290.c +13 -8
-               return -EINVAL;
-       }
-
-       analog_ops->i2c_gate_ctrl(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
 
        /* probe for tuner chip */
        tuners_found = 0;
@@ -595,7 +597,8 @@ static int tda829x_find_tuner(struct dvb_frontend
 *fe) give a response now
         */
 
-       analog_ops->i2c_gate_ctrl(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 
        if (tuners_found > 1)
                for (i = 0; i < tuners_found; i++) {
@@ -618,12 +621,14 @@ static int tda829x_find_tuner(struct dvb_frontend
 *fe) priv->tda827x_addr = tuner_addrs;
        msg.addr = tuner_addrs;
 
-       analog_ops->i2c_gate_ctrl(fe, 1);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 1);
        ret = i2c_transfer(priv->i2c_props.adap, &msg, 1);
 
        if (ret != 1) {
                tuner_warn("tuner access failed!\n");
-               analog_ops->i2c_gate_ctrl(fe, 0);
+               if (fe->ops.analog_ops.i2c_gate_ctrl)
+                       fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
                return -EREMOTEIO;
        }
 
@@ -648,7 +653,8 @@ static int tda829x_find_tuner(struct dvb_frontend
 *fe) if (fe->ops.tuner_ops.sleep)
                fe->ops.tuner_ops.sleep(fe);
 
-       analog_ops->i2c_gate_ctrl(fe, 0);
+       if (fe->ops.analog_ops.i2c_gate_ctrl)
+               fe->ops.analog_ops.i2c_gate_ctrl(fe, 0);
 
        return 0;
 }
@@ -755,6 +761,9 @@ struct dvb_frontend *tda829x_attach(struct
 dvb_frontend *fe, sizeof(struct analog_demod_ops));
        }
 
+       if (cfg && cfg->no_i2c_gate)
+               fe->ops.analog_ops.i2c_gate_ctrl = NULL;
+
        if (!(cfg) || (TDA829X_PROBE_TUNER == cfg->probe_tuner)) {
                tda8295_power(fe, 1);
                if (tda829x_find_tuner(fe) < 0)
(quoted diff) +0 -0

b/drivers/media/tuners/tda8290.h index 7e288b2..9959cc8 100644

drivers/media/tuners/tda8290.h +1 -0
@@ -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;
 };
 
Quoted 8 lines
Quoted 2 lines
drivers/media/tuners/tda8290.h +0 -0
 #if defined(CONFIG_MEDIA_TUNER_TDA8290) ||

(defined(CONFIG_MEDIA_TUNER_TDA8290_MODULE) && defined(MODULE))

For the most part, this patch is fine and makes good sense to me. However, instead of adding the option to the config structure, I think you should just set the pointer to i2c_gate_ctrl to NULL from within the bridge driver -- this is what other drivers do when they want to disable a single function in the _ops struct.

I don't see any other way to set i2c_gate_ctrl to NULL. saa7134 calls s_type_addr and passes the config parameter. tuner-core finds that the tuner type is TDA8290 and calls tda829x_attach which does tuner autodetecion. i2c_gate_ctrl must be set to NULL before this or the detection will fail.

Quoted 7 lines

I already pushed your patch as-is to the zary branch of my dvb tree on linuxtv.org. If you want to push a new patch that incorporates my suggestion above, then I'll replace the patch. Otherwise, you can also just provide a separate patch against that tree to just remove the config struct change and the NULL assignment in the attach().

-Mike Kruky

Signature · 1 line
Ondrej Zary
#8 lore raw

PATCH 1/1 tda8290: change magic LNA config values to enum

In reply to Mauro Carvalho Chehab

Use enum instead of magic values for LNA config in tda8290. Update tda827x, tda18271 and saa7134 to use the enum too.

---
 drivers/media/pci/saa7134/saa7134-cards.c |   41 +++++++++++++++--------------
 drivers/media/tuners/tda18271-fe.c        |    9 +++---
 drivers/media/tuners/tda827x.c            |   10 +++---
 drivers/media/tuners/tda827x.h            |    3 +-
 drivers/media/tuners/tda8290.c            |    3 +-
 drivers/media/tuners/tda8290.h            |    9 +++++-
 6 files changed, 43 insertions(+), 32 deletions(-)
drivers/media/pci/saa7134/saa7134-cards.c +21 -20
index c603064..f8069f5 100644
@@ -2765,7 +2765,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 0 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -3296,7 +3296,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 1 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_ON },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x000200000,
 		.inputs         = {{
@@ -3400,7 +3400,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 1 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_ON },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200100,
 		.inputs         = {{
@@ -3431,7 +3431,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 3 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_ON_BRIDGE },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.ts_type	= SAA7134_MPEG_TS_SERIAL,
 		.ts_force_val   = 1,
@@ -3464,7 +3464,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 3 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_ON_BRIDGE },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.ts_type	= SAA7134_MPEG_TS_SERIAL,
 		.gpiomask       = 0x0800100, /* GPIO 21 is an INPUT */
@@ -3688,7 +3688,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -3741,7 +3741,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -3759,7 +3759,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.gpiomask	= 1 << 21,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs         = {{
@@ -3892,7 +3892,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 0 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs = {{
 			.name   = name_tv, /* FIXME: analog tv untested */
@@ -3908,7 +3908,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.gpiomask       = 0x020200000,
 		.inputs         = {{
 			.name = name_tv,
@@ -3942,7 +3942,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type	= UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf	= { .lna_cfg = 0 },
+		.tda829x_conf	= { .lna_cfg = TDA8290_LNA_OFF },
 		.gpiomask	= 0x020200000,
 		.inputs		= {{
 			.name = name_tv,
@@ -4742,7 +4742,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = {{
@@ -4828,7 +4828,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type   = UNSET,
 		.tuner_addr   = ADDR_UNSET,
 		.radio_addr   = ADDR_UNSET,
-		.tda829x_conf = { .lna_cfg = 0 },
+		.tda829x_conf = { .lna_cfg = TDA8290_LNA_OFF },
 		.mpeg         = SAA7134_MPEG_DVB,
 		.inputs       = {{
 			.name = name_tv,
@@ -4852,7 +4852,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = { {
@@ -5062,7 +5062,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.gpiomask       = 1 << 21,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs         = {{
@@ -5092,7 +5092,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 2 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_GP0_HIGH_OFF },
 		.gpiomask       = 1 << 21,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs         = {{
@@ -5181,7 +5181,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 0 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x0200000,
 		.inputs = { {
@@ -5411,7 +5411,7 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 0 },
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_OFF },
 		.mpeg           = SAA7134_MPEG_DVB,
 		.ts_type	= SAA7134_MPEG_TS_PARALLEL,
 		.inputs         = {{
@@ -5634,7 +5634,7 @@ struct saa7134_board saa7134_boards[] = {
 		.audio_clock	= 0x00187de7,
 		.tuner_type	= TUNER_PHILIPS_TDA8290,
 		.radio_type	= UNSET,
-		.tda829x_conf	= { .lna_cfg = 3 },
+		.tda829x_conf	= { .lna_cfg = TDA8290_LNA_ON_BRIDGE },
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
 		.gpiomask	= 0x02050000,
@@ -5785,7 +5785,8 @@ struct saa7134_board saa7134_boards[] = {
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tda829x_conf   = { .lna_cfg = 0, .no_i2c_gate = 1,
+		.tda829x_conf   = { .lna_cfg = TDA8290_LNA_OFF,
+				    .no_i2c_gate = 1,
 				    .tda18271_std_map = &aver_a706_std_map },
 		.gpiomask       = 1 << 11,
 		.mpeg           = SAA7134_MPEG_DVB,
drivers/media/tuners/tda18271-fe.c +5 -4
index 72c26fd..e3f6aa2 100644
@@ -21,6 +21,7 @@
 #include <linux/delay.h>
 #include <linux/videodev2.h>
 #include "tda18271-priv.h"
+#include "tda8290.h"
 
 int tda18271_debug;
 module_param_named(debug, tda18271_debug, int, 0644);
@@ -867,12 +868,12 @@ static int tda18271_agc(struct dvb_frontend *fe)
 	int ret = 0;
 
 	switch (priv->config) {
-	case 0:
+	case TDA8290_LNA_OFF:
 		/* no external agc configuration required */
 		if (tda18271_debug & DBG_ADV)
 			tda_dbg("no agc configuration provided\n");
 		break;
-	case 3:
+	case TDA8290_LNA_ON_BRIDGE:
 		/* switch with GPIO of saa713x */
 		tda_dbg("invoking callback\n");
 		if (fe->callback)
@@ -881,8 +882,8 @@ static int tda18271_agc(struct dvb_frontend *fe)
 					   TDA18271_CALLBACK_CMD_AGC_ENABLE,
 					   priv->mode);
 		break;
-	case 1:
-	case 2:
+	case TDA8290_LNA_GP0_HIGH_ON:
+	case TDA8290_LNA_GP0_HIGH_OFF:
 	default:
 		/* n/a - currently not supported */
 		tda_err("unsupported configuration: %d\n", priv->config);
drivers/media/tuners/tda827x.c +5 -5
index a0d1762..73453a2 100644
@@ -479,10 +479,10 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
 			dprintk("setting LNA to low gain\n");
 	}
 	switch (priv->cfg->config) {
-	case 0: /* no LNA */
+	case TDA8290_LNA_OFF: /* no LNA */
 		break;
-	case 1: /* switch is GPIO 0 of tda8290 */
-	case 2:
+	case TDA8290_LNA_GP0_HIGH_ON: /* switch is GPIO 0 of tda8290 */
+	case TDA8290_LNA_GP0_HIGH_OFF:
 		if (params == NULL) {
 			gp_func = 0;
 			arg  = 0;
@@ -499,11 +499,11 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
 				     DVB_FRONTEND_COMPONENT_TUNER,
 				     gp_func, arg);
 		buf[1] = high ? 0 : 1;
-		if (priv->cfg->config == 2)
+		if (priv->cfg->config == TDA8290_LNA_GP0_HIGH_OFF)
 			buf[1] = high ? 1 : 0;
 		tuner_transfer(fe, &msg, 1);
 		break;
-	case 3: /* switch with GPIO of saa713x */
+	case TDA8290_LNA_ON_BRIDGE: /* switch with GPIO of saa713x */
 		if (fe->callback)
 			fe->callback(priv->i2c_adap->algo_data,
 				     DVB_FRONTEND_COMPONENT_TUNER, 0, high);
drivers/media/tuners/tda827x.h +2 -1
index 7d72ce0..080b4bd 100644
@@ -26,6 +26,7 @@
 
 #include <linux/i2c.h>
 #include "dvb_frontend.h"
+#include "tda8290.h"
 
 struct tda827x_config
 {
@@ -34,7 +35,7 @@ struct tda827x_config
 	int (*sleep) (struct dvb_frontend *fe);
 
 	/* interface to tda829x driver */
-	unsigned int config;
+	enum tda8290_lna config;
 	int 	     switch_addr;
 
 	void (*agcf)(struct dvb_frontend *fe);
drivers/media/tuners/tda8290.c +2 -1
index c1ade88..20cc7da 100644
@@ -496,7 +496,8 @@ static void tda8290_init_if(struct dvb_frontend *fe)
 	unsigned char set_GP00_CF[] = { 0x20, 0x01 };
 	unsigned char set_GP01_CF[] = { 0x20, 0x0B };
 
-	if ((priv->cfg.config == 1) || (priv->cfg.config == 2))
+	if ((priv->cfg.config == TDA8290_LNA_GP0_HIGH_ON) ||
+	    (priv->cfg.config == TDA8290_LNA_GP0_HIGH_OFF))
 		tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2);
 	else
 		tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2);
drivers/media/tuners/tda8290.h +8 -1
index 280b70d..d3a3754 100644
@@ -21,8 +21,15 @@
 #include "dvb_frontend.h"
 #include "tda18271.h"
 
+enum tda8290_lna {
+	TDA8290_LNA_OFF = 0,
+	TDA8290_LNA_GP0_HIGH_ON = 1,
+	TDA8290_LNA_GP0_HIGH_OFF = 2,
+	TDA8290_LNA_ON_BRIDGE = 3,
+};
+
 struct tda829x_config {
-	unsigned int lna_cfg;
+	enum tda8290_lna lna_cfg;
 
 	unsigned int probe_tuner:1;
 #define TDA829X_PROBE_TUNER 0
Signature · 1 line
Ondrej Zary
#10 lore raw
In reply to Ondrej Zary
Quoted 6 lines · On Friday 01 February 2013 21:21:23 Ondrej Zary wrote:

Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.

This requires some changes to tda8290 - disabling I2C gate control and passing custom std_map to tda18271.
Also tuner-core needs to be changed because there's currently no way to pass any complex configuration to analog tuners.

What's the status of this patch series?

The two tda8290 patches are in Michael's dvb tree.
I've sent an additional clean-up patch (on Mauro's suggestion) for the tuner-core change.
I guess that the final AverMedia A706 patch would be easily merged once the tda8290 and tuner-core changess are done.

Should I resend something?

Signature · 1 line
Ondrej Zary
maintainer
#11 lore raw
Quoted 10 lines · Ondrej Zary
Quoted 6 lines · On Friday 01 February 2013 21:21:23 Ondrej Zary wrote:

Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.

This requires some changes to tda8290 - disabling I2C gate control and passing custom std_map to tda18271.
Also tuner-core needs to be changed because there's currently no way to pass any complex configuration to analog tuners.

What's the status of this patch series?

Quoted 7 lines

The two tda8290 patches are in Michael's dvb tree.
I've sent an additional clean-up patch (on Mauro's suggestion) for the tuner-core change.
I guess that the final AverMedia A706 patch would be easily merged once the tda8290 and tuner-core changess are done.

Should I resend something?

I've just been a bit busier lately that I had foreseen, but no need to resend anything - I have your patches. You'll hear back from me shortly.

-Mike

#12 lore raw
Quoted 19 lines · On Monday 18 February 2013 03:57:01 Michael Krufky wrote:

On Sat, Feb 16, 2013 at 11:39 AM, Ondrej Zary

Quoted 16 lines · <[email protected]> wrote:
Quoted 6 lines · On Friday 01 February 2013 21:21:23 Ondrej Zary wrote:

Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.

This requires some changes to tda8290 - disabling I2C gate control and passing custom std_map to tda18271.
Also tuner-core needs to be changed because there's currently no way to pass any complex configuration to analog tuners.

What's the status of this patch series?

The two tda8290 patches are in Michael's dvb tree.
I've sent an additional clean-up patch (on Mauro's suggestion) for the tuner-core change.
I guess that the final AverMedia A706 patch would be easily merged once the tda8290 and tuner-core changess are done.

Quoted 5 lines
Quoted 1 line

Should I resend something?

I've just been a bit busier lately that I had foreseen, but no need to resend anything - I have your patches. You'll hear back from me shortly.

Any news about these patches?

Signature · 1 line
Ondrej Zary