diff options
author | Antti Palosaari <crope@iki.fi> | 2013-02-25 12:39:16 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-19 12:17:48 +0100 |
commit | 395d00d1ca8947887fd0fbdec4fff90c4da21877 (patch) | |
tree | ed9daf1657d2f3fab4995bb5a36424d305f000e4 /drivers/media/dvb-frontends/m88ds3103.h | |
parent | [media] dib8000: improve block statistics (diff) | |
download | linux-395d00d1ca8947887fd0fbdec4fff90c4da21877.tar.xz linux-395d00d1ca8947887fd0fbdec4fff90c4da21877.zip |
[media] Montage M88DS3103 DVB-S/S2 demodulator driver
DVB-S/S2 satellite television demodulator driver.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/m88ds3103.h')
-rw-r--r-- | drivers/media/dvb-frontends/m88ds3103.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/m88ds3103.h b/drivers/media/dvb-frontends/m88ds3103.h new file mode 100644 index 000000000000..287d62a4ba7f --- /dev/null +++ b/drivers/media/dvb-frontends/m88ds3103.h @@ -0,0 +1,108 @@ +/* + * Montage M88DS3103 demodulator driver + * + * Copyright (C) 2013 Antti Palosaari <crope@iki.fi> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef M88DS3103_H +#define M88DS3103_H + +#include <linux/dvb/frontend.h> + +struct m88ds3103_config { + /* + * I2C address + * 0x68, ... + */ + u8 i2c_addr; + + /* + * clock + * 27000000 + */ + u32 clock; + + /* + * max bytes I2C provider is asked to write at once + * Note: Buffer is taken from the stack currently! + * Value must be set. + * 33, 65, ... + */ + u16 i2c_wr_max; + + /* + * TS output mode + */ +#define M88DS3103_TS_SERIAL 0 /* TS output pin D0, normal */ +#define M88DS3103_TS_SERIAL_D7 1 /* TS output pin D7 */ +#define M88DS3103_TS_PARALLEL 2 /* 24 MHz, normal */ +#define M88DS3103_TS_PARALLEL_12 3 /* 12 MHz */ +#define M88DS3103_TS_PARALLEL_16 4 /* 16 MHz */ +#define M88DS3103_TS_PARALLEL_19_2 5 /* 19.2 MHz */ +#define M88DS3103_TS_CI 6 /* 6 MHz */ + u8 ts_mode; + + /* + * spectrum inversion + */ + u8 spec_inv:1; + + /* + * AGC polarity + */ + u8 agc_inv:1; + + /* + * clock output + */ +#define M88DS3103_CLOCK_OUT_DISABLED 0 +#define M88DS3103_CLOCK_OUT_ENABLED 1 +#define M88DS3103_CLOCK_OUT_ENABLED_DIV2 2 + u8 clock_out; + + /* + * DiSEqC envelope mode + */ + u8 envelope_mode:1; + + u8 agc; +}; + +/* + * Driver implements own I2C-adapter for tuner I2C access. That's since chip + * has I2C-gate control which closes gate automatically after I2C transfer. + * Using own I2C adapter we can workaround that. + */ + +#if defined(CONFIG_DVB_M88DS3103) || \ + (defined(CONFIG_DVB_M88DS3103_MODULE) && defined(MODULE)) +extern struct dvb_frontend *m88ds3103_attach( + const struct m88ds3103_config *config, + struct i2c_adapter *i2c, + struct i2c_adapter **tuner_i2c); +#else +static inline struct dvb_frontend *m88ds3103_attach( + const struct m88ds3103_config *config, + struct i2c_adapter *i2c, + struct i2c_adapter **tuner_i2c) +{ + pr_warn("%s: driver disabled by Kconfig\n", __func__); + return NULL; +} +#endif + +#endif |