Merge branch 'akpm' (Andrew's patch-bomb)
[firefly-linux-kernel-4.4.55.git] / drivers / media / dvb / frontends / drxk.h
1 #ifndef _DRXK_H_
2 #define _DRXK_H_
3
4 #include <linux/types.h>
5 #include <linux/i2c.h>
6
7 /**
8  * struct drxk_config - Configure the initial parameters for DRX-K
9  *
10  * @adr:                I2C Address of the DRX-K
11  * @parallel_ts:        True means that the device uses parallel TS,
12  *                      Serial otherwise.
13  * @dynamic_clk:        True means that the clock will be dynamically
14  *                      adjusted. Static clock otherwise.
15  * @enable_merr_cfg:    Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG.
16  * @single_master:      Device is on the single master mode
17  * @no_i2c_bridge:      Don't switch the I2C bridge to talk with tuner
18  * @antenna_gpio:       GPIO bit used to control the antenna
19  * @antenna_dvbt:       GPIO bit for changing antenna to DVB-C. A value of 1
20  *                      means that 1=DVBC, 0 = DVBT. Zero means the opposite.
21  * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength.
22  * @microcode_name:     Name of the firmware file with the microcode
23  *
24  * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is
25  * UIO-3.
26  */
27 struct drxk_config {
28         u8      adr;
29         bool    single_master;
30         bool    no_i2c_bridge;
31         bool    parallel_ts;
32         bool    dynamic_clk;
33         bool    enable_merr_cfg;
34
35         bool    antenna_dvbt;
36         u16     antenna_gpio;
37
38         u8      mpeg_out_clk_strength;
39         int     chunk_size;
40
41         const char *microcode_name;
42 };
43
44 #if defined(CONFIG_DVB_DRXK) || (defined(CONFIG_DVB_DRXK_MODULE) \
45         && defined(MODULE))
46 extern struct dvb_frontend *drxk_attach(const struct drxk_config *config,
47                                         struct i2c_adapter *i2c);
48 #else
49 static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config,
50                                         struct i2c_adapter *i2c)
51 {
52         printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
53         return NULL;
54 }
55 #endif
56
57 #endif