Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
43dd07f7 RM |
2 | #ifndef _DRXK_H_ |
3 | #define _DRXK_H_ | |
4 | ||
5 | #include <linux/types.h> | |
6 | #include <linux/i2c.h> | |
7 | ||
147e110b MCC |
8 | /** |
9 | * struct drxk_config - Configure the initial parameters for DRX-K | |
10 | * | |
cd7a67a4 | 11 | * @adr: I2C address of the DRX-K |
67f04617 | 12 | * @parallel_ts: True means that the device uses parallel TS, |
4a3fad70 | 13 | * Serial otherwise. |
67f04617 MCC |
14 | * @dynamic_clk: True means that the clock will be dynamically |
15 | * adjusted. Static clock otherwise. | |
d5856813 | 16 | * @enable_merr_cfg: Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG. |
67f04617 MCC |
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 | |
90796aca | 21 | * means that 1=DVBC, 0 = DVBT. Zero means the opposite. |
6fb65a66 | 22 | * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength. |
b95b0c98 | 23 | * @chunk_size: maximum size for I2C messages |
67f04617 | 24 | * @microcode_name: Name of the firmware file with the microcode |
9e23f50a MB |
25 | * @qam_demod_parameter_count: The number of parameters used for the command |
26 | * to set the demodulator parameters. All | |
868c9a17 | 27 | * firmwares are using the 2-parameter command. |
b95b0c98 | 28 | * An exception is the ``drxk_a3.mc`` firmware, |
9e23f50a MB |
29 | * which uses the 4-parameter command. |
30 | * A value of 0 (default) or lower indicates that | |
31 | * the correct number of parameters will be | |
32 | * automatically detected. | |
90796aca | 33 | * |
b95b0c98 | 34 | * On the ``*_gpio`` vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is |
90796aca | 35 | * UIO-3. |
147e110b | 36 | */ |
0fc55e81 | 37 | struct drxk_config { |
147e110b MCC |
38 | u8 adr; |
39 | bool single_master; | |
40 | bool no_i2c_bridge; | |
534e0481 | 41 | bool parallel_ts; |
67f04617 | 42 | bool dynamic_clk; |
d5856813 | 43 | bool enable_merr_cfg; |
147e110b | 44 | |
90796aca MCC |
45 | bool antenna_dvbt; |
46 | u16 antenna_gpio; | |
147e110b | 47 | |
6fb65a66 MCC |
48 | u8 mpeg_out_clk_strength; |
49 | int chunk_size; | |
82e7dbbd | 50 | |
9e23f50a MB |
51 | const char *microcode_name; |
52 | int qam_demod_parameter_count; | |
0fc55e81 MCC |
53 | }; |
54 | ||
9b174527 | 55 | #if IS_REACHABLE(CONFIG_DVB_DRXK) |
be9b53c8 MCC |
56 | /** |
57 | * Attach a drxk demod | |
58 | * | |
59 | * @config: pointer to &struct drxk_config with demod configuration. | |
60 | * @i2c: i2c adapter to use. | |
61 | * | |
62 | * return: FE pointer on success, NULL on failure. | |
63 | */ | |
0fc55e81 | 64 | extern struct dvb_frontend *drxk_attach(const struct drxk_config *config, |
fa4b2a17 | 65 | struct i2c_adapter *i2c); |
fd0b0814 MCC |
66 | #else |
67 | static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config, | |
fa4b2a17 | 68 | struct i2c_adapter *i2c) |
fd0b0814 | 69 | { |
4a3fad70 MCC |
70 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
71 | return NULL; | |
fd0b0814 MCC |
72 | } |
73 | #endif | |
74 | ||
43dd07f7 | 75 | #endif |