[media] m88ds3103: use I2C mux for tuner I2C adapter
[deliverable/linux.git] / drivers / media / dvb-frontends / m88ds3103_priv.h
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_PRIV_H
22 #define M88DS3103_PRIV_H
23
24 #include "dvb_frontend.h"
25 #include "m88ds3103.h"
26 #include "dvb_math.h"
27 #include <linux/firmware.h>
28 #include <linux/i2c-mux.h>
29
30 #define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
31 #define M88DS3103_MCLK_KHZ 96000
32
33 struct m88ds3103_priv {
34 struct i2c_adapter *i2c;
35 /* mutex needed due to own tuner I2C adapter */
36 struct mutex i2c_mutex;
37 const struct m88ds3103_config *cfg;
38 struct dvb_frontend fe;
39 fe_delivery_system_t delivery_system;
40 fe_status_t fe_status;
41 bool warm; /* FW running */
42 struct i2c_adapter *i2c_adapter;
43 };
44
45 struct m88ds3103_reg_val {
46 u8 reg;
47 u8 val;
48 };
49
50 static const struct m88ds3103_reg_val m88ds3103_dvbs_init_reg_vals[] = {
51 {0x23, 0x07},
52 {0x08, 0x03},
53 {0x0c, 0x02},
54 {0x21, 0x54},
55 {0x25, 0x8a},
56 {0x27, 0x31},
57 {0x30, 0x08},
58 {0x31, 0x40},
59 {0x32, 0x32},
60 {0x33, 0x35},
61 {0x35, 0xff},
62 {0x3a, 0x00},
63 {0x37, 0x10},
64 {0x38, 0x10},
65 {0x39, 0x02},
66 {0x42, 0x60},
67 {0x4a, 0x80},
68 {0x4b, 0x04},
69 {0x4d, 0x91},
70 {0x5d, 0xc8},
71 {0x50, 0x36},
72 {0x51, 0x36},
73 {0x52, 0x36},
74 {0x53, 0x36},
75 {0x63, 0x0f},
76 {0x64, 0x30},
77 {0x65, 0x40},
78 {0x68, 0x26},
79 {0x69, 0x4c},
80 {0x70, 0x20},
81 {0x71, 0x70},
82 {0x72, 0x04},
83 {0x73, 0x00},
84 {0x70, 0x40},
85 {0x71, 0x70},
86 {0x72, 0x04},
87 {0x73, 0x00},
88 {0x70, 0x60},
89 {0x71, 0x70},
90 {0x72, 0x04},
91 {0x73, 0x00},
92 {0x70, 0x80},
93 {0x71, 0x70},
94 {0x72, 0x04},
95 {0x73, 0x00},
96 {0x70, 0xa0},
97 {0x71, 0x70},
98 {0x72, 0x04},
99 {0x73, 0x00},
100 {0x70, 0x1f},
101 {0x76, 0x38},
102 {0x77, 0xa6},
103 {0x78, 0x0c},
104 {0x79, 0x80},
105 {0x7f, 0x14},
106 {0x7c, 0x00},
107 {0xae, 0x82},
108 {0x80, 0x64},
109 {0x81, 0x66},
110 {0x82, 0x44},
111 {0x85, 0x04},
112 {0xcd, 0xf4},
113 {0x90, 0x33},
114 {0xa0, 0x44},
115 {0xc0, 0x08},
116 {0xc3, 0x10},
117 {0xc4, 0x08},
118 {0xc5, 0xf0},
119 {0xc6, 0xff},
120 {0xc7, 0x00},
121 {0xc8, 0x1a},
122 {0xc9, 0x80},
123 {0xe0, 0xf8},
124 {0xe6, 0x8b},
125 {0xd0, 0x40},
126 {0xf8, 0x20},
127 {0xfa, 0x0f},
128 {0x00, 0x00},
129 {0xbd, 0x01},
130 {0xb8, 0x00},
131 };
132
133 static const struct m88ds3103_reg_val m88ds3103_dvbs2_init_reg_vals[] = {
134 {0x23, 0x07},
135 {0x08, 0x07},
136 {0x0c, 0x02},
137 {0x21, 0x54},
138 {0x25, 0x8a},
139 {0x27, 0x31},
140 {0x30, 0x08},
141 {0x32, 0x32},
142 {0x33, 0x35},
143 {0x35, 0xff},
144 {0x3a, 0x00},
145 {0x37, 0x10},
146 {0x38, 0x10},
147 {0x39, 0x02},
148 {0x42, 0x60},
149 {0x4a, 0x80},
150 {0x4b, 0x04},
151 {0x4d, 0x91},
152 {0x5d, 0xc8},
153 {0x50, 0x36},
154 {0x51, 0x36},
155 {0x52, 0x36},
156 {0x53, 0x36},
157 {0x63, 0x0f},
158 {0x64, 0x10},
159 {0x65, 0x20},
160 {0x68, 0x46},
161 {0x69, 0xcd},
162 {0x70, 0x20},
163 {0x71, 0x70},
164 {0x72, 0x04},
165 {0x73, 0x00},
166 {0x70, 0x40},
167 {0x71, 0x70},
168 {0x72, 0x04},
169 {0x73, 0x00},
170 {0x70, 0x60},
171 {0x71, 0x70},
172 {0x72, 0x04},
173 {0x73, 0x00},
174 {0x70, 0x80},
175 {0x71, 0x70},
176 {0x72, 0x04},
177 {0x73, 0x00},
178 {0x70, 0xa0},
179 {0x71, 0x70},
180 {0x72, 0x04},
181 {0x73, 0x00},
182 {0x70, 0x1f},
183 {0x76, 0x38},
184 {0x77, 0xa6},
185 {0x78, 0x0c},
186 {0x79, 0x80},
187 {0x7f, 0x14},
188 {0x85, 0x08},
189 {0xcd, 0xf4},
190 {0x90, 0x33},
191 {0x86, 0x00},
192 {0x87, 0x0f},
193 {0x89, 0x00},
194 {0x8b, 0x44},
195 {0x8c, 0x66},
196 {0x9d, 0xc1},
197 {0x8a, 0x10},
198 {0xad, 0x40},
199 {0xa0, 0x44},
200 {0xc0, 0x08},
201 {0xc1, 0x10},
202 {0xc2, 0x08},
203 {0xc3, 0x10},
204 {0xc4, 0x08},
205 {0xc5, 0xf0},
206 {0xc6, 0xff},
207 {0xc7, 0x00},
208 {0xc8, 0x1a},
209 {0xc9, 0x80},
210 {0xca, 0x23},
211 {0xcb, 0x24},
212 {0xcc, 0xf4},
213 {0xce, 0x74},
214 {0x00, 0x00},
215 {0xbd, 0x01},
216 {0xb8, 0x00},
217 };
218
219 #endif
This page took 0.041409 seconds and 5 git commands to generate.