Ralph Metzler | 43dd07f | 2011-07-03 13:42:18 -0300 | [diff] [blame] | 1 | #ifndef _DRXK_H_ |
| 2 | #define _DRXK_H_ |
| 3 | |
Mauro Carvalho Chehab | 782d8b7 | 2013-03-21 16:11:54 -0300 | [diff] [blame] | 4 | #include <linux/kconfig.h> |
Ralph Metzler | 43dd07f | 2011-07-03 13:42:18 -0300 | [diff] [blame] | 5 | #include <linux/types.h> |
| 6 | #include <linux/i2c.h> |
| 7 | |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 8 | /** |
| 9 | * struct drxk_config - Configure the initial parameters for DRX-K |
| 10 | * |
Mauro Carvalho Chehab | cd7a67a | 2013-04-28 11:47:44 -0300 | [diff] [blame] | 11 | * @adr: I2C address of the DRX-K |
Mauro Carvalho Chehab | 67f0461 | 2012-01-20 18:30:58 -0300 | [diff] [blame] | 12 | * @parallel_ts: True means that the device uses parallel TS, |
Mauro Carvalho Chehab | 534e048 | 2011-07-24 14:59:20 -0300 | [diff] [blame] | 13 | * Serial otherwise. |
Mauro Carvalho Chehab | 67f0461 | 2012-01-20 18:30:58 -0300 | [diff] [blame] | 14 | * @dynamic_clk: True means that the clock will be dynamically |
| 15 | * adjusted. Static clock otherwise. |
Mauro Carvalho Chehab | d585681 | 2012-01-21 07:57:06 -0300 | [diff] [blame] | 16 | * @enable_merr_cfg: Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG. |
Mauro Carvalho Chehab | 67f0461 | 2012-01-20 18:30:58 -0300 | [diff] [blame] | 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 |
Mauro Carvalho Chehab | 90796ac | 2011-07-10 09:36:30 -0300 | [diff] [blame] | 21 | * means that 1=DVBC, 0 = DVBT. Zero means the opposite. |
Mauro Carvalho Chehab | 6fb65a6 | 2012-01-20 19:13:07 -0300 | [diff] [blame] | 22 | * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength. |
Mauro Carvalho Chehab | 67f0461 | 2012-01-20 18:30:58 -0300 | [diff] [blame] | 23 | * @microcode_name: Name of the firmware file with the microcode |
Martin Blumenstingl | 9e23f50a | 2012-07-04 17:36:55 -0300 | [diff] [blame] | 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. |
Mauro Carvalho Chehab | 90796ac | 2011-07-10 09:36:30 -0300 | [diff] [blame] | 32 | * |
| 33 | * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is |
| 34 | * UIO-3. |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 35 | */ |
Mauro Carvalho Chehab | 0fc55e8 | 2011-07-09 12:36:58 -0300 | [diff] [blame] | 36 | struct drxk_config { |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 37 | u8 adr; |
| 38 | bool single_master; |
| 39 | bool no_i2c_bridge; |
Mauro Carvalho Chehab | 534e048 | 2011-07-24 14:59:20 -0300 | [diff] [blame] | 40 | bool parallel_ts; |
Mauro Carvalho Chehab | 67f0461 | 2012-01-20 18:30:58 -0300 | [diff] [blame] | 41 | bool dynamic_clk; |
Mauro Carvalho Chehab | d585681 | 2012-01-21 07:57:06 -0300 | [diff] [blame] | 42 | bool enable_merr_cfg; |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 43 | |
Mauro Carvalho Chehab | 90796ac | 2011-07-10 09:36:30 -0300 | [diff] [blame] | 44 | bool antenna_dvbt; |
| 45 | u16 antenna_gpio; |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 46 | |
Mauro Carvalho Chehab | 6fb65a6 | 2012-01-20 19:13:07 -0300 | [diff] [blame] | 47 | u8 mpeg_out_clk_strength; |
| 48 | int chunk_size; |
Eddi De Pieri | 82e7dbb | 2011-11-19 11:37:14 -0300 | [diff] [blame] | 49 | |
Martin Blumenstingl | 9e23f50a | 2012-07-04 17:36:55 -0300 | [diff] [blame] | 50 | const char *microcode_name; |
| 51 | int qam_demod_parameter_count; |
Mauro Carvalho Chehab | 0fc55e8 | 2011-07-09 12:36:58 -0300 | [diff] [blame] | 52 | }; |
| 53 | |
Mauro Carvalho Chehab | 782d8b7 | 2013-03-21 16:11:54 -0300 | [diff] [blame] | 54 | #if IS_ENABLED(CONFIG_DVB_DRXK) |
Mauro Carvalho Chehab | 0fc55e8 | 2011-07-09 12:36:58 -0300 | [diff] [blame] | 55 | extern struct dvb_frontend *drxk_attach(const struct drxk_config *config, |
Mauro Carvalho Chehab | fa4b2a1 | 2012-01-05 08:07:32 -0200 | [diff] [blame] | 56 | struct i2c_adapter *i2c); |
Mauro Carvalho Chehab | fd0b0814 | 2011-07-11 14:56:30 -0300 | [diff] [blame] | 57 | #else |
| 58 | static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config, |
Mauro Carvalho Chehab | fa4b2a1 | 2012-01-05 08:07:32 -0200 | [diff] [blame] | 59 | struct i2c_adapter *i2c) |
Mauro Carvalho Chehab | fd0b0814 | 2011-07-11 14:56:30 -0300 | [diff] [blame] | 60 | { |
| 61 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 62 | return NULL; |
| 63 | } |
| 64 | #endif |
| 65 | |
Ralph Metzler | 43dd07f | 2011-07-03 13:42:18 -0300 | [diff] [blame] | 66 | #endif |