V4L/DVB: drivers/media/dvb/frontends/stv090x.c: fix use-uninitialised
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / media / dvb / frontends / stv090x.h
blob30f01a6902ac118b4b0ec0d7fb83b0d5a411dd73
1 /*
2 STV0900/0903 Multistandard Broadcast Frontend driver
3 Copyright (C) Manu Abraham <abraham.manu@gmail.com>
5 Copyright (C) ST Microelectronics
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __STV090x_H
23 #define __STV090x_H
25 enum stv090x_demodulator {
26 STV090x_DEMODULATOR_0 = 1,
27 STV090x_DEMODULATOR_1
30 enum stv090x_device {
31 STV0903 = 0,
32 STV0900,
35 enum stv090x_mode {
36 STV090x_DUAL = 0,
37 STV090x_SINGLE
40 enum stv090x_tsmode {
41 STV090x_TSMODE_SERIAL_PUNCTURED = 1,
42 STV090x_TSMODE_SERIAL_CONTINUOUS,
43 STV090x_TSMODE_PARALLEL_PUNCTURED,
44 STV090x_TSMODE_DVBCI
47 enum stv090x_clkmode {
48 STV090x_CLK_INT = 0, /* Clk i/p = CLKI */
49 STV090x_CLK_EXT = 2 /* Clk i/p = XTALI */
52 enum stv090x_i2crpt {
53 STV090x_RPTLEVEL_256 = 0,
54 STV090x_RPTLEVEL_128 = 1,
55 STV090x_RPTLEVEL_64 = 2,
56 STV090x_RPTLEVEL_32 = 3,
57 STV090x_RPTLEVEL_16 = 4,
58 STV090x_RPTLEVEL_8 = 5,
59 STV090x_RPTLEVEL_4 = 6,
60 STV090x_RPTLEVEL_2 = 7,
63 enum stv090x_adc_range {
64 STV090x_ADC_2Vpp = 0,
65 STV090x_ADC_1Vpp = 1
68 struct stv090x_config {
69 enum stv090x_device device;
70 enum stv090x_mode demod_mode;
71 enum stv090x_clkmode clk_mode;
73 u32 xtal; /* default: 8000000 */
74 u8 address; /* default: 0x68 */
76 u8 ts1_mode;
77 u8 ts2_mode;
78 u32 ts1_clk;
79 u32 ts2_clk;
81 enum stv090x_i2crpt repeater_level;
83 u8 tuner_bbgain; /* default: 10db */
84 enum stv090x_adc_range adc1_range; /* default: 2Vpp */
85 enum stv090x_adc_range adc2_range; /* default: 2Vpp */
87 bool diseqc_envelope_mode;
89 int (*tuner_init) (struct dvb_frontend *fe);
90 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
91 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
92 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
93 int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
94 int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
95 int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
96 int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
97 int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
98 int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
101 #if defined(CONFIG_DVB_STV090x) || (defined(CONFIG_DVB_STV090x_MODULE) && defined(MODULE))
103 extern struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
104 struct i2c_adapter *i2c,
105 enum stv090x_demodulator demod);
106 #else
108 static inline struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
109 struct i2c_adapter *i2c,
110 enum stv090x_demodulator demod)
112 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
113 return NULL;
115 #endif /* CONFIG_DVB_STV090x */
117 #endif /* __STV090x_H */