Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
stv090x.h
Go to the documentation of this file.
1 /*
2  STV0900/0903 Multistandard Broadcast Frontend driver
3  Copyright (C) Manu Abraham <[email protected]>
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 
28 };
29 
31  STV0903 = 0,
33 };
34 
38 };
39 
45 };
46 
48  STV090x_CLK_INT = 0, /* Clk i/p = CLKI */
49  STV090x_CLK_EXT = 2 /* Clk i/p = XTALI */
50 };
51 
61 };
62 
66 };
67 
72 
73  u32 xtal; /* default: 8000000 */
74  u8 address; /* default: 0x68 */
75 
80 
81  u8 ts1_tei : 1;
82  u8 ts2_tei : 1;
83 
85 
86  u8 tuner_bbgain; /* default: 10db */
87  enum stv090x_adc_range adc1_range; /* default: 2Vpp */
88  enum stv090x_adc_range adc2_range; /* default: 2Vpp */
89 
91 
92  int (*tuner_init) (struct dvb_frontend *fe);
93  int (*tuner_sleep) (struct dvb_frontend *fe);
101  int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
103  void (*tuner_i2c_lock) (struct dvb_frontend *fe, int lock);
104 };
105 
106 #if defined(CONFIG_DVB_STV090x) || (defined(CONFIG_DVB_STV090x_MODULE) && defined(MODULE))
107 
108 extern struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
109  struct i2c_adapter *i2c,
110  enum stv090x_demodulator demod);
111 
112 /* dir = 0 -> output, dir = 1 -> input/open-drain */
113 extern int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio,
114  u8 dir, u8 value, u8 xor_value);
115 
116 #else
117 
118 static inline struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
119  struct i2c_adapter *i2c,
120  enum stv090x_demodulator demod)
121 {
122  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
123  return NULL;
124 }
125 
126 static inline int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio,
127  u8 opd, u8 value, u8 xor_value)
128 {
129  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
130  return -ENODEV;
131 }
132 #endif /* CONFIG_DVB_STV090x */
133 
134 #endif /* __STV090x_H */