aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/tuners
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r--drivers/media/tuners/tda18271-fe.c9
-rw-r--r--drivers/media/tuners/tda827x.c10
-rw-r--r--drivers/media/tuners/tda827x.h3
-rw-r--r--drivers/media/tuners/tda8290.c3
-rw-r--r--drivers/media/tuners/tda8290.h9
5 files changed, 22 insertions, 12 deletions
diff --git a/drivers/media/tuners/tda18271-fe.c b/drivers/media/tuners/tda18271-fe.c
index e7786862dab2..4995b890c164 100644
--- a/drivers/media/tuners/tda18271-fe.c
+++ b/drivers/media/tuners/tda18271-fe.c
@@ -21,6 +21,7 @@
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/videodev2.h> 22#include <linux/videodev2.h>
23#include "tda18271-priv.h" 23#include "tda18271-priv.h"
24#include "tda8290.h"
24 25
25int tda18271_debug; 26int tda18271_debug;
26module_param_named(debug, tda18271_debug, int, 0644); 27module_param_named(debug, tda18271_debug, int, 0644);
@@ -867,12 +868,12 @@ static int tda18271_agc(struct dvb_frontend *fe)
867 int ret = 0; 868 int ret = 0;
868 869
869 switch (priv->config) { 870 switch (priv->config) {
870 case 0: 871 case TDA8290_LNA_OFF:
871 /* no external agc configuration required */ 872 /* no external agc configuration required */
872 if (tda18271_debug & DBG_ADV) 873 if (tda18271_debug & DBG_ADV)
873 tda_dbg("no agc configuration provided\n"); 874 tda_dbg("no agc configuration provided\n");
874 break; 875 break;
875 case 3: 876 case TDA8290_LNA_ON_BRIDGE:
876 /* switch with GPIO of saa713x */ 877 /* switch with GPIO of saa713x */
877 tda_dbg("invoking callback\n"); 878 tda_dbg("invoking callback\n");
878 if (fe->callback) 879 if (fe->callback)
@@ -881,8 +882,8 @@ static int tda18271_agc(struct dvb_frontend *fe)
881 TDA18271_CALLBACK_CMD_AGC_ENABLE, 882 TDA18271_CALLBACK_CMD_AGC_ENABLE,
882 priv->mode); 883 priv->mode);
883 break; 884 break;
884 case 1: 885 case TDA8290_LNA_GP0_HIGH_ON:
885 case 2: 886 case TDA8290_LNA_GP0_HIGH_OFF:
886 default: 887 default:
887 /* n/a - currently not supported */ 888 /* n/a - currently not supported */
888 tda_err("unsupported configuration: %d\n", priv->config); 889 tda_err("unsupported configuration: %d\n", priv->config);
diff --git a/drivers/media/tuners/tda827x.c b/drivers/media/tuners/tda827x.c
index a0d176267470..73453a255cdc 100644
--- a/drivers/media/tuners/tda827x.c
+++ b/drivers/media/tuners/tda827x.c
@@ -479,10 +479,10 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
479 dprintk("setting LNA to low gain\n"); 479 dprintk("setting LNA to low gain\n");
480 } 480 }
481 switch (priv->cfg->config) { 481 switch (priv->cfg->config) {
482 case 0: /* no LNA */ 482 case TDA8290_LNA_OFF: /* no LNA */
483 break; 483 break;
484 case 1: /* switch is GPIO 0 of tda8290 */ 484 case TDA8290_LNA_GP0_HIGH_ON: /* switch is GPIO 0 of tda8290 */
485 case 2: 485 case TDA8290_LNA_GP0_HIGH_OFF:
486 if (params == NULL) { 486 if (params == NULL) {
487 gp_func = 0; 487 gp_func = 0;
488 arg = 0; 488 arg = 0;
@@ -499,11 +499,11 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
499 DVB_FRONTEND_COMPONENT_TUNER, 499 DVB_FRONTEND_COMPONENT_TUNER,
500 gp_func, arg); 500 gp_func, arg);
501 buf[1] = high ? 0 : 1; 501 buf[1] = high ? 0 : 1;
502 if (priv->cfg->config == 2) 502 if (priv->cfg->config == TDA8290_LNA_GP0_HIGH_OFF)
503 buf[1] = high ? 1 : 0; 503 buf[1] = high ? 1 : 0;
504 tuner_transfer(fe, &msg, 1); 504 tuner_transfer(fe, &msg, 1);
505 break; 505 break;
506 case 3: /* switch with GPIO of saa713x */ 506 case TDA8290_LNA_ON_BRIDGE: /* switch with GPIO of saa713x */
507 if (fe->callback) 507 if (fe->callback)
508 fe->callback(priv->i2c_adap->algo_data, 508 fe->callback(priv->i2c_adap->algo_data,
509 DVB_FRONTEND_COMPONENT_TUNER, 0, high); 509 DVB_FRONTEND_COMPONENT_TUNER, 0, high);
diff --git a/drivers/media/tuners/tda827x.h b/drivers/media/tuners/tda827x.h
index 9432b5b6121b..b64292152baf 100644
--- a/drivers/media/tuners/tda827x.h
+++ b/drivers/media/tuners/tda827x.h
@@ -26,6 +26,7 @@
26 26
27#include <linux/i2c.h> 27#include <linux/i2c.h>
28#include "dvb_frontend.h" 28#include "dvb_frontend.h"
29#include "tda8290.h"
29 30
30struct tda827x_config 31struct tda827x_config
31{ 32{
@@ -34,7 +35,7 @@ struct tda827x_config
34 int (*sleep) (struct dvb_frontend *fe); 35 int (*sleep) (struct dvb_frontend *fe);
35 36
36 /* interface to tda829x driver */ 37 /* interface to tda829x driver */
37 unsigned int config; 38 enum tda8290_lna config;
38 int switch_addr; 39 int switch_addr;
39 40
40 void (*agcf)(struct dvb_frontend *fe); 41 void (*agcf)(struct dvb_frontend *fe);
diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c
index c1ade88d1fa8..20cc7dad6b4e 100644
--- a/drivers/media/tuners/tda8290.c
+++ b/drivers/media/tuners/tda8290.c
@@ -496,7 +496,8 @@ static void tda8290_init_if(struct dvb_frontend *fe)
496 unsigned char set_GP00_CF[] = { 0x20, 0x01 }; 496 unsigned char set_GP00_CF[] = { 0x20, 0x01 };
497 unsigned char set_GP01_CF[] = { 0x20, 0x0B }; 497 unsigned char set_GP01_CF[] = { 0x20, 0x0B };
498 498
499 if ((priv->cfg.config == 1) || (priv->cfg.config == 2)) 499 if ((priv->cfg.config == TDA8290_LNA_GP0_HIGH_ON) ||
500 (priv->cfg.config == TDA8290_LNA_GP0_HIGH_OFF))
500 tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2); 501 tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2);
501 else 502 else
502 tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2); 503 tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2);
diff --git a/drivers/media/tuners/tda8290.h b/drivers/media/tuners/tda8290.h
index 97f1d0f848ef..cf96e585785e 100644
--- a/drivers/media/tuners/tda8290.h
+++ b/drivers/media/tuners/tda8290.h
@@ -21,8 +21,15 @@
21#include "dvb_frontend.h" 21#include "dvb_frontend.h"
22#include "tda18271.h" 22#include "tda18271.h"
23 23
24enum tda8290_lna {
25 TDA8290_LNA_OFF = 0,
26 TDA8290_LNA_GP0_HIGH_ON = 1,
27 TDA8290_LNA_GP0_HIGH_OFF = 2,
28 TDA8290_LNA_ON_BRIDGE = 3,
29};
30
24struct tda829x_config { 31struct tda829x_config {
25 unsigned int lna_cfg; 32 enum tda8290_lna lna_cfg;
26 33
27 unsigned int probe_tuner:1; 34 unsigned int probe_tuner:1;
28#define TDA829X_PROBE_TUNER 0 35#define TDA829X_PROBE_TUNER 0