tda18271-fe.c (dca3a783400a18e2bf4503b1d4a85c4d0ca1a7e4) tda18271-fe.c (1bacb2df3bc999dcad21e9aab6bdb60d6dc7bc02)
1/*
2 tda18271-fe.c - driver for the Philips / NXP TDA18271 silicon tuner
3
4 Copyright (C) 2007, 2008 Michael Krufky <mkrufky@linuxtv.org>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or

--- 7 unchanged lines hidden (view full) ---

16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include <linux/delay.h>
22#include <linux/videodev2.h>
23#include "tda18271-priv.h"
1/*
2 tda18271-fe.c - driver for the Philips / NXP TDA18271 silicon tuner
3
4 Copyright (C) 2007, 2008 Michael Krufky <mkrufky@linuxtv.org>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or

--- 7 unchanged lines hidden (view full) ---

16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include <linux/delay.h>
22#include <linux/videodev2.h>
23#include "tda18271-priv.h"
24#include "tda8290.h"
24
25int tda18271_debug;
26module_param_named(debug, tda18271_debug, int, 0644);
27MODULE_PARM_DESC(debug, "set debug level "
28 "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))");
29
30static int tda18271_cal_on_startup = -1;
31module_param_named(cal, tda18271_cal_on_startup, int, 0644);

--- 830 unchanged lines hidden (view full) ---

862/* ------------------------------------------------------------------ */
863
864static int tda18271_agc(struct dvb_frontend *fe)
865{
866 struct tda18271_priv *priv = fe->tuner_priv;
867 int ret = 0;
868
869 switch (priv->config) {
25
26int tda18271_debug;
27module_param_named(debug, tda18271_debug, int, 0644);
28MODULE_PARM_DESC(debug, "set debug level "
29 "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))");
30
31static int tda18271_cal_on_startup = -1;
32module_param_named(cal, tda18271_cal_on_startup, int, 0644);

--- 830 unchanged lines hidden (view full) ---

863/* ------------------------------------------------------------------ */
864
865static int tda18271_agc(struct dvb_frontend *fe)
866{
867 struct tda18271_priv *priv = fe->tuner_priv;
868 int ret = 0;
869
870 switch (priv->config) {
870 case 0:
871 case TDA8290_LNA_OFF:
871 /* no external agc configuration required */
872 if (tda18271_debug & DBG_ADV)
873 tda_dbg("no agc configuration provided\n");
874 break;
872 /* no external agc configuration required */
873 if (tda18271_debug & DBG_ADV)
874 tda_dbg("no agc configuration provided\n");
875 break;
875 case 3:
876 case TDA8290_LNA_ON_BRIDGE:
876 /* switch with GPIO of saa713x */
877 tda_dbg("invoking callback\n");
878 if (fe->callback)
879 ret = fe->callback(priv->i2c_props.adap->algo_data,
880 DVB_FRONTEND_COMPONENT_TUNER,
881 TDA18271_CALLBACK_CMD_AGC_ENABLE,
882 priv->mode);
883 break;
877 /* switch with GPIO of saa713x */
878 tda_dbg("invoking callback\n");
879 if (fe->callback)
880 ret = fe->callback(priv->i2c_props.adap->algo_data,
881 DVB_FRONTEND_COMPONENT_TUNER,
882 TDA18271_CALLBACK_CMD_AGC_ENABLE,
883 priv->mode);
884 break;
884 case 1:
885 case 2:
885 case TDA8290_LNA_GP0_HIGH_ON:
886 case TDA8290_LNA_GP0_HIGH_OFF:
886 default:
887 /* n/a - currently not supported */
888 tda_err("unsupported configuration: %d\n", priv->config);
889 ret = -EINVAL;
890 break;
891 }
892 return ret;
893}

--- 471 unchanged lines hidden ---
887 default:
888 /* n/a - currently not supported */
889 tda_err("unsupported configuration: %d\n", priv->config);
890 ret = -EINVAL;
891 break;
892 }
893 return ret;
894}

--- 471 unchanged lines hidden ---