Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     Montage Technology TS2020 - Silicon Tuner driver
0004     Copyright (C) 2009-2012 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
0005 
0006     Copyright (C) 2009-2012 TurboSight.com
0007 
0008  */
0009 
0010 #ifndef TS2020_H
0011 #define TS2020_H
0012 
0013 #include <linux/dvb/frontend.h>
0014 
0015 struct ts2020_config {
0016     u8 tuner_address;
0017     u32 frequency_div;
0018 
0019     /*
0020      * RF loop-through
0021      */
0022     bool loop_through:1;
0023 
0024     /*
0025      * clock output
0026      */
0027 #define TS2020_CLK_OUT_DISABLED        0
0028 #define TS2020_CLK_OUT_ENABLED         1
0029 #define TS2020_CLK_OUT_ENABLED_XTALOUT 2
0030     u8 clk_out:2;
0031 
0032     /*
0033      * clock output divider
0034      * 1 - 31
0035      */
0036     u8 clk_out_div:5;
0037 
0038     /* Set to true to suppress stat polling */
0039     bool dont_poll:1;
0040 
0041     /*
0042      * pointer to DVB frontend
0043      */
0044     struct dvb_frontend *fe;
0045 
0046     /*
0047      * driver private, do not set value
0048      */
0049     u8 attach_in_use:1;
0050 
0051     /* Operation to be called by the ts2020 driver to get the value of the
0052      * AGC PWM tuner input as theoretically output by the demodulator.
0053      */
0054     int (*get_agc_pwm)(struct dvb_frontend *fe, u8 *_agc_pwm);
0055 };
0056 
0057 /* Do not add new ts2020_attach() users! Use I2C bindings instead. */
0058 #if IS_REACHABLE(CONFIG_DVB_TS2020)
0059 extern struct dvb_frontend *ts2020_attach(
0060     struct dvb_frontend *fe,
0061     const struct ts2020_config *config,
0062     struct i2c_adapter *i2c);
0063 #else
0064 static inline struct dvb_frontend *ts2020_attach(
0065     struct dvb_frontend *fe,
0066     const struct ts2020_config *config,
0067     struct i2c_adapter *i2c)
0068 {
0069     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0070     return NULL;
0071 }
0072 #endif
0073 
0074 #endif /* TS2020_H */