diff options
Diffstat (limited to 'drivers/media/dvb-frontends/m88ds3103.h')
| -rw-r--r-- | drivers/media/dvb-frontends/m88ds3103.h | 67 |
1 files changed, 60 insertions, 7 deletions
diff --git a/drivers/media/dvb-frontends/m88ds3103.h b/drivers/media/dvb-frontends/m88ds3103.h index 9b3b4962da7c..04b355a005fb 100644 --- a/drivers/media/dvb-frontends/m88ds3103.h +++ b/drivers/media/dvb-frontends/m88ds3103.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Montage M88DS3103 demodulator driver | 2 | * Montage Technology M88DS3103/M88RS6000 demodulator driver |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2013 Antti Palosaari <crope@iki.fi> | 4 | * Copyright (C) 2013 Antti Palosaari <crope@iki.fi> |
| 5 | * | 5 | * |
| @@ -19,6 +19,63 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/dvb/frontend.h> | 20 | #include <linux/dvb/frontend.h> |
| 21 | 21 | ||
| 22 | /* | ||
| 23 | * I2C address | ||
| 24 | * 0x68, | ||
| 25 | */ | ||
| 26 | |||
| 27 | /** | ||
| 28 | * struct m88ds3103_platform_data - Platform data for the m88ds3103 driver | ||
| 29 | * @clk: Clock frequency. | ||
| 30 | * @i2c_wr_max: Max bytes I2C adapter can write at once. | ||
| 31 | * @ts_mode: TS mode. | ||
| 32 | * @ts_clk: TS clock (KHz). | ||
| 33 | * @ts_clk_pol: TS clk polarity. 1-active at falling edge; 0-active at rising | ||
| 34 | * edge. | ||
| 35 | * @spec_inv: Input spectrum inversion. | ||
| 36 | * @agc: AGC configuration. | ||
| 37 | * @agc_inv: AGC polarity. | ||
| 38 | * @clk_out: Clock output. | ||
| 39 | * @envelope_mode: DiSEqC envelope mode. | ||
| 40 | * @lnb_hv_pol: LNB H/V pin polarity. 0: pin high set to VOLTAGE_18, pin low to | ||
| 41 | * set VOLTAGE_13. 1: pin high set to VOLTAGE_13, pin low to set VOLTAGE_18. | ||
| 42 | * @lnb_en_pol: LNB enable pin polarity. 0: pin high to disable, pin low to | ||
| 43 | * enable. 1: pin high to enable, pin low to disable. | ||
| 44 | * @get_dvb_frontend: Get DVB frontend. | ||
| 45 | * @get_i2c_adapter: Get I2C adapter. | ||
| 46 | */ | ||
| 47 | |||
| 48 | struct m88ds3103_platform_data { | ||
| 49 | u32 clk; | ||
| 50 | u16 i2c_wr_max; | ||
| 51 | #define M88DS3103_TS_SERIAL 0 /* TS output pin D0, normal */ | ||
| 52 | #define M88DS3103_TS_SERIAL_D7 1 /* TS output pin D7 */ | ||
| 53 | #define M88DS3103_TS_PARALLEL 2 /* TS Parallel mode */ | ||
| 54 | #define M88DS3103_TS_CI 3 /* TS CI Mode */ | ||
| 55 | u8 ts_mode:2; | ||
| 56 | u32 ts_clk; | ||
| 57 | u8 ts_clk_pol:1; | ||
| 58 | u8 spec_inv:1; | ||
| 59 | u8 agc; | ||
| 60 | u8 agc_inv:1; | ||
| 61 | #define M88DS3103_CLOCK_OUT_DISABLED 0 | ||
| 62 | #define M88DS3103_CLOCK_OUT_ENABLED 1 | ||
| 63 | #define M88DS3103_CLOCK_OUT_ENABLED_DIV2 2 | ||
| 64 | u8 clk_out:2; | ||
| 65 | u8 envelope_mode:1; | ||
| 66 | u8 lnb_hv_pol:1; | ||
| 67 | u8 lnb_en_pol:1; | ||
| 68 | |||
| 69 | struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *); | ||
| 70 | struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *); | ||
| 71 | |||
| 72 | /* private: For legacy media attach wrapper. Do not set value. */ | ||
| 73 | u8 attach_in_use:1; | ||
| 74 | }; | ||
| 75 | |||
| 76 | /* | ||
| 77 | * Do not add new m88ds3103_attach() users! Use I2C bindings instead. | ||
| 78 | */ | ||
| 22 | struct m88ds3103_config { | 79 | struct m88ds3103_config { |
| 23 | /* | 80 | /* |
| 24 | * I2C address | 81 | * I2C address |
| @@ -113,18 +170,13 @@ struct m88ds3103_config { | |||
| 113 | u8 lnb_en_pol:1; | 170 | u8 lnb_en_pol:1; |
| 114 | }; | 171 | }; |
| 115 | 172 | ||
| 116 | /* | ||
| 117 | * Driver implements own I2C-adapter for tuner I2C access. That's since chip | ||
| 118 | * has I2C-gate control which closes gate automatically after I2C transfer. | ||
| 119 | * Using own I2C adapter we can workaround that. | ||
| 120 | */ | ||
| 121 | |||
| 122 | #if defined(CONFIG_DVB_M88DS3103) || \ | 173 | #if defined(CONFIG_DVB_M88DS3103) || \ |
| 123 | (defined(CONFIG_DVB_M88DS3103_MODULE) && defined(MODULE)) | 174 | (defined(CONFIG_DVB_M88DS3103_MODULE) && defined(MODULE)) |
| 124 | extern struct dvb_frontend *m88ds3103_attach( | 175 | extern struct dvb_frontend *m88ds3103_attach( |
| 125 | const struct m88ds3103_config *config, | 176 | const struct m88ds3103_config *config, |
| 126 | struct i2c_adapter *i2c, | 177 | struct i2c_adapter *i2c, |
| 127 | struct i2c_adapter **tuner_i2c); | 178 | struct i2c_adapter **tuner_i2c); |
| 179 | extern int m88ds3103_get_agc_pwm(struct dvb_frontend *fe, u8 *_agc_pwm); | ||
| 128 | #else | 180 | #else |
| 129 | static inline struct dvb_frontend *m88ds3103_attach( | 181 | static inline struct dvb_frontend *m88ds3103_attach( |
| 130 | const struct m88ds3103_config *config, | 182 | const struct m88ds3103_config *config, |
| @@ -134,6 +186,7 @@ static inline struct dvb_frontend *m88ds3103_attach( | |||
| 134 | pr_warn("%s: driver disabled by Kconfig\n", __func__); | 186 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 135 | return NULL; | 187 | return NULL; |
| 136 | } | 188 | } |
| 189 | #define m88ds3103_get_agc_pwm NULL | ||
| 137 | #endif | 190 | #endif |
| 138 | 191 | ||
| 139 | #endif | 192 | #endif |
