Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     MaxLinear MXL5005S VSB/QAM/DVBT tuner driver
0004 
0005     Copyright (C) 2008 MaxLinear
0006     Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
0007 
0008 
0009 */
0010 
0011 #ifndef __MXL5005S_H
0012 #define __MXL5005S_H
0013 
0014 #include <linux/i2c.h>
0015 #include <media/dvb_frontend.h>
0016 
0017 struct mxl5005s_config {
0018 
0019     /* 7 bit i2c address */
0020     u8 i2c_address;
0021 
0022 #define IF_FREQ_4570000HZ    4570000
0023 #define IF_FREQ_4571429HZ    4571429
0024 #define IF_FREQ_5380000HZ    5380000
0025 #define IF_FREQ_36000000HZ  36000000
0026 #define IF_FREQ_36125000HZ  36125000
0027 #define IF_FREQ_36166667HZ  36166667
0028 #define IF_FREQ_44000000HZ  44000000
0029     u32 if_freq;
0030 
0031 #define CRYSTAL_FREQ_4000000HZ    4000000
0032 #define CRYSTAL_FREQ_16000000HZ  16000000
0033 #define CRYSTAL_FREQ_25000000HZ  25000000
0034 #define CRYSTAL_FREQ_28800000HZ  28800000
0035     u32 xtal_freq;
0036 
0037 #define MXL_DUAL_AGC   0
0038 #define MXL_SINGLE_AGC 1
0039     u8 agc_mode;
0040 
0041 #define MXL_TF_DEFAULT  0
0042 #define MXL_TF_OFF  1
0043 #define MXL_TF_C    2
0044 #define MXL_TF_C_H  3
0045 #define MXL_TF_D    4
0046 #define MXL_TF_D_L  5
0047 #define MXL_TF_E    6
0048 #define MXL_TF_F    7
0049 #define MXL_TF_E_2  8
0050 #define MXL_TF_E_NA 9
0051 #define MXL_TF_G    10
0052     u8 tracking_filter;
0053 
0054 #define MXL_RSSI_DISABLE    0
0055 #define MXL_RSSI_ENABLE     1
0056     u8 rssi_enable;
0057 
0058 #define MXL_CAP_SEL_DISABLE 0
0059 #define MXL_CAP_SEL_ENABLE  1
0060     u8 cap_select;
0061 
0062 #define MXL_DIV_OUT_1   0
0063 #define MXL_DIV_OUT_4   1
0064     u8 div_out;
0065 
0066 #define MXL_CLOCK_OUT_DISABLE   0
0067 #define MXL_CLOCK_OUT_ENABLE    1
0068     u8 clock_out;
0069 
0070 #define MXL5005S_IF_OUTPUT_LOAD_200_OHM 200
0071 #define MXL5005S_IF_OUTPUT_LOAD_300_OHM 300
0072     u32 output_load;
0073 
0074 #define MXL5005S_TOP_5P5   55
0075 #define MXL5005S_TOP_7P2   72
0076 #define MXL5005S_TOP_9P2   92
0077 #define MXL5005S_TOP_11P0 110
0078 #define MXL5005S_TOP_12P9 129
0079 #define MXL5005S_TOP_14P7 147
0080 #define MXL5005S_TOP_16P8 168
0081 #define MXL5005S_TOP_19P4 194
0082 #define MXL5005S_TOP_21P2 212
0083 #define MXL5005S_TOP_23P2 232
0084 #define MXL5005S_TOP_25P2 252
0085 #define MXL5005S_TOP_27P1 271
0086 #define MXL5005S_TOP_29P2 292
0087 #define MXL5005S_TOP_31P7 317
0088 #define MXL5005S_TOP_34P9 349
0089     u32 top;
0090 
0091 #define MXL_ANALOG_MODE  0
0092 #define MXL_DIGITAL_MODE 1
0093     u8 mod_mode;
0094 
0095 #define MXL_ZERO_IF 0
0096 #define MXL_LOW_IF  1
0097     u8 if_mode;
0098 
0099     /* Some boards need to override the built-in logic for determining
0100        the gain when in QAM mode (the HVR-1600 is one such case) */
0101     u8 qam_gain;
0102 
0103     /* Stuff I don't know what to do with */
0104     u8 AgcMasterByte;
0105 };
0106 
0107 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MXL5005S)
0108 extern struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
0109                         struct i2c_adapter *i2c,
0110                         struct mxl5005s_config *config);
0111 #else
0112 static inline struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
0113                         struct i2c_adapter *i2c,
0114                         struct mxl5005s_config *config)
0115 {
0116     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0117     return NULL;
0118 }
0119 #endif /* CONFIG_DVB_TUNER_MXL5005S */
0120 
0121 #endif /* __MXL5005S_H */
0122