[media] tda8290: Allow custom std_map for tda18271
authorOndrej Zary <linux@rainbow-software.org>
Mon, 4 Feb 2013 01:48:56 +0000 (22:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 8 Apr 2013 10:01:15 +0000 (07:01 -0300)
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.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/tuners/tda8290.c
drivers/media/tuners/tda8290.h

index a2b7a9fbd34496ec6256e98a85f9cc9899b37f8f..c1ade88d1fa820fbcb528b7f524f8e4253f4238c 100644 (file)
@@ -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;
index b5b51a94774769cdc703b30e6044b9b525deed94..97f1d0f848ef9280922770ce517958323f6940ec 100644 (file)
@@ -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 IS_ENABLED(CONFIG_MEDIA_TUNER_TDA8290)