blob: 9d64e4fea066818969ad54a39a7eff03a6e368c2 [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 *
Mauro Carvalho Chehab67f04612012-01-20 18:30:58 -030010 * @adr: I2C Address of the DRX-K
11 * @parallel_ts: True means that the device uses parallel TS,
Mauro Carvalho Chehab534e0482011-07-24 14:59:20 -030012 * Serial otherwise.
Mauro Carvalho Chehab67f04612012-01-20 18:30:58 -030013 * @dynamic_clk: True means that the clock will be dynamically
14 * adjusted. Static clock otherwise.
Mauro Carvalho Chehabd5856812012-01-21 07:57:06 -030015 * @enable_merr_cfg: Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG.
Mauro Carvalho Chehab67f04612012-01-20 18:30:58 -030016 * @single_master: Device is on the single master mode
17 * @no_i2c_bridge: Don't switch the I2C bridge to talk with tuner
18 * @antenna_gpio: GPIO bit used to control the antenna
19 * @antenna_dvbt: GPIO bit for changing antenna to DVB-C. A value of 1
Mauro Carvalho Chehab90796ac2011-07-10 09:36:30 -030020 * means that 1=DVBC, 0 = DVBT. Zero means the opposite.
Mauro Carvalho Chehab6fb65a62012-01-20 19:13:07 -030021 * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength.
Mauro Carvalho Chehab67f04612012-01-20 18:30:58 -030022 * @microcode_name: Name of the firmware file with the microcode
Mauro Carvalho Chehab90796ac2011-07-10 09:36:30 -030023 *
24 * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is
25 * UIO-3.
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030026 */
Mauro Carvalho Chehab0fc55e82011-07-09 12:36:58 -030027struct drxk_config {
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030028 u8 adr;
29 bool single_master;
30 bool no_i2c_bridge;
Mauro Carvalho Chehab534e0482011-07-24 14:59:20 -030031 bool parallel_ts;
Mauro Carvalho Chehab67f04612012-01-20 18:30:58 -030032 bool dynamic_clk;
Mauro Carvalho Chehabd5856812012-01-21 07:57:06 -030033 bool enable_merr_cfg;
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030034
Mauro Carvalho Chehab90796ac2011-07-10 09:36:30 -030035 bool antenna_dvbt;
36 u16 antenna_gpio;
Mauro Carvalho Chehab147e1102011-07-10 08:24:26 -030037
Mauro Carvalho Chehab6fb65a62012-01-20 19:13:07 -030038 u8 mpeg_out_clk_strength;
39 int chunk_size;
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -030040
Mauro Carvalho Chehabe4f4f872011-07-09 17:35:26 -030041 const char *microcode_name;
Mauro Carvalho Chehab0fc55e82011-07-09 12:36:58 -030042};
43
Mauro Carvalho Chehabfd0b08142011-07-11 14:56:30 -030044#if defined(CONFIG_DVB_DRXK) || (defined(CONFIG_DVB_DRXK_MODULE) \
45 && defined(MODULE))
Mauro Carvalho Chehab0fc55e82011-07-09 12:36:58 -030046extern struct dvb_frontend *drxk_attach(const struct drxk_config *config,
Mauro Carvalho Chehabfa4b2a12012-01-05 08:07:32 -020047 struct i2c_adapter *i2c);
Mauro Carvalho Chehabfd0b08142011-07-11 14:56:30 -030048#else
49static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config,
Mauro Carvalho Chehabfa4b2a12012-01-05 08:07:32 -020050 struct i2c_adapter *i2c)
Mauro Carvalho Chehabfd0b08142011-07-11 14:56:30 -030051{
52 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
53 return NULL;
54}
55#endif
56
Ralph Metzler43dd07f2011-07-03 13:42:18 -030057#endif