0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef STV0299_H
0034 #define STV0299_H
0035
0036 #include <linux/dvb/frontend.h>
0037 #include <media/dvb_frontend.h>
0038
0039 #define STV0299_LOCKOUTPUT_0 0
0040 #define STV0299_LOCKOUTPUT_1 1
0041 #define STV0299_LOCKOUTPUT_CF 2
0042 #define STV0299_LOCKOUTPUT_LK 3
0043
0044 #define STV0299_VOLT13_OP0 0
0045 #define STV0299_VOLT13_OP1 1
0046
0047 struct stv0299_config
0048 {
0049
0050 u8 demod_address;
0051
0052
0053
0054
0055
0056 const u8* inittab;
0057
0058
0059 u32 mclk;
0060
0061
0062 u8 invert:1;
0063
0064
0065 u8 skip_reinit:1;
0066
0067
0068 u8 lock_output:2;
0069
0070
0071 u8 volt13_op0_op1:1;
0072
0073
0074 u8 op0_off:1;
0075
0076
0077 int min_delay_ms;
0078
0079
0080 int (*set_symbol_rate)(struct dvb_frontend *fe, u32 srate, u32 ratio);
0081
0082
0083 int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
0084 };
0085
0086 #if IS_REACHABLE(CONFIG_DVB_STV0299)
0087 extern struct dvb_frontend *stv0299_attach(const struct stv0299_config *config,
0088 struct i2c_adapter *i2c);
0089 #else
0090 static inline struct dvb_frontend *stv0299_attach(const struct stv0299_config *config,
0091 struct i2c_adapter *i2c)
0092 {
0093 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0094 return NULL;
0095 }
0096 #endif
0097
0098 static inline int stv0299_writereg(struct dvb_frontend *fe, u8 reg, u8 val) {
0099 int r = 0;
0100 u8 buf[] = {reg, val};
0101 if (fe->ops.write)
0102 r = fe->ops.write(fe, buf, 2);
0103 return r;
0104 }
0105
0106 #endif