1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Linux-DVB Driver for DiBcom's DiB0090 base-band RF Tuner.
5 * Copyright (C) 2005-7 DiBcom (http://www.dibcom.fr/)
13 #define DEFAULT_DIB0090_I2C_ADDRESS 0x60
15 struct dib0090_io_config
{
23 u8 adc_clock_ratio
; /* valid is 8, 7 ,6 */
24 u16 pll_int_loop_filt
;
27 struct dib0090_wbd_slope
{
28 u16 max_freq
; /* for every frequency less than or equal to that field: this information is correct */
36 struct dib0090_low_if_offset_table
{
42 struct dib0090_config
{
43 struct dib0090_io_config io
;
44 int (*reset
) (struct dvb_frontend
*, int);
45 int (*sleep
) (struct dvb_frontend
*, int);
48 int freq_offset_khz_uhf
;
49 int freq_offset_khz_vhf
;
51 int (*get_adc_power
) (struct dvb_frontend
*);
53 u8 clkouttobamse
:1; /* activate or deactivate clock output */
57 /* add drives and other things if necessary */
67 const struct dib0090_low_if_offset_table
*low_if
;
69 u16 force_cband_input
;
70 struct dib0090_wbd_slope
*wbd
;
72 u8 force_crystal_mode
;
75 #if IS_REACHABLE(CONFIG_DVB_TUNER_DIB0090)
76 extern struct dvb_frontend
*dib0090_register(struct dvb_frontend
*fe
, struct i2c_adapter
*i2c
, const struct dib0090_config
*config
);
77 extern struct dvb_frontend
*dib0090_fw_register(struct dvb_frontend
*fe
, struct i2c_adapter
*i2c
, const struct dib0090_config
*config
);
78 extern void dib0090_dcc_freq(struct dvb_frontend
*fe
, u8 fast
);
79 extern void dib0090_pwm_gain_reset(struct dvb_frontend
*fe
);
80 extern u16
dib0090_get_wbd_target(struct dvb_frontend
*tuner
);
81 extern u16
dib0090_get_wbd_offset(struct dvb_frontend
*fe
);
82 extern int dib0090_gain_control(struct dvb_frontend
*fe
);
83 extern enum frontend_tune_state
dib0090_get_tune_state(struct dvb_frontend
*fe
);
84 extern int dib0090_set_tune_state(struct dvb_frontend
*fe
, enum frontend_tune_state tune_state
);
85 extern void dib0090_get_current_gain(struct dvb_frontend
*fe
, u16
* rf
, u16
* bb
, u16
* rf_gain_limit
, u16
* rflt
);
86 extern void dib0090_set_dc_servo(struct dvb_frontend
*fe
, u8 DC_servo_cutoff
);
87 extern int dib0090_set_switch(struct dvb_frontend
*fe
, u8 sw1
, u8 sw2
, u8 sw3
);
88 extern int dib0090_set_vga(struct dvb_frontend
*fe
, u8 onoff
);
89 extern int dib0090_update_rframp_7090(struct dvb_frontend
*fe
,
91 extern int dib0090_update_tuning_table_7090(struct dvb_frontend
*fe
,
94 static inline struct dvb_frontend
*dib0090_register(struct dvb_frontend
*fe
, struct i2c_adapter
*i2c
, const struct dib0090_config
*config
)
96 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
100 static inline struct dvb_frontend
*dib0090_fw_register(struct dvb_frontend
*fe
, struct i2c_adapter
*i2c
, struct dib0090_config
*config
)
102 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
106 static inline void dib0090_dcc_freq(struct dvb_frontend
*fe
, u8 fast
)
108 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
111 static inline void dib0090_pwm_gain_reset(struct dvb_frontend
*fe
)
113 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
116 static inline u16
dib0090_get_wbd_target(struct dvb_frontend
*tuner
)
118 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
122 static inline u16
dib0090_get_wbd_offset(struct dvb_frontend
*fe
)
124 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
128 static inline int dib0090_gain_control(struct dvb_frontend
*fe
)
130 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
134 static inline enum frontend_tune_state
dib0090_get_tune_state(struct dvb_frontend
*fe
)
136 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
140 static inline int dib0090_set_tune_state(struct dvb_frontend
*fe
, enum frontend_tune_state tune_state
)
142 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
146 static inline void dib0090_get_current_gain(struct dvb_frontend
*fe
, u16
* rf
, u16
* bb
, u16
* rf_gain_limit
, u16
* rflt
)
148 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
151 static inline void dib0090_set_dc_servo(struct dvb_frontend
*fe
, u8 DC_servo_cutoff
)
153 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
156 static inline int dib0090_set_switch(struct dvb_frontend
*fe
,
157 u8 sw1
, u8 sw2
, u8 sw3
)
159 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
163 static inline int dib0090_set_vga(struct dvb_frontend
*fe
, u8 onoff
)
165 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
169 static inline int dib0090_update_rframp_7090(struct dvb_frontend
*fe
,
172 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
176 static inline int dib0090_update_tuning_table_7090(struct dvb_frontend
*fe
,
179 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);