Ralph Metzler | 43dd07f | 2011-07-03 13:42:18 -0300 | [diff] [blame] | 1 | #ifndef _DRXK_H_ |
| 2 | #define _DRXK_H_ |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | #include <linux/i2c.h> |
| 6 | |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 7 | /** |
| 8 | * struct drxk_config - Configure the initial parameters for DRX-K |
| 9 | * |
| 10 | * adr: I2C Address of the DRX-K |
Mauro Carvalho Chehab | 534e048 | 2011-07-24 14:59:20 -0300 | [diff] [blame^] | 11 | * parallel_ts: true means that the device uses parallel TS, |
| 12 | * Serial otherwise. |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 13 | * single_master: Device is on the single master mode |
| 14 | * no_i2c_bridge: Don't switch the I2C bridge to talk with tuner |
Mauro Carvalho Chehab | 90796ac | 2011-07-10 09:36:30 -0300 | [diff] [blame] | 15 | * antenna_gpio: GPIO bit used to control the antenna |
| 16 | * antenna_dvbt: GPIO bit for changing antenna to DVB-C. A value of 1 |
| 17 | * means that 1=DVBC, 0 = DVBT. Zero means the opposite. |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 18 | * microcode_name: Name of the firmware file with the microcode |
Mauro Carvalho Chehab | 90796ac | 2011-07-10 09:36:30 -0300 | [diff] [blame] | 19 | * |
| 20 | * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is |
| 21 | * UIO-3. |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 22 | */ |
Mauro Carvalho Chehab | 0fc55e8 | 2011-07-09 12:36:58 -0300 | [diff] [blame] | 23 | struct drxk_config { |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 24 | u8 adr; |
| 25 | bool single_master; |
| 26 | bool no_i2c_bridge; |
Mauro Carvalho Chehab | 534e048 | 2011-07-24 14:59:20 -0300 | [diff] [blame^] | 27 | bool parallel_ts; |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 28 | |
Mauro Carvalho Chehab | 90796ac | 2011-07-10 09:36:30 -0300 | [diff] [blame] | 29 | bool antenna_dvbt; |
| 30 | u16 antenna_gpio; |
Mauro Carvalho Chehab | 147e110 | 2011-07-10 08:24:26 -0300 | [diff] [blame] | 31 | |
Eddi De Pieri | 82e7dbb | 2011-11-19 11:37:14 -0300 | [diff] [blame] | 32 | int chunk_size; |
| 33 | |
Mauro Carvalho Chehab | e4f4f87 | 2011-07-09 17:35:26 -0300 | [diff] [blame] | 34 | const char *microcode_name; |
Mauro Carvalho Chehab | 0fc55e8 | 2011-07-09 12:36:58 -0300 | [diff] [blame] | 35 | }; |
| 36 | |
Mauro Carvalho Chehab | fd0b0814 | 2011-07-11 14:56:30 -0300 | [diff] [blame] | 37 | #if defined(CONFIG_DVB_DRXK) || (defined(CONFIG_DVB_DRXK_MODULE) \ |
| 38 | && defined(MODULE)) |
Mauro Carvalho Chehab | 0fc55e8 | 2011-07-09 12:36:58 -0300 | [diff] [blame] | 39 | extern struct dvb_frontend *drxk_attach(const struct drxk_config *config, |
| 40 | struct i2c_adapter *i2c, |
Ralph Metzler | 43dd07f | 2011-07-03 13:42:18 -0300 | [diff] [blame] | 41 | struct dvb_frontend **fe_t); |
Mauro Carvalho Chehab | fd0b0814 | 2011-07-11 14:56:30 -0300 | [diff] [blame] | 42 | #else |
| 43 | static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config, |
| 44 | struct i2c_adapter *i2c, |
| 45 | struct dvb_frontend **fe_t) |
| 46 | { |
| 47 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 48 | return NULL; |
| 49 | } |
| 50 | #endif |
| 51 | |
Ralph Metzler | 43dd07f | 2011-07-03 13:42:18 -0300 | [diff] [blame] | 52 | #endif |