Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef DIB7000M_H
0003 #define DIB7000M_H
0004 
0005 #include "dibx000_common.h"
0006 
0007 struct dib7000m_config {
0008     u8 dvbt_mode;
0009     u8 output_mpeg2_in_188_bytes;
0010     u8 hostbus_diversity;
0011     u8 tuner_is_baseband;
0012     u8 mobile_mode;
0013     int (*update_lna) (struct dvb_frontend *, u16 agc_global);
0014 
0015     u8 agc_config_count;
0016     struct dibx000_agc_config *agc;
0017 
0018     struct dibx000_bandwidth_config *bw;
0019 
0020 #define DIB7000M_GPIO_DEFAULT_DIRECTIONS 0xffff
0021     u16 gpio_dir;
0022 #define DIB7000M_GPIO_DEFAULT_VALUES     0x0000
0023     u16 gpio_val;
0024 #define DIB7000M_GPIO_PWM_POS0(v)        ((v & 0xf) << 12)
0025 #define DIB7000M_GPIO_PWM_POS1(v)        ((v & 0xf) << 8 )
0026 #define DIB7000M_GPIO_PWM_POS2(v)        ((v & 0xf) << 4 )
0027 #define DIB7000M_GPIO_PWM_POS3(v)         (v & 0xf)
0028 #define DIB7000M_GPIO_DEFAULT_PWM_POS    0xffff
0029     u16 gpio_pwm_pos;
0030 
0031     u16 pwm_freq_div;
0032 
0033     u8 quartz_direct;
0034 
0035     u8 input_clk_is_div_2;
0036 
0037     int (*agc_control) (struct dvb_frontend *, u8 before);
0038 };
0039 
0040 #define DEFAULT_DIB7000M_I2C_ADDRESS 18
0041 
0042 #if IS_REACHABLE(CONFIG_DVB_DIB7000M)
0043 extern struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap,
0044                         u8 i2c_addr,
0045                         struct dib7000m_config *cfg);
0046 extern struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *,
0047                            enum dibx000_i2c_interface,
0048                            int);
0049 extern int dib7000m_pid_filter(struct dvb_frontend *, u8 id, u16 pid, u8 onoff);
0050 extern int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff);
0051 #else
0052 static inline
0053 struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap,
0054                      u8 i2c_addr, struct dib7000m_config *cfg)
0055 {
0056     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0057     return NULL;
0058 }
0059 
0060 static inline
0061 struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *demod,
0062                         enum dibx000_i2c_interface intf,
0063                         int gating)
0064 {
0065     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0066     return NULL;
0067 }
0068 static inline int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id,
0069                         u16 pid, u8 onoff)
0070 {
0071     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0072     return -ENODEV;
0073 }
0074 
0075 static inline int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe,
0076                         uint8_t onoff)
0077 {
0078     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0079     return -ENODEV;
0080 }
0081 #endif
0082 
0083 /* TODO
0084 extern INT dib7000m_set_gpio(struct dibDemod *demod, UCHAR num, UCHAR dir, UCHAR val);
0085 extern INT dib7000m_enable_vbg_voltage(struct dibDemod *demod);
0086 extern void dib7000m_set_hostbus_diversity(struct dibDemod *demod, UCHAR onoff);
0087 extern USHORT dib7000m_get_current_agc_global(struct dibDemod *demod);
0088 */
0089 
0090 #endif