2 * Montage Technology M88DS3103/M88RS6000 demodulator driver
4 * Copyright (C) 2013 Antti Palosaari <crope@iki.fi>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
20 #include <linux/dvb/frontend.h>
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.
32 * @ts_clk: TS clock (KHz).
33 * @ts_clk_pol: TS clk polarity. 1-active at falling edge; 0-active at rising
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.
48 struct m88ds3103_platform_data
{
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 */
61 #define M88DS3103_CLOCK_OUT_DISABLED 0
62 #define M88DS3103_CLOCK_OUT_ENABLED 1
63 #define M88DS3103_CLOCK_OUT_ENABLED_DIV2 2
69 struct dvb_frontend
* (*get_dvb_frontend
)(struct i2c_client
*);
70 struct i2c_adapter
* (*get_i2c_adapter
)(struct i2c_client
*);
72 /* private: For legacy media attach wrapper. Do not set value. */
77 * Do not add new m88ds3103_attach() users! Use I2C bindings instead.
79 struct m88ds3103_config
{
82 * Default: none, must set
89 * Default: none, must set
95 * max bytes I2C provider is asked to write at once
96 * Default: none, must set
103 * Default: M88DS3103_TS_SERIAL
105 #define M88DS3103_TS_SERIAL 0 /* TS output pin D0, normal */
106 #define M88DS3103_TS_SERIAL_D7 1 /* TS output pin D7 */
107 #define M88DS3103_TS_PARALLEL 2 /* TS Parallel mode */
108 #define M88DS3103_TS_CI 3 /* TS CI Mode */
119 * Default: 0. 1-active at falling edge; 0-active at rising edge.
137 * Default: M88DS3103_CLOCK_OUT_DISABLED
139 #define M88DS3103_CLOCK_OUT_DISABLED 0
140 #define M88DS3103_CLOCK_OUT_ENABLED 1
141 #define M88DS3103_CLOCK_OUT_ENABLED_DIV2 2
145 * DiSEqC envelope mode
152 * Default: none, must set
157 * LNB H/V pin polarity
159 * 1: pin high set to VOLTAGE_13, pin low to set VOLTAGE_18.
160 * 0: pin high set to VOLTAGE_18, pin low to set VOLTAGE_13.
165 * LNB enable pin polarity
167 * 1: pin high to enable, pin low to disable.
168 * 0: pin high to disable, pin low to enable.
173 #if defined(CONFIG_DVB_M88DS3103) || \
174 (defined(CONFIG_DVB_M88DS3103_MODULE) && defined(MODULE))
175 extern struct dvb_frontend
*m88ds3103_attach(
176 const struct m88ds3103_config
*config
,
177 struct i2c_adapter
*i2c
,
178 struct i2c_adapter
**tuner_i2c
);
179 extern int m88ds3103_get_agc_pwm(struct dvb_frontend
*fe
, u8
*_agc_pwm
);
181 static inline struct dvb_frontend
*m88ds3103_attach(
182 const struct m88ds3103_config
*config
,
183 struct i2c_adapter
*i2c
,
184 struct i2c_adapter
**tuner_i2c
)
186 pr_warn("%s: driver disabled by Kconfig\n", __func__
);
189 #define m88ds3103_get_agc_pwm NULL