Commit | Line | Data |
---|---|---|
e415c689 MA |
1 | /* |
2 | STV0900/0903 Multistandard Broadcast Frontend driver | |
3 | Copyright (C) Manu Abraham <abraham.manu@gmail.com> | |
4 | ||
5 | Copyright (C) ST Microelectronics | |
6 | ||
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. | |
11 | ||
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. | |
16 | ||
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. | |
20 | */ | |
21 | ||
22 | #ifndef __STV090x_H | |
23 | #define __STV090x_H | |
24 | ||
25 | enum stv090x_demodulator { | |
26 | STV090x_DEMODULATOR_0 = 1, | |
27 | STV090x_DEMODULATOR_1 | |
28 | }; | |
29 | ||
30 | enum stv090x_device { | |
31 | STV0903 = 0, | |
32 | STV0900, | |
33 | }; | |
34 | ||
35 | enum stv090x_mode { | |
36 | STV090x_DUAL = 0, | |
37 | STV090x_SINGLE | |
38 | }; | |
39 | ||
40 | enum stv090x_tsmode { | |
41 | STV090x_TSMODE_SERIAL_PUNCTURED = 1, | |
42 | STV090x_TSMODE_SERIAL_CONTINUOUS, | |
43 | STV090x_TSMODE_PARALLEL_PUNCTURED, | |
44 | STV090x_TSMODE_DVBCI | |
45 | }; | |
46 | ||
47 | enum stv090x_clkmode { | |
48 | STV090x_CLK_INT = 0, /* Clk i/p = CLKI */ | |
49 | STV090x_CLK_EXT = 2 /* Clk i/p = XTALI */ | |
50 | }; | |
51 | ||
52 | struct stv090x_config { | |
53 | enum stv090x_device device; | |
54 | enum stv090x_mode demod_mode; | |
55 | enum stv090x_clkmode clk_mode; | |
56 | ||
57 | u32 xtal; /* default: 8000000 */ | |
58 | u8 address; /* default: 0x68 */ | |
59 | ||
60 | u32 ref_clk; /* default: 16000000 FIXME to tuner config */ | |
61 | ||
62 | u8 ts1_mode; | |
63 | u8 ts2_mode; | |
64 | ||
65 | int (*tuner_init) (struct dvb_frontend *fe); | |
66 | int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode); | |
67 | int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency); | |
68 | int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency); | |
69 | int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth); | |
70 | int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth); | |
71 | int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain); | |
72 | int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain); | |
73 | int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk); | |
74 | int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status); | |
75 | }; | |
76 | ||
77 | #if defined(CONFIG_DVB_STV090x) || (defined(CONFIG_DVB_STV090x_MODULE) && defined(MODULE)) | |
78 | ||
79 | extern struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, | |
80 | struct i2c_adapter *i2c, | |
81 | enum stv090x_demodulator demod); | |
82 | #else | |
83 | ||
84 | static inline struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, | |
85 | struct i2c_adapter *i2c, | |
86 | enum stv090x_demodulator demod) | |
87 | { | |
88 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | |
89 | return NULL; | |
90 | } | |
91 | #endif /* CONFIG_DVB_STV090x */ | |
92 | ||
93 | #endif /* __STV090x_H */ |