19a0bf528SMauro Carvalho Chehab #ifndef _DRXK_H_ 29a0bf528SMauro Carvalho Chehab #define _DRXK_H_ 39a0bf528SMauro Carvalho Chehab 49a0bf528SMauro Carvalho Chehab #include <linux/types.h> 59a0bf528SMauro Carvalho Chehab #include <linux/i2c.h> 69a0bf528SMauro Carvalho Chehab 79a0bf528SMauro Carvalho Chehab /** 89a0bf528SMauro Carvalho Chehab * struct drxk_config - Configure the initial parameters for DRX-K 99a0bf528SMauro Carvalho Chehab * 109a0bf528SMauro Carvalho Chehab * @adr: I2C Address of the DRX-K 119a0bf528SMauro Carvalho Chehab * @parallel_ts: True means that the device uses parallel TS, 129a0bf528SMauro Carvalho Chehab * Serial otherwise. 139a0bf528SMauro Carvalho Chehab * @dynamic_clk: True means that the clock will be dynamically 149a0bf528SMauro Carvalho Chehab * adjusted. Static clock otherwise. 159a0bf528SMauro Carvalho Chehab * @enable_merr_cfg: Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG. 169a0bf528SMauro Carvalho Chehab * @single_master: Device is on the single master mode 179a0bf528SMauro Carvalho Chehab * @no_i2c_bridge: Don't switch the I2C bridge to talk with tuner 189a0bf528SMauro Carvalho Chehab * @antenna_gpio: GPIO bit used to control the antenna 199a0bf528SMauro Carvalho Chehab * @antenna_dvbt: GPIO bit for changing antenna to DVB-C. A value of 1 209a0bf528SMauro Carvalho Chehab * means that 1=DVBC, 0 = DVBT. Zero means the opposite. 219a0bf528SMauro Carvalho Chehab * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength. 229a0bf528SMauro Carvalho Chehab * @microcode_name: Name of the firmware file with the microcode 239a0bf528SMauro Carvalho Chehab * @qam_demod_parameter_count: The number of parameters used for the command 249a0bf528SMauro Carvalho Chehab * to set the demodulator parameters. All 259a0bf528SMauro Carvalho Chehab * firmwares are using the 2-parameter commmand. 269a0bf528SMauro Carvalho Chehab * An exception is the "drxk_a3.mc" firmware, 279a0bf528SMauro Carvalho Chehab * which uses the 4-parameter command. 289a0bf528SMauro Carvalho Chehab * A value of 0 (default) or lower indicates that 299a0bf528SMauro Carvalho Chehab * the correct number of parameters will be 309a0bf528SMauro Carvalho Chehab * automatically detected. 318e30783bSMauro Carvalho Chehab * @load_firmware_sync: Force the firmware load to be synchronous. 329a0bf528SMauro Carvalho Chehab * 339a0bf528SMauro Carvalho Chehab * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is 349a0bf528SMauro Carvalho Chehab * UIO-3. 359a0bf528SMauro Carvalho Chehab */ 369a0bf528SMauro Carvalho Chehab struct drxk_config { 379a0bf528SMauro Carvalho Chehab u8 adr; 389a0bf528SMauro Carvalho Chehab bool single_master; 399a0bf528SMauro Carvalho Chehab bool no_i2c_bridge; 409a0bf528SMauro Carvalho Chehab bool parallel_ts; 419a0bf528SMauro Carvalho Chehab bool dynamic_clk; 429a0bf528SMauro Carvalho Chehab bool enable_merr_cfg; 438e30783bSMauro Carvalho Chehab bool load_firmware_sync; 449a0bf528SMauro Carvalho Chehab 459a0bf528SMauro Carvalho Chehab bool antenna_dvbt; 469a0bf528SMauro Carvalho Chehab u16 antenna_gpio; 479a0bf528SMauro Carvalho Chehab 489a0bf528SMauro Carvalho Chehab u8 mpeg_out_clk_strength; 499a0bf528SMauro Carvalho Chehab int chunk_size; 509a0bf528SMauro Carvalho Chehab 519a0bf528SMauro Carvalho Chehab const char *microcode_name; 529a0bf528SMauro Carvalho Chehab int qam_demod_parameter_count; 539a0bf528SMauro Carvalho Chehab }; 549a0bf528SMauro Carvalho Chehab 559a0bf528SMauro Carvalho Chehab #if defined(CONFIG_DVB_DRXK) || (defined(CONFIG_DVB_DRXK_MODULE) \ 569a0bf528SMauro Carvalho Chehab && defined(MODULE)) 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