summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-03-16 02:03:10 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2008-03-16 02:03:10 -0400
commit789807b595b6dd355f2a5e977abdb0d29fa79b9b (patch)
tree079a1410ba8037d0e4383e32eab6cdcfb964a7e2 /linux/drivers
parent9b2fc6e632ea78f1468b96849432b82c66645554 (diff)
downloadmediapointer-dvb-s2-789807b595b6dd355f2a5e977abdb0d29fa79b9b.tar.gz
mediapointer-dvb-s2-789807b595b6dd355f2a5e977abdb0d29fa79b9b.tar.bz2
tuner-simple: add module options to specify rf input
From: Michael Krufky <mkrufky@linuxtv.org> Add module options to tuner-simple, called "atv_input" and "dtv_input" to specify which rf input to use on devices with multiple rf inputs. If the module option is not specified, then the driver will autoselect the rf input, as per previous behavior. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/tuner-simple.c59
1 files changed, 47 insertions, 12 deletions
diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c
index 5a45aca63..772bfefbe 100644
--- a/linux/drivers/media/video/tuner-simple.c
+++ b/linux/drivers/media/video/tuner-simple.c
@@ -21,6 +21,9 @@ static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable verbose debug messages");
+#define TUNER_SIMPLE_MAX 64
+static unsigned int simple_devcount;
+
static int offset;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MODULE_PARM(offset, "i");
@@ -29,6 +32,15 @@ module_param(offset, int, 0664);
#endif
MODULE_PARM_DESC(offset, "Allows to specify an offset for tuner");
+static unsigned int atv_input[TUNER_SIMPLE_MAX] = \
+ { [0 ... (TUNER_SIMPLE_MAX-1)] = 0 };
+static unsigned int dtv_input[TUNER_SIMPLE_MAX] = \
+ { [0 ... (TUNER_SIMPLE_MAX-1)] = 0 };
+module_param_array(atv_input, int, NULL, 0644);
+module_param_array(dtv_input, int, NULL, 0644);
+MODULE_PARM_DESC(atv_input, "specify atv rf input, 0 for autoselect");
+MODULE_PARM_DESC(dtv_input, "specify dtv rf input, 0 for autoselect");
+
/* ---------------------------------------------------------------------- */
/* tv standard selection for Temic 4046 FM5
@@ -100,6 +112,7 @@ static DEFINE_MUTEX(tuner_simple_list_mutex);
static LIST_HEAD(hybrid_tuner_instance_list);
struct tuner_simple_priv {
+ unsigned int nr;
u16 last_div;
struct tuner_i2c_props i2c_props;
@@ -378,7 +391,6 @@ static int simple_std_setup(struct dvb_frontend *fe,
*cb &= ~0x03;
if (!(params->std & V4L2_STD_ATSC))
*cb |= 2;
- /* FIXME: input */
break;
case TUNER_MICROTUNE_4042FI5:
@@ -410,10 +422,11 @@ static int simple_std_setup(struct dvb_frontend *fe,
tuner_warn("i2c i/o error: rc == %d "
"(should be 2)\n", rc);
priv->i2c_props.addr = tuneraddr;
- /* FIXME: input */
break;
}
}
+ if (atv_input[priv->nr])
+ simple_set_rf_input(fe, config, cb, atv_input[priv->nr]);
return 0;
}
@@ -797,16 +810,19 @@ static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
{
unsigned int new_rf;
- switch (params->u.vsb.modulation) {
- case QAM_64:
- case QAM_256:
- new_rf = 1;
- break;
- case VSB_8:
- default:
- new_rf = 0;
- break;
- }
+ if (dtv_input[priv->nr])
+ new_rf = dtv_input[priv->nr];
+ else
+ switch (params->u.vsb.modulation) {
+ case QAM_64:
+ case QAM_256:
+ new_rf = 1;
+ break;
+ case VSB_8:
+ default:
+ new_rf = 0;
+ break;
+ }
simple_set_rf_input(fe, &buf[2], &buf[3], new_rf);
break;
}
@@ -1060,6 +1076,7 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
priv->type = type;
priv->tun = &tuners[type];
+ priv->nr = simple_devcount++;
break;
default:
fe->tuner_priv = priv;
@@ -1081,6 +1098,24 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
tuner_info("type set to %d (%s)\n", type, priv->tun->name);
+ if ((debug) || ((atv_input[priv->nr] > 0) ||
+ (dtv_input[priv->nr] > 0))) {
+ if (0 == atv_input[priv->nr])
+ tuner_info("tuner %d atv rf input will be "
+ "autoselected\n", priv->nr);
+ else
+ tuner_info("tuner %d atv rf input will be "
+ "set to input %d (insmod option)\n",
+ priv->nr, atv_input[priv->nr]);
+ if (0 == dtv_input[priv->nr])
+ tuner_info("tuner %d dtv rf input will be "
+ "autoselected\n", priv->nr);
+ else
+ tuner_info("tuner %d dtv rf input will be "
+ "set to input %d (insmod option)\n",
+ priv->nr, dtv_input[priv->nr]);
+ }
+
strlcpy(fe->ops.tuner_ops.info.name, priv->tun->name,
sizeof(fe->ops.tuner_ops.info.name));