aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-11-26 14:17:13 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:48 -0500
commitcbb0554f9db8a7f592fad898d57df79fe38bf492 (patch)
tree56d0404c52498e641ed88e02982aa14b8b4109a0 /drivers/media/video
parent403123d276e6af29ed401930fd8e25de768d2e34 (diff)
V4L/DVB (9845): gspca: Add sensor mi0360 in vc032x.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/vc032x.c301
1 files changed, 273 insertions, 28 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 17af353ddd1c..88b5d762dea3 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -41,11 +41,12 @@ struct sd {
41#define BRIDGE_VC0323 1 41#define BRIDGE_VC0323 1
42 char sensor; 42 char sensor;
43#define SENSOR_HV7131R 0 43#define SENSOR_HV7131R 0
44#define SENSOR_MI1320 1 44#define SENSOR_MI0360 1
45#define SENSOR_MI1310_SOC 2 45#define SENSOR_MI1320 2
46#define SENSOR_OV7660 3 46#define SENSOR_MI1310_SOC 3
47#define SENSOR_OV7670 4 47#define SENSOR_OV7660 4
48#define SENSOR_PO3130NC 5 48#define SENSOR_OV7670 5
49#define SENSOR_PO3130NC 6
49}; 50};
50 51
51/* V4L2 controls supported by the driver */ 52/* V4L2 controls supported by the driver */
@@ -111,6 +112,239 @@ static struct v4l2_pix_format vc0323_mode[] = {
111 .priv = 0}, 112 .priv = 0},
112}; 113};
113 114
115static const __u8 mi0360_matrix[9] = {
116 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
117};
118
119static const __u8 mi0360_initVGA_JPG[][4] = {
120 {0xb0, 0x03, 0x19, 0xcc},
121 {0xb0, 0x04, 0x02, 0xcc},
122 {0xb3, 0x00, 0x24, 0xcc},
123 {0xb3, 0x00, 0x25, 0xcc},
124 {0xb3, 0x08, 0x01, 0xcc},
125 {0xb3, 0x09, 0x0c, 0xcc},
126 {0xb3, 0x05, 0x01, 0xcc},
127 {0xb3, 0x06, 0x03, 0xcc},
128 {0xb3, 0x03, 0x0a, 0xcc},
129 {0xb3, 0x20, 0x00, 0xcc},
130 {0xb3, 0x21, 0x00, 0xcc},
131 {0xb3, 0x22, 0x01, 0xcc},
132 {0xb3, 0x23, 0xe0, 0xcc},
133 {0xb3, 0x04, 0x05, 0xcc},
134 {0xb3, 0x14, 0x00, 0xcc},
135 {0xb3, 0x15, 0x00, 0xcc},
136 {0xb3, 0x16, 0x02, 0xcc},
137 {0xb3, 0x17, 0x7f, 0xcc},
138 {0xb3, 0x35, 0xdd, 0xcc},
139 {0xb3, 0x34, 0x02, 0xcc},
140 {0xb3, 0x00, 0x25, 0xcc},
141 {0xbc, 0x00, 0x71, 0xcc},
142 {0xb8, 0x00, 0x13, 0xcc},
143 {0xb8, 0x27, 0x20, 0xcc},
144 {0xb8, 0x2c, 0x50, 0xcc},
145 {0xb8, 0x2d, 0xf8, 0xcc},
146 {0xb8, 0x2e, 0xf8, 0xcc},
147 {0xb8, 0x2f, 0xf8, 0xcc},
148 {0xb8, 0x30, 0x50, 0xcc},
149 {0xb8, 0x31, 0xf8, 0xcc},
150 {0xb8, 0x32, 0xf8, 0xcc},
151 {0xb8, 0x33, 0xf8, 0xcc},
152 {0xb8, 0x34, 0x50, 0xcc},
153 {0xb8, 0x35, 0x00, 0xcc},
154 {0xb8, 0x36, 0x00, 0xcc},
155 {0xb8, 0x37, 0x00, 0xcc},
156 {0xb8, 0x01, 0x79, 0xcc},
157 {0xb8, 0x08, 0xe0, 0xcc},
158 {0xb3, 0x01, 0x41, 0xcc},
159 {0xb8, 0x01, 0x79, 0xcc},
160 {0xb8, 0x14, 0x18, 0xcc},
161 {0xb8, 0xb2, 0x0a, 0xcc},
162 {0xb8, 0xb4, 0x0a, 0xcc},
163 {0xb8, 0xb5, 0x0a, 0xcc},
164 {0xb8, 0xfe, 0x00, 0xcc},
165 {0xb8, 0xff, 0x28, 0xcc},
166 {0xb9, 0x00, 0x28, 0xcc},
167 {0xb9, 0x01, 0x28, 0xcc},
168 {0xb9, 0x02, 0x28, 0xcc},
169 {0xb9, 0x03, 0x00, 0xcc},
170 {0xb9, 0x04, 0x00, 0xcc},
171 {0xb9, 0x05, 0x3c, 0xcc},
172 {0xb9, 0x06, 0x3c, 0xcc},
173 {0xb9, 0x07, 0x3c, 0xcc},
174 {0xb9, 0x08, 0x3c, 0xcc},
175 {0xb8, 0x8e, 0x00, 0xcc},
176 {0xb8, 0x8f, 0xff, 0xcc},
177 {0xb8, 0x81, 0x09, 0xcc},
178 {0x31, 0x00, 0x00, 0xbb},
179 {0x09, 0x01, 0xc7, 0xbb},
180 {0x34, 0x01, 0x00, 0xbb},
181 {0x2b, 0x00, 0x28, 0xbb},
182 {0x2c, 0x00, 0x30, 0xbb},
183 {0x2d, 0x00, 0x30, 0xbb},
184 {0x2e, 0x00, 0x28, 0xbb},
185 {0x62, 0x04, 0x11, 0xbb},
186 {0x03, 0x01, 0xe0, 0xbb},
187 {0x2c, 0x00, 0x2c, 0xbb},
188 {0x20, 0xd0, 0x00, 0xbb},
189 {0x01, 0x00, 0x08, 0xbb},
190 {0x06, 0x00, 0x10, 0xbb},
191 {0x05, 0x00, 0x20, 0xbb},
192 {0x20, 0x00, 0x00, 0xbb},
193 {0xb6, 0x00, 0x00, 0xcc},
194 {0xb6, 0x03, 0x02, 0xcc},
195 {0xb6, 0x02, 0x80, 0xcc},
196 {0xb6, 0x05, 0x01, 0xcc},
197 {0xb6, 0x04, 0xe0, 0xcc},
198 {0xb6, 0x12, 0x78, 0xcc},
199 {0xb6, 0x18, 0x02, 0xcc},
200 {0xb6, 0x17, 0x58, 0xcc},
201 {0xb6, 0x16, 0x00, 0xcc},
202 {0xb6, 0x22, 0x12, 0xcc},
203 {0xb6, 0x23, 0x0b, 0xcc},
204 {0xb3, 0x02, 0x02, 0xcc},
205 {0xbf, 0xc0, 0x39, 0xcc},
206 {0xbf, 0xc1, 0x04, 0xcc},
207 {0xbf, 0xcc, 0x10, 0xcc},
208 {0xb9, 0x12, 0x00, 0xcc},
209 {0xb9, 0x13, 0x0a, 0xcc},
210 {0xb9, 0x14, 0x0a, 0xcc},
211 {0xb9, 0x15, 0x0a, 0xcc},
212 {0xb9, 0x16, 0x0a, 0xcc},
213 {0xb9, 0x18, 0x00, 0xcc},
214 {0xb9, 0x19, 0x0f, 0xcc},
215 {0xb9, 0x1a, 0x0f, 0xcc},
216 {0xb9, 0x1b, 0x0f, 0xcc},
217 {0xb9, 0x1c, 0x0f, 0xcc},
218 {0xb8, 0x8e, 0x00, 0xcc},
219 {0xb8, 0x8f, 0xff, 0xcc},
220 {0xb6, 0x12, 0xf8, 0xcc},
221 {0xb8, 0x0c, 0x20, 0xcc},
222 {0xb8, 0x0d, 0x70, 0xcc},
223 {0xb6, 0x13, 0x13, 0xcc},
224 {0x35, 0x00, 0x60, 0xbb},
225 {0xb3, 0x5c, 0x01, 0xcc},
226 {}
227};
228static const __u8 mi0360_initQVGA_JPG[][4] = {
229 {0xb0, 0x03, 0x19, 0xcc},
230 {0xb0, 0x04, 0x02, 0xcc},
231 {0xb3, 0x00, 0x24, 0xcc},
232 {0xb3, 0x00, 0x25, 0xcc},
233 {0xb3, 0x08, 0x01, 0xcc},
234 {0xb3, 0x09, 0x0c, 0xcc},
235 {0xb3, 0x05, 0x01, 0xcc},
236 {0xb3, 0x06, 0x03, 0xcc},
237 {0xb3, 0x03, 0x0a, 0xcc},
238 {0xb3, 0x20, 0x00, 0xcc},
239 {0xb3, 0x21, 0x00, 0xcc},
240 {0xb3, 0x22, 0x01, 0xcc},
241 {0xb3, 0x23, 0xe0, 0xcc},
242 {0xb3, 0x04, 0x05, 0xcc},
243 {0xb3, 0x14, 0x00, 0xcc},
244 {0xb3, 0x15, 0x00, 0xcc},
245 {0xb3, 0x16, 0x02, 0xcc},
246 {0xb3, 0x17, 0x7f, 0xcc},
247 {0xb3, 0x35, 0xdd, 0xcc},
248 {0xb3, 0x34, 0x02, 0xcc},
249 {0xb3, 0x00, 0x25, 0xcc},
250 {0xbc, 0x00, 0xd1, 0xcc},
251 {0xb8, 0x00, 0x13, 0xcc},
252 {0xb8, 0x27, 0x20, 0xcc},
253 {0xb8, 0x2c, 0x50, 0xcc},
254 {0xb8, 0x2d, 0xf8, 0xcc},
255 {0xb8, 0x2e, 0xf8, 0xcc},
256 {0xb8, 0x2f, 0xf8, 0xcc},
257 {0xb8, 0x30, 0x50, 0xcc},
258 {0xb8, 0x31, 0xf8, 0xcc},
259 {0xb8, 0x32, 0xf8, 0xcc},
260 {0xb8, 0x33, 0xf8, 0xcc},
261 {0xb8, 0x34, 0x50, 0xcc},
262 {0xb8, 0x35, 0x00, 0xcc},
263 {0xb8, 0x36, 0x00, 0xcc},
264 {0xb8, 0x37, 0x00, 0xcc},
265 {0xb8, 0x01, 0x79, 0xcc},
266 {0xb8, 0x08, 0xe0, 0xcc},
267 {0xb3, 0x01, 0x41, 0xcc},
268 {0xb8, 0x01, 0x79, 0xcc},
269 {0xb8, 0x14, 0x18, 0xcc},
270 {0xb8, 0xb2, 0x0a, 0xcc},
271 {0xb8, 0xb4, 0x0a, 0xcc},
272 {0xb8, 0xb5, 0x0a, 0xcc},
273 {0xb8, 0xfe, 0x00, 0xcc},
274 {0xb8, 0xff, 0x28, 0xcc},
275 {0xb9, 0x00, 0x28, 0xcc},
276 {0xb9, 0x01, 0x28, 0xcc},
277 {0xb9, 0x02, 0x28, 0xcc},
278 {0xb9, 0x03, 0x00, 0xcc},
279 {0xb9, 0x04, 0x00, 0xcc},
280 {0xb9, 0x05, 0x3c, 0xcc},
281 {0xb9, 0x06, 0x3c, 0xcc},
282 {0xb9, 0x07, 0x3c, 0xcc},
283 {0xb9, 0x08, 0x3c, 0xcc},
284 {0xb8, 0x8e, 0x00, 0xcc},
285 {0xb8, 0x8f, 0xff, 0xcc},
286 {0xb8, 0x81, 0x09, 0xcc},
287 {0x31, 0x00, 0x00, 0xbb},
288 {0x09, 0x01, 0xc7, 0xbb},
289 {0x34, 0x01, 0x00, 0xbb},
290 {0x2b, 0x00, 0x28, 0xbb},
291 {0x2c, 0x00, 0x30, 0xbb},
292 {0x2d, 0x00, 0x30, 0xbb},
293 {0x2e, 0x00, 0x28, 0xbb},
294 {0x62, 0x04, 0x11, 0xbb},
295 {0x03, 0x01, 0xe0, 0xbb},
296 {0x2c, 0x00, 0x2c, 0xbb},
297 {0x20, 0xd0, 0x00, 0xbb},
298 {0x01, 0x00, 0x08, 0xbb},
299 {0x06, 0x00, 0x10, 0xbb},
300 {0x05, 0x00, 0x20, 0xbb},
301 {0x20, 0x00, 0x00, 0xbb},
302 {0xb6, 0x00, 0x00, 0xcc},
303 {0xb6, 0x03, 0x01, 0xcc},
304 {0xb6, 0x02, 0x40, 0xcc},
305 {0xb6, 0x05, 0x00, 0xcc},
306 {0xb6, 0x04, 0xf0, 0xcc},
307 {0xb6, 0x12, 0x78, 0xcc},
308 {0xb6, 0x18, 0x00, 0xcc},
309 {0xb6, 0x17, 0x96, 0xcc},
310 {0xb6, 0x16, 0x00, 0xcc},
311 {0xb6, 0x22, 0x12, 0xcc},
312 {0xb6, 0x23, 0x0b, 0xcc},
313 {0xb3, 0x02, 0x02, 0xcc},
314 {0xbf, 0xc0, 0x39, 0xcc},
315 {0xbf, 0xc1, 0x04, 0xcc},
316 {0xbf, 0xcc, 0x10, 0xcc},
317 {0xb9, 0x12, 0x00, 0xcc},
318 {0xb9, 0x13, 0x0a, 0xcc},
319 {0xb9, 0x14, 0x0a, 0xcc},
320 {0xb9, 0x15, 0x0a, 0xcc},
321 {0xb9, 0x16, 0x0a, 0xcc},
322 {0xb9, 0x18, 0x00, 0xcc},
323 {0xb9, 0x19, 0x0f, 0xcc},
324 {0xb9, 0x1a, 0x0f, 0xcc},
325 {0xb9, 0x1b, 0x0f, 0xcc},
326 {0xb9, 0x1c, 0x0f, 0xcc},
327 {0xb8, 0x8e, 0x00, 0xcc},
328 {0xb8, 0x8f, 0xff, 0xcc},
329 {0xb6, 0x12, 0xf8, 0xcc},
330 {0xb6, 0x13, 0x13, 0xcc},
331 {0xbc, 0x02, 0x18, 0xcc},
332 {0xbc, 0x03, 0x50, 0xcc},
333 {0xbc, 0x04, 0x18, 0xcc},
334 {0xbc, 0x05, 0x00, 0xcc},
335 {0xbc, 0x06, 0x00, 0xcc},
336 {0xbc, 0x08, 0x30, 0xcc},
337 {0xbc, 0x09, 0x40, 0xcc},
338 {0xbc, 0x0a, 0x10, 0xcc},
339 {0xb8, 0x0c, 0x20, 0xcc},
340 {0xb8, 0x0d, 0x70, 0xcc},
341 {0xbc, 0x0b, 0x00, 0xcc},
342 {0xbc, 0x0c, 0x00, 0xcc},
343 {0x35, 0x00, 0xef, 0xbb},
344 {0xb3, 0x5c, 0x01, 0xcc},
345 {}
346};
347
114static const __u8 mi1310_socinitVGA_JPG[][4] = { 348static const __u8 mi1310_socinitVGA_JPG[][4] = {
115 {0xb0, 0x03, 0x19, 0xcc}, 349 {0xb0, 0x03, 0x19, 0xcc},
116 {0xb0, 0x04, 0x02, 0xcc}, 350 {0xb0, 0x04, 0x02, 0xcc},
@@ -1203,7 +1437,6 @@ static const __u8 ov7670_initQVGA_JPG[][4] = {
1203 {0x00, 0x77, 0x05, 0xaa }, 1437 {0x00, 0x77, 0x05, 0xaa },
1204 {}, 1438 {},
1205}; 1439};
1206
1207struct sensor_info { 1440struct sensor_info {
1208 int sensorId; 1441 int sensorId;
1209 __u8 I2cAdd; 1442 __u8 I2cAdd;
@@ -1222,6 +1455,8 @@ static const struct sensor_info sensor_info_data[] = {
1222 {SENSOR_MI1320, 0x80 | 0xc8, 0x00, 0x148c, 0x64, 0x65, 0x01}, 1455 {SENSOR_MI1320, 0x80 | 0xc8, 0x00, 0x148c, 0x64, 0x65, 0x01},
1223 {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05}, 1456 {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
1224 {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01}, 1457 {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
1458/* (tested in vc032x_probe_sensor) */
1459/* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x4382, 0x24, 0x25, 0x01}, */
1225}; 1460};
1226 1461
1227/* read 'len' bytes in gspca_dev->usb_buf */ 1462/* read 'len' bytes in gspca_dev->usb_buf */
@@ -1283,7 +1518,7 @@ static void read_sensor_register(struct gspca_dev *gspca_dev,
1283 mdata = gspca_dev->usb_buf[0]; 1518 mdata = gspca_dev->usb_buf[0];
1284 reg_r(gspca_dev, 0xa1, 0xb33c, 1); 1519 reg_r(gspca_dev, 0xa1, 0xb33c, 1);
1285 ldata = gspca_dev->usb_buf[0]; 1520 ldata = gspca_dev->usb_buf[0];
1286 PDEBUG(D_PROBE, "Read Sensor h (0x%02X) m (0x%02X) l (0x%02X)", 1521 PDEBUG(D_PROBE, "Read Sensor %02x %02x%02x",
1287 hdata, mdata, ldata); 1522 hdata, mdata, ldata);
1288 reg_r(gspca_dev, 0xa1, 0xb334, 1); 1523 reg_r(gspca_dev, 0xa1, 0xb334, 1);
1289 if (gspca_dev->usb_buf[0] == 0x02) 1524 if (gspca_dev->usb_buf[0] == 0x02)
@@ -1300,7 +1535,7 @@ static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
1300 const struct sensor_info *ptsensor_info; 1535 const struct sensor_info *ptsensor_info;
1301 1536
1302 reg_r(gspca_dev, 0xa1, 0xbfcf, 1); 1537 reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
1303 PDEBUG(D_PROBE, "check sensor header %d", gspca_dev->usb_buf[0]); 1538 PDEBUG(D_PROBE, "check sensor header %02x", gspca_dev->usb_buf[0]);
1304 for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) { 1539 for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) {
1305 ptsensor_info = &sensor_info_data[i]; 1540 ptsensor_info = &sensor_info_data[i];
1306 reg_w(dev, 0xa0, 0x02, 0xb334); 1541 reg_w(dev, 0xa0, 0x02, 0xb334);
@@ -1309,16 +1544,15 @@ static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
1309 reg_w(dev, 0xa0, 0x01, 0xb308); 1544 reg_w(dev, 0xa0, 0x01, 0xb308);
1310 reg_w(dev, 0xa0, 0x0c, 0xb309); 1545 reg_w(dev, 0xa0, 0x0c, 0xb309);
1311 reg_w(dev, 0xa0, ptsensor_info->I2cAdd, 0xb335); 1546 reg_w(dev, 0xa0, ptsensor_info->I2cAdd, 0xb335);
1312/* PDEBUG(D_PROBE,
1313 "check sensor VC032X -> %d Add -> ox%02X!",
1314 i, ptsensor_info->I2cAdd); */
1315 reg_w(dev, 0xa0, ptsensor_info->op, 0xb301); 1547 reg_w(dev, 0xa0, ptsensor_info->op, 0xb301);
1316 read_sensor_register(gspca_dev, ptsensor_info->IdAdd, &value); 1548 read_sensor_register(gspca_dev, ptsensor_info->IdAdd, &value);
1317 if (value == ptsensor_info->VpId) { 1549 if (value == ptsensor_info->VpId)
1318/* PDEBUG(D_PROBE, "find sensor VC032X -> ox%04X!", 1550 return ptsensor_info->sensorId;
1319 ptsensor_info->VpId); */ 1551
1552 /* special case for MI0360 */
1553 if (ptsensor_info->sensorId == SENSOR_MI1310_SOC
1554 && value == 0x4382)
1320 return ptsensor_info->sensorId; 1555 return ptsensor_info->sensorId;
1321 }
1322 } 1556 }
1323 return -1; 1557 return -1;
1324} 1558}
@@ -1420,13 +1654,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
1420 cam = &gspca_dev->cam; 1654 cam = &gspca_dev->cam;
1421 cam->epaddr = 0x02; 1655 cam->epaddr = 0x02;
1422 sd->bridge = id->driver_info; 1656 sd->bridge = id->driver_info;
1423 if (sd->bridge == BRIDGE_VC0321) {
1424 cam->cam_mode = vc0321_mode;
1425 cam->nmodes = ARRAY_SIZE(vc0321_mode);
1426 } else {
1427 cam->cam_mode = vc0323_mode;
1428 cam->nmodes = ARRAY_SIZE(vc0323_mode);
1429 }
1430 1657
1431 vc0321_reset(gspca_dev); 1658 vc0321_reset(gspca_dev);
1432 sensor = vc032x_probe_sensor(gspca_dev); 1659 sensor = vc032x_probe_sensor(gspca_dev);
@@ -1436,29 +1663,36 @@ static int sd_config(struct gspca_dev *gspca_dev,
1436 return -EINVAL; 1663 return -EINVAL;
1437 case SENSOR_HV7131R: 1664 case SENSOR_HV7131R:
1438 PDEBUG(D_PROBE, "Find Sensor HV7131R"); 1665 PDEBUG(D_PROBE, "Find Sensor HV7131R");
1439 sd->sensor = SENSOR_HV7131R; 1666 break;
1667 case SENSOR_MI0360:
1668 PDEBUG(D_PROBE, "Find Sensor MI0360");
1669 sd->bridge = BRIDGE_VC0323;
1440 break; 1670 break;
1441 case SENSOR_MI1310_SOC: 1671 case SENSOR_MI1310_SOC:
1442 PDEBUG(D_PROBE, "Find Sensor MI1310_SOC"); 1672 PDEBUG(D_PROBE, "Find Sensor MI1310_SOC");
1443 sd->sensor = SENSOR_MI1310_SOC;
1444 break; 1673 break;
1445 case SENSOR_MI1320: 1674 case SENSOR_MI1320:
1446 PDEBUG(D_PROBE, "Find Sensor MI1320"); 1675 PDEBUG(D_PROBE, "Find Sensor MI1320");
1447 sd->sensor = SENSOR_MI1320;
1448 break; 1676 break;
1449 case SENSOR_OV7660: 1677 case SENSOR_OV7660:
1450 PDEBUG(D_PROBE, "Find Sensor OV7660"); 1678 PDEBUG(D_PROBE, "Find Sensor OV7660");
1451 sd->sensor = SENSOR_OV7660;
1452 break; 1679 break;
1453 case SENSOR_OV7670: 1680 case SENSOR_OV7670:
1454 PDEBUG(D_PROBE, "Find Sensor OV7670"); 1681 PDEBUG(D_PROBE, "Find Sensor OV7670");
1455 sd->sensor = SENSOR_OV7670;
1456 break; 1682 break;
1457 case SENSOR_PO3130NC: 1683 case SENSOR_PO3130NC:
1458 PDEBUG(D_PROBE, "Find Sensor PO3130NC"); 1684 PDEBUG(D_PROBE, "Find Sensor PO3130NC");
1459 sd->sensor = SENSOR_PO3130NC;
1460 break; 1685 break;
1461 } 1686 }
1687 sd->sensor = sensor;
1688
1689 if (sd->bridge == BRIDGE_VC0321) {
1690 cam->cam_mode = vc0321_mode;
1691 cam->nmodes = ARRAY_SIZE(vc0321_mode);
1692 } else {
1693 cam->cam_mode = vc0323_mode;
1694 cam->nmodes = ARRAY_SIZE(vc0323_mode);
1695 }
1462 1696
1463 sd->qindex = 7; 1697 sd->qindex = 7;
1464 sd->autogain = AUTOGAIN_DEF; 1698 sd->autogain = AUTOGAIN_DEF;
@@ -1551,6 +1785,17 @@ static int sd_start(struct gspca_dev *gspca_dev)
1551 usb_exchange(gspca_dev, ov7670_initVGA_JPG); 1785 usb_exchange(gspca_dev, ov7670_initVGA_JPG);
1552 } 1786 }
1553 break; 1787 break;
1788 case SENSOR_MI0360:
1789 GammaT = mi1320_gamma;
1790 MatrixT = mi0360_matrix;
1791 if (mode) {
1792 /* 320x240 */
1793 usb_exchange(gspca_dev, mi0360_initQVGA_JPG);
1794 } else {
1795 /* 640x480 */
1796 usb_exchange(gspca_dev, mi0360_initVGA_JPG);
1797 }
1798 break;
1554 case SENSOR_MI1310_SOC: 1799 case SENSOR_MI1310_SOC:
1555 if (mode) { 1800 if (mode) {
1556 /* 320x240 */ 1801 /* 320x240 */