V4L/DVB (6962): tda18271: allow device-specific configuration of IF frequency and std bits

Allow drivers to pass device-specific configuration parameters during attach.

If these parameters are omitted, default values will be used.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index 81dd47f..948a7fb 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -183,6 +183,16 @@
 	.probe_tuner = TDA829X_DONT_PROBE,
 };
 
+static struct tda18271_std_map hauppauge_tda18271_std_map = {
+	.atsc_6   = { .if_freq = 5380000, .std_bits = 0x1b },
+	.qam_6    = { .if_freq = 4000000, .std_bits = 0x18 },
+};
+
+static struct tda18271_config hauppauge_tda18271_config = {
+	.std_map = &hauppauge_tda18271_std_map,
+	.gate    = TDA18271_GATE_ANALOG,
+};
+
 static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg)
 {
 	struct cx23885_tsport *port = ptr;
@@ -248,7 +258,7 @@
 					   &tda829x_no_probe);
 				dvb_attach(tda18271_attach, port->dvb.frontend,
 					   0x60, &dev->i2c_bus[1].i2c_adap,
-					   TDA18271_GATE_ANALOG);
+					   &hauppauge_tda18271_config);
 			}
 			break;
 		case 0:
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 54d261a..eab5307 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -509,6 +509,10 @@
 	fe->analog_demod_priv = NULL;
 }
 
+static struct tda18271_config tda829x_tda18271_config = {
+	.gate    = TDA18271_GATE_ANALOG,
+};
+
 static int tda829x_find_tuner(struct dvb_frontend *fe)
 {
 	struct tda8290_priv *priv = fe->analog_demod_priv;
@@ -574,7 +578,7 @@
 		priv->ver |= TDA18271;
 		tda18271_attach(fe, priv->tda827x_addr,
 				priv->i2c_props.adap,
-				TDA18271_GATE_ANALOG);
+				&tda829x_tda18271_config);
 	} else {
 		if ((data & 0x3c) == 0)
 			priv->ver |= TDA8275;