19a0bf528SMauro Carvalho Chehab #ifndef _DRXK_H_ 29a0bf528SMauro Carvalho Chehab #define _DRXK_H_ 39a0bf528SMauro Carvalho Chehab 4782d8b74SMauro Carvalho Chehab #include <linux/kconfig.h> 59a0bf528SMauro Carvalho Chehab #include <linux/types.h> 69a0bf528SMauro Carvalho Chehab #include <linux/i2c.h> 79a0bf528SMauro Carvalho Chehab 89a0bf528SMauro Carvalho Chehab /** 99a0bf528SMauro Carvalho Chehab * struct drxk_config - Configure the initial parameters for DRX-K 109a0bf528SMauro Carvalho Chehab * 11cd7a67a4SMauro Carvalho Chehab * @adr: I2C address of the DRX-K 129a0bf528SMauro Carvalho Chehab * @parallel_ts: True means that the device uses parallel TS, 139a0bf528SMauro Carvalho Chehab * Serial otherwise. 149a0bf528SMauro Carvalho Chehab * @dynamic_clk: True means that the clock will be dynamically 159a0bf528SMauro Carvalho Chehab * adjusted. Static clock otherwise. 169a0bf528SMauro Carvalho Chehab * @enable_merr_cfg: Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG. 179a0bf528SMauro Carvalho Chehab * @single_master: Device is on the single master mode 189a0bf528SMauro Carvalho Chehab * @no_i2c_bridge: Don't switch the I2C bridge to talk with tuner 199a0bf528SMauro Carvalho Chehab * @antenna_gpio: GPIO bit used to control the antenna 209a0bf528SMauro Carvalho Chehab * @antenna_dvbt: GPIO bit for changing antenna to DVB-C. A value of 1 219a0bf528SMauro Carvalho Chehab * means that 1=DVBC, 0 = DVBT. Zero means the opposite. 229a0bf528SMauro Carvalho Chehab * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength. 239a0bf528SMauro Carvalho Chehab * @microcode_name: Name of the firmware file with the microcode 249a0bf528SMauro Carvalho Chehab * @qam_demod_parameter_count: The number of parameters used for the command 259a0bf528SMauro Carvalho Chehab * to set the demodulator parameters. All 269a0bf528SMauro Carvalho Chehab * firmwares are using the 2-parameter commmand. 279a0bf528SMauro Carvalho Chehab * An exception is the "drxk_a3.mc" firmware, 289a0bf528SMauro Carvalho Chehab * which uses the 4-parameter command. 299a0bf528SMauro Carvalho Chehab * A value of 0 (default) or lower indicates that 309a0bf528SMauro Carvalho Chehab * the correct number of parameters will be 319a0bf528SMauro Carvalho Chehab * automatically detected. 328e30783bSMauro Carvalho Chehab * @load_firmware_sync: Force the firmware load to be synchronous. 339a0bf528SMauro Carvalho Chehab * 349a0bf528SMauro Carvalho Chehab * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is 359a0bf528SMauro Carvalho Chehab * UIO-3. 369a0bf528SMauro Carvalho Chehab */ 379a0bf528SMauro Carvalho Chehab struct drxk_config { 389a0bf528SMauro Carvalho Chehab u8 adr; 399a0bf528SMauro Carvalho Chehab bool single_master; 409a0bf528SMauro Carvalho Chehab bool no_i2c_bridge; 419a0bf528SMauro Carvalho Chehab bool parallel_ts; 429a0bf528SMauro Carvalho Chehab bool dynamic_clk; 439a0bf528SMauro Carvalho Chehab bool enable_merr_cfg; 448e30783bSMauro Carvalho Chehab bool load_firmware_sync; 459a0bf528SMauro Carvalho Chehab 469a0bf528SMauro Carvalho Chehab bool antenna_dvbt; 479a0bf528SMauro Carvalho Chehab u16 antenna_gpio; 489a0bf528SMauro Carvalho Chehab 499a0bf528SMauro Carvalho Chehab u8 mpeg_out_clk_strength; 509a0bf528SMauro Carvalho Chehab int chunk_size; 519a0bf528SMauro Carvalho Chehab 529a0bf528SMauro Carvalho Chehab const char *microcode_name; 539a0bf528SMauro Carvalho Chehab int qam_demod_parameter_count; 549a0bf528SMauro Carvalho Chehab }; 559a0bf528SMauro Carvalho Chehab 56782d8b74SMauro Carvalho Chehab #if IS_ENABLED(CONFIG_DVB_DRXK) 579a0bf528SMauro Carvalho Chehab extern struct dvb_frontend *drxk_attach(const struct drxk_config *config, 589a0bf528SMauro Carvalho Chehab struct i2c_adapter *i2c); 599a0bf528SMauro Carvalho Chehab #else 609a0bf528SMauro Carvalho Chehab static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config, 619a0bf528SMauro Carvalho Chehab struct i2c_adapter *i2c) 629a0bf528SMauro Carvalho Chehab { 639a0bf528SMauro Carvalho Chehab printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); 649a0bf528SMauro Carvalho Chehab return NULL; 659a0bf528SMauro Carvalho Chehab } 669a0bf528SMauro Carvalho Chehab #endif 679a0bf528SMauro Carvalho Chehab 689a0bf528SMauro Carvalho Chehab #endif 69