blob: 58baf419560cedb55f11ca5b788cbcd9eff77069 [file] [log] [blame]
Ralph Metzler43dd07f2011-07-03 13:42:18 -03001#ifndef _DRXK_H_
2#define _DRXK_H_
3
4#include <linux/types.h>
5#include <linux/i2c.h>
6
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -03007/**
8 * struct drxk_config - Configure the initial parameters for DRX-K
9 *
10 * adr: I2C Address of the DRX-K
11 * single_master: Device is on the single master mode
12 * no_i2c_bridge: Don't switch the I2C bridge to talk with tuner
Mauro Carvalho Chehab90796ac2011-07-10 09:36:30 -030013 * antenna_gpio: GPIO bit used to control the antenna
14 * antenna_dvbt: GPIO bit for changing antenna to DVB-C. A value of 1
15 * means that 1=DVBC, 0 = DVBT. Zero means the opposite.
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030016 * microcode_name: Name of the firmware file with the microcode
Mauro Carvalho Chehab90796ac2011-07-10 09:36:30 -030017 *
18 * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is
19 * UIO-3.
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030020 */
Mauro Carvalho Chehab0fc55e82011-07-09 12:36:58 -030021struct drxk_config {
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030022 u8 adr;
23 bool single_master;
24 bool no_i2c_bridge;
25
Mauro Carvalho Chehab90796ac2011-07-10 09:36:30 -030026 bool antenna_dvbt;
27 u16 antenna_gpio;
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030028
Mauro Carvalho Chehabe4f4f872011-07-09 17:35:26 -030029 const char *microcode_name;
Mauro Carvalho Chehab0fc55e82011-07-09 12:36:58 -030030};
31
Mauro Carvalho Chehabfd0b08142011-07-11 14:56:30 -030032#if defined(CONFIG_DVB_DRXK) || (defined(CONFIG_DVB_DRXK_MODULE) \
33 && defined(MODULE))
Mauro Carvalho Chehab0fc55e82011-07-09 12:36:58 -030034extern struct dvb_frontend *drxk_attach(const struct drxk_config *config,
35 struct i2c_adapter *i2c,
Ralph Metzler43dd07f2011-07-03 13:42:18 -030036 struct dvb_frontend **fe_t);
Mauro Carvalho Chehabfd0b08142011-07-11 14:56:30 -030037#else
38static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config,
39 struct i2c_adapter *i2c,
40 struct dvb_frontend **fe_t)
41{
42 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
43 return NULL;
44}
45#endif
46
Ralph Metzler43dd07f2011-07-03 13:42:18 -030047#endif