0001
0002 #ifndef DIB9000_H
0003 #define DIB9000_H
0004
0005 #include "dibx000_common.h"
0006
0007 struct dib9000_config {
0008 u8 dvbt_mode;
0009 u8 output_mpeg2_in_188_bytes;
0010 u8 hostbus_diversity;
0011 struct dibx000_bandwidth_config *bw;
0012
0013 u16 if_drives;
0014
0015 u32 timing_frequency;
0016 u32 xtal_clock_khz;
0017 u32 vcxo_timer;
0018 u32 demod_clock_khz;
0019
0020 const u8 *microcode_B_fe_buffer;
0021 u32 microcode_B_fe_size;
0022
0023 struct dibGPIOFunction gpio_function[2];
0024 struct dibSubbandSelection subband;
0025
0026 u8 output_mode;
0027 };
0028
0029 #define DEFAULT_DIB9000_I2C_ADDRESS 18
0030
0031 #if IS_REACHABLE(CONFIG_DVB_DIB9000)
0032 extern struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, const struct dib9000_config *cfg);
0033 extern int dib9000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, u8 default_addr, u8 first_addr);
0034 extern struct i2c_adapter *dib9000_get_tuner_interface(struct dvb_frontend *fe);
0035 extern struct i2c_adapter *dib9000_get_i2c_master(struct dvb_frontend *fe, enum dibx000_i2c_interface intf, int gating);
0036 extern int dib9000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val);
0037 extern int dib9000_fw_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff);
0038 extern int dib9000_fw_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff);
0039 extern int dib9000_firmware_post_pll_init(struct dvb_frontend *fe);
0040 extern int dib9000_set_slave_frontend(struct dvb_frontend *fe, struct dvb_frontend *fe_slave);
0041 extern struct dvb_frontend *dib9000_get_slave_frontend(struct dvb_frontend *fe, int slave_index);
0042 extern struct i2c_adapter *dib9000_get_component_bus_interface(struct dvb_frontend *fe);
0043 extern int dib9000_set_i2c_adapter(struct dvb_frontend *fe, struct i2c_adapter *i2c);
0044 extern int dib9000_fw_set_component_bus_speed(struct dvb_frontend *fe, u16 speed);
0045 #else
0046 static inline struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib9000_config *cfg)
0047 {
0048 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0049 return NULL;
0050 }
0051
0052 static inline struct i2c_adapter *dib9000_get_i2c_master(struct dvb_frontend *fe, enum dibx000_i2c_interface intf, int gating)
0053 {
0054 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0055 return NULL;
0056 }
0057
0058 static inline int dib9000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, u8 default_addr, u8 first_addr)
0059 {
0060 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0061 return -ENODEV;
0062 }
0063
0064 static inline struct i2c_adapter *dib9000_get_tuner_interface(struct dvb_frontend *fe)
0065 {
0066 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0067 return NULL;
0068 }
0069
0070 static inline int dib9000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val)
0071 {
0072 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0073 return -ENODEV;
0074 }
0075
0076 static inline int dib9000_fw_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
0077 {
0078 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0079 return -ENODEV;
0080 }
0081
0082 static inline int dib9000_fw_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
0083 {
0084 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0085 return -ENODEV;
0086 }
0087
0088 static inline int dib9000_firmware_post_pll_init(struct dvb_frontend *fe)
0089 {
0090 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0091 return -ENODEV;
0092 }
0093
0094 static inline int dib9000_set_slave_frontend(struct dvb_frontend *fe, struct dvb_frontend *fe_slave)
0095 {
0096 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0097 return -ENODEV;
0098 }
0099
0100 static inline struct dvb_frontend *dib9000_get_slave_frontend(struct dvb_frontend *fe, int slave_index)
0101 {
0102 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0103 return NULL;
0104 }
0105
0106 static inline struct i2c_adapter *dib9000_get_component_bus_interface(struct dvb_frontend *fe)
0107 {
0108 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0109 return NULL;
0110 }
0111
0112 static inline int dib9000_set_i2c_adapter(struct dvb_frontend *fe, struct i2c_adapter *i2c)
0113 {
0114 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0115 return -ENODEV;
0116 }
0117
0118 static inline int dib9000_fw_set_component_bus_speed(struct dvb_frontend *fe, u16 speed)
0119 {
0120 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0121 return -ENODEV;
0122 }
0123 #endif
0124
0125 #endif