rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _DRXK_H_ |
| 3 | #define _DRXK_H_ |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | #include <linux/i2c.h> |
| 7 | |
| 8 | /** |
| 9 | * struct drxk_config - Configure the initial parameters for DRX-K |
| 10 | * |
| 11 | * @adr: I2C address of the DRX-K |
| 12 | * @parallel_ts: True means that the device uses parallel TS, |
| 13 | * Serial otherwise. |
| 14 | * @dynamic_clk: True means that the clock will be dynamically |
| 15 | * adjusted. Static clock otherwise. |
| 16 | * @enable_merr_cfg: Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG. |
| 17 | * @single_master: Device is on the single master mode |
| 18 | * @no_i2c_bridge: Don't switch the I2C bridge to talk with tuner |
| 19 | * @antenna_gpio: GPIO bit used to control the antenna |
| 20 | * @antenna_dvbt: GPIO bit for changing antenna to DVB-C. A value of 1 |
| 21 | * means that 1=DVBC, 0 = DVBT. Zero means the opposite. |
| 22 | * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength. |
| 23 | * @microcode_name: Name of the firmware file with the microcode |
| 24 | * @qam_demod_parameter_count: The number of parameters used for the command |
| 25 | * to set the demodulator parameters. All |
| 26 | * firmwares are using the 2-parameter commmand. |
| 27 | * An exception is the "drxk_a3.mc" firmware, |
| 28 | * which uses the 4-parameter command. |
| 29 | * A value of 0 (default) or lower indicates that |
| 30 | * the correct number of parameters will be |
| 31 | * automatically detected. |
| 32 | * |
| 33 | * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is |
| 34 | * UIO-3. |
| 35 | */ |
| 36 | struct drxk_config { |
| 37 | u8 adr; |
| 38 | bool single_master; |
| 39 | bool no_i2c_bridge; |
| 40 | bool parallel_ts; |
| 41 | bool dynamic_clk; |
| 42 | bool enable_merr_cfg; |
| 43 | |
| 44 | bool antenna_dvbt; |
| 45 | u16 antenna_gpio; |
| 46 | |
| 47 | u8 mpeg_out_clk_strength; |
| 48 | int chunk_size; |
| 49 | |
| 50 | const char *microcode_name; |
| 51 | int qam_demod_parameter_count; |
| 52 | }; |
| 53 | |
| 54 | #if IS_REACHABLE(CONFIG_DVB_DRXK) |
| 55 | extern struct dvb_frontend *drxk_attach(const struct drxk_config *config, |
| 56 | struct i2c_adapter *i2c); |
| 57 | #else |
| 58 | static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config, |
| 59 | struct i2c_adapter *i2c) |
| 60 | { |
| 61 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 62 | return NULL; |
| 63 | } |
| 64 | #endif |
| 65 | |
| 66 | #endif |