Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dib0090.h
Go to the documentation of this file.
1 /*
2  * Linux-DVB Driver for DiBcom's DiB0090 base-band RF Tuner.
3  *
4  * Copyright (C) 2005-7 DiBcom (http://www.dibcom.fr/)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation, version 2.
9  */
10 #ifndef DIB0090_H
11 #define DIB0090_H
12 
13 struct dvb_frontend;
14 struct i2c_adapter;
15 
16 #define DEFAULT_DIB0090_I2C_ADDRESS 0x60
17 
20 
25 
26  u8 adc_clock_ratio; /* valid is 8, 7 ,6 */
28 };
29 
31  u16 max_freq; /* for every frequency less than or equal to that field: this information is correct */
37 };
38 
40  int std;
43 };
44 
47  int (*reset) (struct dvb_frontend *, int);
48  int (*sleep) (struct dvb_frontend *, int);
49 
50  /* offset in kHz */
53 
55 
56  u8 clkouttobamse:1; /* activate or deactivate clock output */
58 
60  /* add drives and other things if necessary */
65 
68 
76 };
77 
78 #if defined(CONFIG_DVB_TUNER_DIB0090) || (defined(CONFIG_DVB_TUNER_DIB0090_MODULE) && defined(MODULE))
79 extern struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config);
80 extern struct dvb_frontend *dib0090_fw_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config);
81 extern void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast);
82 extern void dib0090_pwm_gain_reset(struct dvb_frontend *fe);
84 extern u16 dib0090_get_wbd_offset(struct dvb_frontend *fe);
85 extern int dib0090_gain_control(struct dvb_frontend *fe);
87 extern int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state);
88 extern void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt);
89 extern void dib0090_set_dc_servo(struct dvb_frontend *fe, u8 DC_servo_cutoff);
90 extern int dib0090_set_switch(struct dvb_frontend *fe, u8 sw1, u8 sw2, u8 sw3);
91 extern int dib0090_set_vga(struct dvb_frontend *fe, u8 onoff);
92 extern int dib0090_update_rframp_7090(struct dvb_frontend *fe,
93  u8 cfg_sensitivity);
95  u8 cfg_sensitivity);
96 #else
97 static inline struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config)
98 {
99  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
100  return NULL;
101 }
102 
103 static inline struct dvb_frontend *dib0090_fw_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0090_config *config)
104 {
105  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
106  return NULL;
107 }
108 
109 static inline void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast)
110 {
111  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
112 }
113 
114 static inline void dib0090_pwm_gain_reset(struct dvb_frontend *fe)
115 {
116  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
117 }
118 
119 static inline u16 dib0090_get_wbd_target(struct dvb_frontend *tuner)
120 {
121  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
122  return 0;
123 }
124 
125 static inline u16 dib0090_get_wbd_offset(struct dvb_frontend *fe)
126 {
127  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
128  return 0;
129 }
130 
131 static inline int dib0090_gain_control(struct dvb_frontend *fe)
132 {
133  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
134  return -ENODEV;
135 }
136 
137 static inline enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe)
138 {
139  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
140  return CT_DONE;
141 }
142 
143 static inline int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state)
144 {
145  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
146  return -ENODEV;
147 }
148 
149 static inline void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt)
150 {
151  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
152 }
153 
154 static inline void dib0090_set_dc_servo(struct dvb_frontend *fe, u8 DC_servo_cutoff)
155 {
156  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
157 }
158 
159 static inline int dib0090_set_switch(struct dvb_frontend *fe,
160  u8 sw1, u8 sw2, u8 sw3)
161 {
162  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
163  return -ENODEV;
164 }
165 
166 static inline int dib0090_set_vga(struct dvb_frontend *fe, u8 onoff)
167 {
168  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
169  return -ENODEV;
170 }
171 
172 static inline int dib0090_update_rframp_7090(struct dvb_frontend *fe,
173  u8 cfg_sensitivity)
174 {
175  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
176  return -ENODEV;
177 }
178 
179 static inline int dib0090_update_tuning_table_7090(struct dvb_frontend *fe,
180  u8 cfg_sensitivity)
181 {
182  printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
183  return -ENODEV;
184 }
185 #endif
186 
187 #endif