Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _DRXK_H_
0003 #define _DRXK_H_
0004 
0005 #include <linux/types.h>
0006 #include <linux/i2c.h>
0007 
0008 /**
0009  * struct drxk_config - Configure the initial parameters for DRX-K
0010  *
0011  * @adr:        I2C address of the DRX-K
0012  * @parallel_ts:    True means that the device uses parallel TS,
0013  *          Serial otherwise.
0014  * @dynamic_clk:    True means that the clock will be dynamically
0015  *          adjusted. Static clock otherwise.
0016  * @enable_merr_cfg:    Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG.
0017  * @single_master:  Device is on the single master mode
0018  * @no_i2c_bridge:  Don't switch the I2C bridge to talk with tuner
0019  * @antenna_gpio:   GPIO bit used to control the antenna
0020  * @antenna_dvbt:   GPIO bit for changing antenna to DVB-C. A value of 1
0021  *          means that 1=DVBC, 0 = DVBT. Zero means the opposite.
0022  * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength.
0023  * @chunk_size:     maximum size for I2C messages
0024  * @microcode_name: Name of the firmware file with the microcode
0025  * @qam_demod_parameter_count:  The number of parameters used for the command
0026  *              to set the demodulator parameters. All
0027  *              firmwares are using the 2-parameter command.
0028  *              An exception is the ``drxk_a3.mc`` firmware,
0029  *              which uses the 4-parameter command.
0030  *              A value of 0 (default) or lower indicates that
0031  *              the correct number of parameters will be
0032  *              automatically detected.
0033  *
0034  * On the ``*_gpio`` vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is
0035  * UIO-3.
0036  */
0037 struct drxk_config {
0038     u8  adr;
0039     bool    single_master;
0040     bool    no_i2c_bridge;
0041     bool    parallel_ts;
0042     bool    dynamic_clk;
0043     bool    enable_merr_cfg;
0044 
0045     bool    antenna_dvbt;
0046     u16 antenna_gpio;
0047 
0048     u8  mpeg_out_clk_strength;
0049     int chunk_size;
0050 
0051     const char  *microcode_name;
0052     int      qam_demod_parameter_count;
0053 };
0054 
0055 #if IS_REACHABLE(CONFIG_DVB_DRXK)
0056 /**
0057  * drxk_attach - Attach a drxk demod
0058  *
0059  * @config: pointer to &struct drxk_config with demod configuration.
0060  * @i2c: i2c adapter to use.
0061  *
0062  * return: FE pointer on success, NULL on failure.
0063  */
0064 extern struct dvb_frontend *drxk_attach(const struct drxk_config *config,
0065                     struct i2c_adapter *i2c);
0066 #else
0067 static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config,
0068                     struct i2c_adapter *i2c)
0069 {
0070     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0071     return NULL;
0072 }
0073 #endif
0074 
0075 #endif