Commit | Line | Data |
---|---|---|
395d00d1 AP |
1 | /* |
2 | * Montage M88DS3103 demodulator driver | |
3 | * | |
4 | * Copyright (C) 2013 Antti Palosaari <crope@iki.fi> | |
5 | * | |
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. | |
10 | * | |
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. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License along | |
17 | * with this program; if not, write to the Free Software Foundation, Inc., | |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 | */ | |
20 | ||
21 | #ifndef M88DS3103_H | |
22 | #define M88DS3103_H | |
23 | ||
24 | #include <linux/dvb/frontend.h> | |
25 | ||
26 | struct m88ds3103_config { | |
27 | /* | |
28 | * I2C address | |
29 | * 0x68, ... | |
30 | */ | |
31 | u8 i2c_addr; | |
32 | ||
33 | /* | |
34 | * clock | |
35 | * 27000000 | |
36 | */ | |
37 | u32 clock; | |
38 | ||
39 | /* | |
40 | * max bytes I2C provider is asked to write at once | |
41 | * Note: Buffer is taken from the stack currently! | |
42 | * Value must be set. | |
43 | * 33, 65, ... | |
44 | */ | |
45 | u16 i2c_wr_max; | |
46 | ||
47 | /* | |
48 | * TS output mode | |
49 | */ | |
50 | #define M88DS3103_TS_SERIAL 0 /* TS output pin D0, normal */ | |
51 | #define M88DS3103_TS_SERIAL_D7 1 /* TS output pin D7 */ | |
52 | #define M88DS3103_TS_PARALLEL 2 /* 24 MHz, normal */ | |
53 | #define M88DS3103_TS_PARALLEL_12 3 /* 12 MHz */ | |
54 | #define M88DS3103_TS_PARALLEL_16 4 /* 16 MHz */ | |
55 | #define M88DS3103_TS_PARALLEL_19_2 5 /* 19.2 MHz */ | |
56 | #define M88DS3103_TS_CI 6 /* 6 MHz */ | |
57 | u8 ts_mode; | |
58 | ||
59 | /* | |
60 | * spectrum inversion | |
61 | */ | |
62 | u8 spec_inv:1; | |
63 | ||
64 | /* | |
65 | * AGC polarity | |
66 | */ | |
67 | u8 agc_inv:1; | |
68 | ||
69 | /* | |
70 | * clock output | |
71 | */ | |
72 | #define M88DS3103_CLOCK_OUT_DISABLED 0 | |
73 | #define M88DS3103_CLOCK_OUT_ENABLED 1 | |
74 | #define M88DS3103_CLOCK_OUT_ENABLED_DIV2 2 | |
75 | u8 clock_out; | |
76 | ||
77 | /* | |
78 | * DiSEqC envelope mode | |
79 | */ | |
80 | u8 envelope_mode:1; | |
81 | ||
82 | u8 agc; | |
83 | }; | |
84 | ||
85 | /* | |
86 | * Driver implements own I2C-adapter for tuner I2C access. That's since chip | |
87 | * has I2C-gate control which closes gate automatically after I2C transfer. | |
88 | * Using own I2C adapter we can workaround that. | |
89 | */ | |
90 | ||
91 | #if defined(CONFIG_DVB_M88DS3103) || \ | |
92 | (defined(CONFIG_DVB_M88DS3103_MODULE) && defined(MODULE)) | |
93 | extern struct dvb_frontend *m88ds3103_attach( | |
94 | const struct m88ds3103_config *config, | |
95 | struct i2c_adapter *i2c, | |
96 | struct i2c_adapter **tuner_i2c); | |
97 | #else | |
98 | static inline struct dvb_frontend *m88ds3103_attach( | |
99 | const struct m88ds3103_config *config, | |
100 | struct i2c_adapter *i2c, | |
101 | struct i2c_adapter **tuner_i2c) | |
102 | { | |
103 | pr_warn("%s: driver disabled by Kconfig\n", __func__); | |
104 | return NULL; | |
105 | } | |
106 | #endif | |
107 | ||
108 | #endif |