]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-bsp/linux/linux-omap-psp-2.6.32/cam/0001-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch
BSP: rename beagleboard to TI
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap-psp-2.6.32 / cam / 0001-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch
1 From a03a0f8d0c856a152f477efea64e7df1c927c9b1 Mon Sep 17 00:00:00 2001
2 From: OpenEmbedded User <oe@OE-builder.(none)>
3 Date: Tue, 9 Feb 2010 17:16:13 +0100
4 Subject: [PATCH 01/75] mt9t111: first stab at merging sensor driver based on a patch by Leopard Imaging
6 ---
7  drivers/media/video/Kconfig       |    8 +
8  drivers/media/video/Makefile      |    1 +
9  drivers/media/video/mt9t111.c     |  883 ++++++++++++++++++++++++
10  drivers/media/video/mt9t111_reg.h | 1364 +++++++++++++++++++++++++++++++++++++
11  include/media/mt9t111.h           |   79 +++
12  5 files changed, 2335 insertions(+), 0 deletions(-)
13  create mode 100644 drivers/media/video/mt9t111.c
14  create mode 100644 drivers/media/video/mt9t111_reg.h
15  create mode 100644 include/media/mt9t111.h
17 diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
18 index 41e39a7..f67ed46 100644
19 --- a/drivers/media/video/Kconfig
20 +++ b/drivers/media/video/Kconfig
21 @@ -344,6 +344,14 @@ config VIDEO_MT9P012
22           MT9P012 camera.  It is currently working with the TI OMAP3
23           camera controller.
24  
25 +config VIDEO_MT9T111
26 +       tristate "Micron MT9T111 raw sensor driver (3MP)"
27 +       depends on I2C && VIDEO_V4L2
28 +       ---help---
29 +         This is a Video4Linux2 sensor-level driver for the Micron
30 +         MT9T111 camera.  It is currently working with the TI OMAP3
31 +         camera controller.
32 +
33  config VIDEO_DW9710
34         tristate "Lens driver for DW9710"
35         depends on I2C && VIDEO_V4L2
36 diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
37 index 88e8ec1..31688bf 100644
38 --- a/drivers/media/video/Makefile
39 +++ b/drivers/media/video/Makefile
40 @@ -127,6 +127,7 @@ obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o
41  obj-y                          += isp/
42  obj-$(CONFIG_VIDEO_OMAP3)      += omap34xxcam.o
43  obj-$(CONFIG_VIDEO_MT9P012)     += mt9p012.o
44 +obj-$(CONFIG_VIDEO_MT9T111)     += mt9t111.o
45  obj-$(CONFIG_VIDEO_DW9710)     += dw9710.o
46  obj-$(CONFIG_VIDEO_TPS61059)    += tps61059.o
47  obj-$(CONFIG_VIDEO_OV3640)     += ov3640.o
48 diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c
49 new file mode 100644
50 index 0000000..ecc5115
51 --- /dev/null
52 +++ b/drivers/media/video/mt9t111.c
53 @@ -0,0 +1,883 @@
54 +/*
55 + * drivers/media/video/mt9t111.c
56 + *
57 + * mt9t111 sensor driver
58 + *
59 + * Copyright (C) 2009 Leopard Imaging
60 + *
61 + * This file is licensed under the terms of the GNU General Public License
62 + * version 2. This program is licensed "as is" without any warranty of any
63 + * kind, whether express or implied.
64 + */
65 +
66 +#include <linux/i2c.h>
67 +#include <linux/delay.h>
68 +#include <media/v4l2-int-device.h>
69 +
70 +#include <media/mt9t111.h>
71 +#include "mt9t111_reg.h"
72 +
73 +#define USE_RAW // YCbCr mode does not work yet
74 +//#define COLOR_BAR // Create a Color bar test pattern, Blue, Green, Red, Grey
75 +
76 +#define SENSOR_DETECTED                1
77 +#define SENSOR_NOT_DETECTED    0
78 +
79 +static void mt9t111_loaddefault(struct i2c_client *client);
80 +
81 +/* 
82 +* as a place holder for further development
83 +*/
84 +static void debug_dummy(char *in_msg)
85 +{
86 +       
87 +}
88 +
89 +/* list of image formats supported by mt9t111 sensor */
90 +const static struct v4l2_fmtdesc mt9t111_formats[] = {
91 +#ifdef USE_RAW
92 +       {
93 +               .description    = "RAW ",
94 +               .pixelformat    = V4L2_PIX_FMT_SGRBG10,
95 +       },
96 +#else
97 +       {
98 +               .description    = "YUV 422 ",
99 +               .pixelformat    = V4L2_PIX_FMT_YUYV,
100 +       },
101 +#endif
102 +};
104 +#define NUM_CAPTURE_FORMATS ARRAY_SIZE(mt9t111_formats)
106 +/*
107 + * Array of image sizes supported by MT9T111.  These must be ordered from
108 + * smallest image size to largest.
109 + */
110 +const static struct capture_size mt9t111_sizes[] = {
111 +       {  640, 480 },  
112 +//     { 2048, 1536}           
113 +};
115 +#define NUM_CAPTURE_SIZE ARRAY_SIZE(mt9t111_sizes)
118 +const struct v4l2_fract mt9t111_frameintervals[] = {
119 +       {  .numerator = 1, .denominator = 10 }
120 +};
122 +#define NUM_CAPTURE_FRAMEINTERVALS ARRAY_SIZE(mt9t111_frameintervals)
124 +/**
125 + * struct mt9t111_sensor - main structure for storage of sensor information
126 + * @pdata: access functions and data for platform level information
127 + * @v4l2_int_device: V4L2 device structure structure
128 + * @i2c_client: iic client device structure
129 + * @pix: V4L2 pixel format information structure
130 + * @timeperframe: time per frame expressed as V4L fraction
131 + * @scaler:
132 + * @ver: mt9t111 chip version
133 + * @fps: frames per second value
134 + */
135 +struct mt9t111_sensor {
136 +       const struct mt9t111_platform_data *pdata;
137 +       struct v4l2_int_device *v4l2_int_device;
138 +       struct i2c_client *i2c_client;
139 +       struct v4l2_pix_format pix;
140 +       struct v4l2_fract timeperframe;
141 +       int scaler;
142 +       int ver;
143 +       int fps;
144 +       int state;
145 +};
147 +static struct mt9t111_sensor mt9t111 = {
148 +       .timeperframe = {
149 +               .numerator = 1,
150 +               .denominator = 10,
151 +       },
152 +       .state = SENSOR_NOT_DETECTED,
153 +};
155 +/**
156 + * mt9t111_read_reg - Read a value from a register in an mt9t111 sensor device
157 + * @client: i2c driver client structure
158 + * @data_length: length of data to be read
159 + * @reg: register address / offset
160 + * @val: stores the value that gets read
161 + *
162 + * Read a value from a register in an mt9t111 sensor device.
163 + * The value is returned in 'val'.
164 + * Returns zero if successful, or non-zero otherwise.
165 + */
166 +static int
167 +mt9t111_read_reg(struct i2c_client *client, u16 reg, u16 *val)
168 +{
169 +       struct i2c_msg msg[1];
170 +       u8 data[4];
171 +       int err;
173 +       msg->addr = client->addr;
174 +       msg->flags = 0;
175 +       msg->len = 2;
176 +       msg->buf = data;        
177 +       data[0] = (reg & 0xff00) >> 8;
178 +       data[1] = (reg & 0x00ff);
179 +       err = i2c_transfer(client->adapter, msg, 1);
180 +       if (err >= 0) {                 
181 +               msg->flags = I2C_M_RD;                  
182 +               msg->len = 2;   /* 2 byte read */                       
183 +               err = i2c_transfer(client->adapter, msg, 1);                    
184 +               if (err >= 0) {                         
185 +                       *val = ((data[0] & 0x00ff) << 8)    
186 +                               | (data[1] & 0x00ff);   
187 +                       return 0;
188 +               }
189 +       }
190 +       return err;
191 +}
193 +/**
194 + * mt9t111_write_reg - Write a value to a register in an mt9t111 sensor device
195 + * @client: i2c driver client structure
196 + * @data_length: length of data to be read
197 + * @reg: register address / offset
198 + * @val: value to be written to specified register
199 + *
200 + * Write a value to a register in an mt9t111 sensor device.
201 + * Returns zero if successful, or non-zero otherwise.
202 + */
203 +static int
204 +mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val)
205 +{
206 +       struct i2c_msg msg[1];
207 +       u8 data[20];
208 +       int err;
210 +       msg->addr = client->addr;
211 +       msg->flags = 0;
212 +       msg->len = 4;
213 +       msg->buf = data;
214 +       data[0] = (u8)((reg & 0xff00) >> 8);
215 +       data[1] = (u8)(reg & 0x00ff);   
216 +       data[2] = (u8)((val & 0xff00) >> 8);
217 +       data[3] = (u8)(val & 0x00ff);
218 +       err = i2c_transfer(client->adapter, msg, 1);
220 +       return err;
221 +}
223 +/**
224 + * mt9t111_write_regs - Write registers to an mt9t111 sensor device
225 + * @client: i2c driver client structure
226 + * @reg_in: pointer to registers to write
227 + * @cnt: the number of registers 
228 + *
229 + * Write registers .
230 + * Returns zero if successful, or non-zero otherwise.
231 + */
232 +static int
233 +mt9t111_write_regs(struct i2c_client *client, mt9t111_regs *reg_in, int cnt)
234 +{
235 +       int err = 0;
236 +       int i;
237 +       mt9t111_regs *reg = reg_in;
238 +       
239 +       for (i=0;i<cnt;i++) {
240 +               if (reg->delay_time == 0) {
241 +                       err |= mt9t111_write_reg(client, reg->addr, reg->data);
242 +               } else if (reg->addr != 0 || reg->data != 0) {
243 +                       err |= mt9t111_write_reg(client, reg->addr, reg->data);
244 +                       mdelay(reg->delay_time);
245 +               } else 
246 +                       mdelay(reg->delay_time);
247 +                       
248 +               if (err < 0) {
249 +                       dev_warn(&client->dev, "write reg error, addr = 0x%x, data = 0x%x \n", \
250 +                               reg->addr, reg->data);
251 +                       return err;
252 +               }
253 +               reg++;
254 +       }
255 +       return err;
256 +}
258 +/**
259 + * mt9t111_detect - Detect if an mt9t111 is present, and if so which revision
260 + * @client: pointer to the i2c client driver structure
261 + *
262 + * Detect if an mt9t111 is present
263 + * Returns a negative error number if no device is detected, or the
264 + * non-negative value of the version ID register if a device is detected.
265 + */
266 +static int
267 +mt9t111_detect(struct i2c_client *client)
268 +{
269 +       u16 val;
271 +       /* chip ID is at address 0 */
272 +       if (mt9t111_read_reg(client, MT9T111_CHIP_ID, &val) < 0)
273 +               return -ENODEV;
274 +       dev_info(&client->dev, "model id detected 0x%x\n", val);
275 +       
276 +       if (val != MT9T111_CHIP_ID_VALUE) {
277 +               dev_warn(&client->dev, "model id mismatch received 0x%x expecting 0x%x\n",
278 +                       val, MT9T111_CHIP_ID_VALUE);
280 +               return -ENODEV;
281 +       }
283 +       return 0;
285 +}
287 +/**
288 + * mt9t111_configure - Configure the mt9t111 for the specified image mode
289 + * @s: pointer to standard V4L2 device structure
290 + *
291 + * Configure the mt9t111 for a specified image size, pixel format, and frame
292 + * period.  xclk is the frequency (in Hz) of the xclk input to the mt9t111.
293 + * fper is the frame period (in seconds) expressed as a fraction.
294 + * Returns zero if successful, or non-zero otherwise.
295 + * The actual frame period is returned in fper.
296 + */
297 +static int mt9t111_configure(struct v4l2_int_device *s)
298 +{
299 +       debug_dummy("debug_dummy -- to set imager mode");
301 +       return 0;
302 +}
304 +/**
305 + * ioctl_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes
306 + * @s: pointer to standard V4L2 device structure
307 + * @frms: pointer to standard V4L2 framesizes enumeration structure
308 + *
309 + * Returns possible framesizes depending on choosen pixel format
310 + **/
311 +static int ioctl_enum_framesizes(struct v4l2_int_device *s,
312 +                                       struct v4l2_frmsizeenum *frms)
313 +{
314 +       int ifmt;
316 +       for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) {
317 +               if (frms->pixel_format == mt9t111_formats[ifmt].pixelformat)
318 +                       break;
319 +       }
320 +       /* Is requested pixelformat not found on sensor? */
321 +       if (ifmt == NUM_CAPTURE_FORMATS)
322 +               return -EINVAL;
324 +       /* Do we already reached all discrete framesizes? */
325 +       if (frms->index >= NUM_CAPTURE_SIZE)
326 +               return -EINVAL;
328 +       frms->type = V4L2_FRMSIZE_TYPE_DISCRETE;
329 +       frms->discrete.width = mt9t111_sizes[frms->index].width;
330 +       frms->discrete.height = mt9t111_sizes[frms->index].height;
332 +       return 0;
334 +}
336 +static int ioctl_enum_frameintervals(struct v4l2_int_device *s,
337 +                                       struct v4l2_frmivalenum *frmi)
338 +{
339 +       int ifmt;
341 +printk(KERN_INFO "entering ioctl_enum_frameintervals\n");
342 +printk(KERN_INFO "index = %d, pixel_format = 0x%x, width = %d, height = %d\n",
343 +                       frmi->index, frmi->pixel_format, frmi->width, frmi->height);
344 +printk(KERN_INFO "mt9t111 format = 0x%x\n",    mt9t111_formats[0].pixelformat);
346 +       if (frmi->index >= NUM_CAPTURE_FRAMEINTERVALS)
347 +               return -EINVAL;
348 +       
349 +       for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) {
350 +               if (frmi->pixel_format == mt9t111_formats[ifmt].pixelformat)
351 +                       break;
352 +       }
353 +       /* Is requested pixelformat not found on sensor? */
354 +       if (ifmt == NUM_CAPTURE_FORMATS)
355 +               return -EINVAL;
357 +       frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE;
358 +       frmi->discrete.numerator =
359 +                               mt9t111_frameintervals[frmi->index].numerator;
360 +       frmi->discrete.denominator =
361 +                               mt9t111_frameintervals[frmi->index].denominator;
362 +       return 0;
363 +}
365 +/**
366 + * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT
367 + * @s: pointer to standard V4L2 device structure
368 + *
369 + * Initialize the sensor device (call mt9t111_configure())
370 + */
371 +static int ioctl_init(struct v4l2_int_device *s)
372 +{
373 +       return 0;
374 +}
376 +/**
377 + * ioctl_dev_exit - V4L2 sensor interface handler for vidioc_int_dev_exit_num
378 + * @s: pointer to standard V4L2 device structure
379 + *
380 + * Delinitialise the dev. at slave detach.  The complement of ioctl_dev_init.
381 + */
382 +static int ioctl_dev_exit(struct v4l2_int_device *s)
383 +{
384 +       return 0;
385 +}
387 +/**
388 + * ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num
389 + * @s: pointer to standard V4L2 device structure
390 + *
391 + * Initialise the device when slave attaches to the master.  Returns 0 if
392 + * mt9t111 device could be found, otherwise returns appropriate error.
393 + */
394 +static int ioctl_dev_init(struct v4l2_int_device *s)
395 +{
396 +       return 0;
397 +}
399 +/**
400 + * ioctl_s_power - V4L2 sensor interface handler for vidioc_int_s_power_num
401 + * @s: pointer to standard V4L2 device structure
402 + * @on: power state to which device is to be set
403 + *
404 + * Sets devices power state to requrested state, if possible.
405 + */
406 +static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on)
407 +{
408 +       struct mt9t111_sensor *sensor = s->priv;
409 +       struct i2c_client *c = sensor->i2c_client;
410 +       int rval;
412 +       if ((on == V4L2_POWER_STANDBY) && (sensor->state == SENSOR_DETECTED))
413 +               debug_dummy("debug_dummy -- put to standby\n");
415 +       if (on != V4L2_POWER_ON)
416 +               debug_dummy("debug_dummy -- stop master clock\n");
417 +       else
418 +               debug_dummy("debug_dummy -- enable clock\n");;
420 +       rval = sensor->pdata->power_set(on);
421 +       if (rval < 0) {
422 +               dev_err(&c->dev, "Unable to set the power state: " "mt9t111"
423 +                                                               " sensor\n");
424 +               //sensor->pdata->set_xclk(0);
425 +               return rval;
426 +       }
428 +       if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_DETECTED))
429 +               mt9t111_configure(s);
431 +       if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_NOT_DETECTED)) {
432 +               rval = mt9t111_detect(c);
433 +               if (rval < 0) {
434 +                       dev_err(&c->dev, "Unable to detect " "mt9t111"
435 +                                                               " sensor\n");
436 +                       sensor->state = SENSOR_NOT_DETECTED;
437 +                       return rval;
438 +               }
439 +               mt9t111_loaddefault(c);
440 +               sensor->state = SENSOR_DETECTED;
441 +               sensor->ver = rval;
442 +               pr_info("mt9t111" " chip version 0x%02x detected\n",
443 +                                                               sensor->ver);
444 +       }
445 +       return 0;
446 +}
448 +/**
449 + * ioctl_g_priv - V4L2 sensor interface handler for vidioc_int_g_priv_num
450 + * @s: pointer to standard V4L2 device structure
451 + * @p: void pointer to hold sensor's private data address
452 + *
453 + * Returns device's (sensor's) private data area address in p parameter
454 + */
455 +static int ioctl_g_priv(struct v4l2_int_device *s, void *p)
456 +{
457 +       struct mt9t111_sensor *sensor = s->priv;
459 +       return sensor->pdata->priv_data_set(p);
460 +}
462 +/**
463 + * ioctl_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl
464 + * @s: pointer to standard V4L2 device structure
465 + * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure
466 + *
467 + * Configures the sensor to use the input parameters, if possible.  If
468 + * not possible, reverts to the old parameters and returns the
469 + * appropriate error code.
470 + */
471 +static int ioctl_s_parm(struct v4l2_int_device *s,
472 +                            struct v4l2_streamparm *a)
473 +{
474 +       //TODO: set paramters
475 +       debug_dummy("debug_dummy -- VIDIOC_S_PARM ");
476 +       return 0;
477 +}
479 +/**
480 + * ioctl_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl
481 + * @s: pointer to standard V4L2 device structure
482 + * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure
483 + *
484 + * Returns the sensor's video CAPTURE parameters.
485 + */
486 +static int ioctl_g_parm(struct v4l2_int_device *s,
487 +                            struct v4l2_streamparm *a)
488 +{
489 +       struct mt9t111_sensor *sensor = s->priv;
490 +       struct v4l2_captureparm *cparm = &a->parm.capture;
492 +       if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
493 +               return -EINVAL;
495 +       memset(a, 0, sizeof(*a));
496 +       a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
498 +       cparm->capability = V4L2_CAP_TIMEPERFRAME;
499 +       cparm->timeperframe = sensor->timeperframe;
501 +       return 0;
502 +}
504 +/**
505 + * ioctl_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap
506 + * @s: pointer to standard V4L2 device structure
507 + * @f: pointer to standard V4L2 v4l2_format structure
508 + *
509 + * Returns the sensor's current pixel format in the v4l2_format
510 + * parameter.
511 + */
512 +static int ioctl_g_fmt_cap(struct v4l2_int_device *s,
513 +                               struct v4l2_format *f)
514 +{
515 +       struct mt9t111_sensor *sensor = s->priv;
516 +       f->fmt.pix = sensor->pix;
518 +       return 0;
519 +}
521 +/**
522 + * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl
523 + * @s: pointer to standard V4L2 device structure
524 + * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure
525 + *
526 + * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type.  This
527 + * ioctl is used to negotiate the image capture size and pixel format
528 + * without actually making it take effect.
529 + */
530 +static int ioctl_try_fmt_cap(struct v4l2_int_device *s,
531 +                            struct v4l2_format *f)
532 +{
533 +       struct v4l2_pix_format *pix = &f->fmt.pix;
534 +       struct mt9t111_sensor *sensor = s->priv;
535 +       struct v4l2_pix_format *pix2 = &sensor->pix;
537 +       pix->width = 640;
538 +       pix->height = 480;
539 +#ifdef USE_RAW 
540 +       pix->pixelformat = V4L2_PIX_FMT_SGRBG10;
541 +       pix->bytesperline = pix->width; 
542 +       pix->colorspace =  V4L2_COLORSPACE_SRGB;
543 +#else
544 +       pix->pixelformat = V4L2_PIX_FMT_YUYV;
545 +       pix->bytesperline = pix->width * 2;  
546 +       pix->colorspace = V4L2_COLORSPACE_JPEG;
547 +#endif
548 +       pix->field = V4L2_FIELD_NONE;
550 +       pix->sizeimage = pix->bytesperline * pix->height;
551 +       pix->priv = 0;
552 +       *pix2 = *pix;
553 +       return 0;
554 +}
556 +/**
557 + * ioctl_s_fmt_cap - V4L2 sensor interface handler for VIDIOC_S_FMT ioctl
558 + * @s: pointer to standard V4L2 device structure
559 + * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure
560 + *
561 + * If the requested format is supported, configures the HW to use that
562 + * format, returns error code if format not supported or HW can't be
563 + * correctly configured.
564 + */
565 +static int ioctl_s_fmt_cap(struct v4l2_int_device *s,
566 +                               struct v4l2_format *f)
567 +{
568 +       struct mt9t111_sensor *sensor = s->priv;
569 +       struct v4l2_pix_format *pix = &f->fmt.pix;
570 +       int rval;
572 +       rval = ioctl_try_fmt_cap(s, f);
573 +       if (!rval)
574 +               sensor->pix = *pix;
576 +       return rval;
577 +}
579 +/**
580 + * ioctl_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl
581 + * @s: pointer to standard V4L2 device structure
582 + * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure
583 + *
584 + * Implement the VIDIOC_ENUM_FMT ioctl for the CAPTURE buffer type.
585 + */
586 +static int ioctl_enum_fmt_cap(struct v4l2_int_device *s,
587 +                                  struct v4l2_fmtdesc *fmt)
588 +{
589 +       int index = fmt->index;
590 +       enum v4l2_buf_type type = fmt->type;
592 +       memset(fmt, 0, sizeof(*fmt));
593 +       fmt->index = index;
594 +       fmt->type = type;
596 +       switch (fmt->type) {
597 +       case V4L2_BUF_TYPE_VIDEO_CAPTURE:
598 +               if (index >= NUM_CAPTURE_FORMATS)
599 +                       return -EINVAL;
600 +       break;
601 +       default:
602 +               return -EINVAL;
603 +       }
605 +       fmt->flags = mt9t111_formats[index].flags;
606 +       strlcpy(fmt->description, mt9t111_formats[index].description,
607 +                                       sizeof(fmt->description));
608 +       fmt->pixelformat = mt9t111_formats[index].pixelformat;
610 +       return 0;
611 +}
613 +/**
614 + * ioctl_s_ctrl - V4L2 sensor interface handler for VIDIOC_S_CTRL ioctl
615 + * @s: pointer to standard V4L2 device structure
616 + * @vc: standard V4L2 VIDIOC_S_CTRL ioctl structure
617 + *
618 + * If the requested control is supported, sets the control's current
619 + * value in HW (and updates the video_control[] array).  Otherwise,
620 + * returns -EINVAL if the control is not supported.
621 + */
622 +static int ioctl_s_ctrl(struct v4l2_int_device *s,
623 +                            struct v4l2_control *vc)
624 +{
625 +       debug_dummy("debug_dummy -- s ctrl\n");
626 +       return 0;
627 +}
629 +/**
630 + * ioctl_g_ctrl - V4L2 sensor interface handler for VIDIOC_G_CTRL ioctl
631 + * @s: pointer to standard V4L2 device structure
632 + * @vc: standard V4L2 VIDIOC_G_CTRL ioctl structure
633 + *
634 + * If the requested control is supported, returns the control's current
635 + * value from the video_control[] array.  Otherwise, returns -EINVAL
636 + * if the control is not supported.
637 + */
638 +static int ioctl_g_ctrl(struct v4l2_int_device *s,
639 +                            struct v4l2_control *vc)
640 +{
641 +       debug_dummy("debug_dummy -- g ctrl\n"); 
642 +       return 0;
643 +}
645 +/**
646 + * ioctl_queryctrl - V4L2 sensor interface handler for VIDIOC_QUERYCTRL ioctl
647 + * @s: pointer to standard V4L2 device structure
648 + * @qc: standard V4L2 VIDIOC_QUERYCTRL ioctl structure
649 + *
650 + * If the requested control is supported, returns the control information
651 + * from the video_control[] array.  Otherwise, returns -EINVAL if the
652 + * control is not supported.
653 + */
654 +static int ioctl_queryctrl(struct v4l2_int_device *s,
655 +                               struct v4l2_queryctrl *qc)
656 +{
657 +       debug_dummy("debug_dummy -- query ctrl\n");     
658 +       return-EINVAL;
659 +}
661 +/**
662 + * ioctl_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl
663 + * @s: pointer to standard V4L2 device structure
664 + * @index: number of the input
665 + *
666 + * If index is valid, selects the requested input. Otherwise, returns -EINVAL if
667 + * the input is not supported or there is no active signal present in the
668 + * selected input.
669 + */
670 +static int ioctl_s_routing(struct v4l2_int_device *s,
671 +                               struct v4l2_routing *route)
672 +{
673 +       return 0;
674 +}
676 +/**
677 + * ioctl_g_ifparm - V4L2 decoder interface handler for vidioc_int_g_ifparm_num
678 + * @s: pointer to standard V4L2 device structure
679 + * @p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure
680 + *
681 + * Gets slave interface parameters.
682 + * Calculates the required xclk value to support the requested
683 + * clock parameters in p. This value is returned in the p
684 + * parameter.
685 + */
686 +static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p)
687 +{
688 +       struct mt9t111_sensor *sensor = s->priv;
689 +       int rval;
691 +       if (p == NULL)
692 +               return -EINVAL;
694 +       if (NULL == sensor->pdata->ifparm)
695 +               return -EINVAL;
697 +       rval = sensor->pdata->ifparm(p);
698 +       if (rval) {
699 +               v4l_err(sensor->i2c_client, "g_ifparm.Err[%d]\n", rval);
700 +               return rval;
701 +       }
703 +       p->u.ycbcr.clock_curr = 40*1000000; // temporal value
705 +       return 0;
706 +}
709 +static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = {
710 +       { .num = vidioc_int_enum_framesizes_num,
711 +         .func = (v4l2_int_ioctl_func *)ioctl_enum_framesizes },
712 +       { .num = vidioc_int_enum_frameintervals_num,
713 +         .func = (v4l2_int_ioctl_func *)ioctl_enum_frameintervals },
714 +       { .num = vidioc_int_dev_init_num,
715 +         .func = (v4l2_int_ioctl_func *)ioctl_dev_init },
716 +       { .num = vidioc_int_dev_exit_num,
717 +         .func = (v4l2_int_ioctl_func *)ioctl_dev_exit },
718 +       { .num = vidioc_int_s_power_num,
719 +         .func = (v4l2_int_ioctl_func *)ioctl_s_power },
720 +       { .num = vidioc_int_g_priv_num,
721 +         .func = (v4l2_int_ioctl_func *)ioctl_g_priv },
722 +       {vidioc_int_g_ifparm_num, 
723 +         .func = (v4l2_int_ioctl_func*) ioctl_g_ifparm},
724 +       { .num = vidioc_int_init_num,
725 +         .func = (v4l2_int_ioctl_func *)ioctl_init },
726 +       { .num = vidioc_int_enum_fmt_cap_num,
727 +         .func = (v4l2_int_ioctl_func *)ioctl_enum_fmt_cap },
728 +       { .num = vidioc_int_try_fmt_cap_num,
729 +         .func = (v4l2_int_ioctl_func *)ioctl_try_fmt_cap },
730 +       { .num = vidioc_int_g_fmt_cap_num,
731 +         .func = (v4l2_int_ioctl_func *)ioctl_g_fmt_cap },
732 +       { .num = vidioc_int_s_fmt_cap_num,
733 +         .func = (v4l2_int_ioctl_func *)ioctl_s_fmt_cap },
734 +       { .num = vidioc_int_g_parm_num,
735 +         .func = (v4l2_int_ioctl_func *)ioctl_g_parm },
736 +       { .num = vidioc_int_s_parm_num,
737 +         .func = (v4l2_int_ioctl_func *)ioctl_s_parm },
738 +       { .num = vidioc_int_queryctrl_num,
739 +         .func = (v4l2_int_ioctl_func *)ioctl_queryctrl },
740 +       { .num = vidioc_int_g_ctrl_num,
741 +         .func = (v4l2_int_ioctl_func *)ioctl_g_ctrl },
742 +       { .num = vidioc_int_s_ctrl_num,
743 +         .func = (v4l2_int_ioctl_func *)ioctl_s_ctrl },
744 +       {.num = vidioc_int_s_video_routing_num,
745 +               .func = (v4l2_int_ioctl_func *) ioctl_s_routing},         
746 +};
748 +static void mt9t111_refresh(struct i2c_client *client){        
749 +       int i;  
750 +       unsigned short value;           
751 +       // MCU_ADDRESS [SEQ_CMD] -- refresh     
752 +       mt9t111_write_reg(client, 0x098E,           0x8400);    
753 +       mt9t111_write_reg(client, 0x0990,           0x0006);    
754 +       for (i=0;i<100;i++){            
755 +               mt9t111_write_reg(client, 0x098E, 0x8400);                      
756 +               mt9t111_read_reg(client,0x0990,&value);                         
757 +               if ( value == 0)                        
758 +                       break;          
759 +               mdelay(5);      
760 +       }
761 +}
763 +#ifdef COLOR_BAR
764 +static void mt9t111_color_bar(struct i2c_client *client)
765 +{
766 +       mt9t111_write_reg(client, 0x3210, 0x01B0); // disable lens correction
768 +       mt9t111_write_reg(client, 0x098E, 0x6003);
769 +       mt9t111_write_reg(client, 0x0990, 0x0100);
770 +       mt9t111_write_reg(client, 0x098E, 0x6025);
771 +       mt9t111_write_reg(client, 0x0990, 0x0003);
772 +}
773 +#endif
775 +static void mt9t111_bayer_format(struct i2c_client *client)
776 +{
777 +       mt9t111_write_regs(client, bayer_pattern_regs, sizeof(bayer_pattern_regs)/sizeof(mt9t111_regs));
778 +}
780 +static void mt9t111_enable_pll(struct i2c_client *client)
781 +{
782 +       int i;
783 +       unsigned short value; 
785 +       mt9t111_write_regs(client, pll_regs1, sizeof(pll_regs1)/sizeof(mt9t111_regs));
786 +       for (i=0;i<100;i++){
787 +               mt9t111_read_reg(client,0x0014,&value);
788 +               if (( value & 0x8000) != 0)
789 +                       break;
790 +               mdelay(2);
791 +       }
792 +       mt9t111_write_regs(client, pll_regs2, sizeof(pll_regs2)/sizeof(mt9t111_regs));
793 +}
796 +static void mt9t111_loaddefault(struct i2c_client *client)
797 +{
798 +       mt9t111_write_reg(client, 0x001A, 0x0219);
799 +       mt9t111_write_reg(client, 0x001A, 0x0218);
801 +       mt9t111_enable_pll(client);
802 +       mt9t111_write_regs(client, def_regs1, sizeof(def_regs1)/sizeof(mt9t111_regs));
803 +       mt9t111_write_regs(client, patch_rev6, sizeof(patch_rev6)/sizeof(mt9t111_regs));
804 +       mt9t111_write_regs(client, def_regs2, sizeof(def_regs2)/sizeof(mt9t111_regs));
806 +#ifdef USE_RAW
807 +       mt9t111_bayer_format(client);
808 +#endif
810 +#ifdef COLOR_BAR
811 +       mt9t111_color_bar(client);
812 +#endif
814 +       mt9t111_refresh(client);
815 +}
817 +static struct v4l2_int_slave mt9t111_slave = {
818 +       .ioctls = mt9t111_ioctl_desc,
819 +       .num_ioctls = ARRAY_SIZE(mt9t111_ioctl_desc),
820 +};
822 +static struct v4l2_int_device mt9t111_int_device = {
823 +       .module = THIS_MODULE,
824 +       .name = "mt9t111",
825 +       .priv = &mt9t111,
826 +       .type = v4l2_int_type_slave,
827 +       .u = {
828 +               .slave = &mt9t111_slave,
829 +       },
830 +};
832 +/**
833 + * mt9t111_probe - sensor driver i2c probe handler
834 + * @client: i2c driver client device structure
835 + *
836 + * Register sensor as an i2c client device and V4L2
837 + * device.
838 + */
839 +static int
840 +mt9t111_probe(struct i2c_client *client, const struct i2c_device_id *id)
841 +{
842 +       struct mt9t111_sensor *sensor = &mt9t111;
843 +       int err;
845 +       if (i2c_get_clientdata(client))
846 +               return -EBUSY;
848 +       sensor->pdata = client->dev.platform_data;
850 +       if (!sensor->pdata) {
851 +               dev_err(&client->dev, "no platform data?\n");
852 +               return -ENODEV;
853 +       }
855 +       sensor->v4l2_int_device = &mt9t111_int_device;
856 +       sensor->i2c_client = client;
858 +       i2c_set_clientdata(client, sensor);
860 +       sensor->pix.width = 640;
861 +       sensor->pix.height = 480;
862 +#ifdef USE_RAW 
863 +       sensor->pix.pixelformat = V4L2_PIX_FMT_SGRBG10;
864 +#else
865 +       sensor->pix.pixelformat = V4L2_PIX_FMT_YUYV;
866 +#endif
867 +       err = v4l2_int_device_register(sensor->v4l2_int_device);
868 +       if (err)
869 +               i2c_set_clientdata(client, NULL);
870 +       return err;
871 +}
873 +/**
874 + * mt9t111_remove - sensor driver i2c remove handler
875 + * @client: i2c driver client device structure
876 + *
877 + * Unregister sensor as an i2c client device and V4L2
878 + * device.  Complement of mt9t111_probe().
879 + */
880 +static int __exit
881 +mt9t111_remove(struct i2c_client *client)
882 +{
883 +       struct mt9t111_sensor *sensor = i2c_get_clientdata(client);
885 +       if (!client->adapter)
886 +               return -ENODEV; /* our client isn't attached */
888 +       v4l2_int_device_unregister(sensor->v4l2_int_device);
889 +       i2c_set_clientdata(client, NULL);
891 +       return 0;
892 +}
894 +static const struct i2c_device_id mt9t111_id[] = {
895 +       { "mt9t111", 0 },
896 +       { },
897 +};
898 +MODULE_DEVICE_TABLE(i2c, mt9t111_id);
900 +static struct i2c_driver mt9t111sensor_i2c_driver = {
901 +       .driver = {
902 +               .name = "mt9t111",
903 +               .owner = THIS_MODULE,
904 +       },
905 +       .probe = mt9t111_probe,
906 +       .remove = __exit_p(mt9t111_remove),
907 +       .id_table = mt9t111_id,
908 +};
910 +/**
911 + * mt9t111sensor_init - sensor driver module_init handler
912 + *
913 + * Registers driver as an i2c client driver.  Returns 0 on success,
914 + * error code otherwise.
915 + */
916 +static int __init mt9t111sensor_init(void)
917 +{
918 +printk(KERN_INFO "entering mt9t111sensor_init\n");
919 +       return i2c_add_driver(&mt9t111sensor_i2c_driver);
920 +}
921 +module_init(mt9t111sensor_init);
923 +/**
924 + * mt9t111sensor_cleanup - sensor driver module_exit handler
925 + *
926 + * Unregisters/deletes driver as an i2c client driver.
927 + * Complement of mt9t111sensor_init.
928 + */
929 +static void __exit mt9t111sensor_cleanup(void)
930 +{
931 +       i2c_del_driver(&mt9t111sensor_i2c_driver);
932 +}
933 +module_exit(mt9t111sensor_cleanup);
935 +MODULE_LICENSE("GPL");
936 +MODULE_DESCRIPTION("mt9t111 camera sensor driver");
937 diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h
938 new file mode 100644
939 index 0000000..e012eeb
940 --- /dev/null
941 +++ b/drivers/media/video/mt9t111_reg.h
942 @@ -0,0 +1,1364 @@
943 +/*
944 + * drivers/media/video/mt9t111_reg.h
945 + *
946 + * mt9t111 sensor driver header file
947 + *
948 + * Copyright (C) 2009 Leopard Imaging
949 + *
950 + * This file is licensed under the terms of the GNU General Public License
951 + * version 2. This program is licensed "as is" without any warranty of any
952 + * kind, whether express or implied.
953 + */
955 +#ifndef MT9T111_REG_H
956 +#define MT9T111_REG_H
958 +/* register addr */
959 +#define MT9T111_CHIP_ID                (0x0000)
961 +/* register value */
962 +#define MT9T111_CHIP_ID_VALUE  (0x2680)
964 +typedef struct {
965 +       u16 delay_time;
966 +       u16 addr;
967 +       u16 data;
968 +} mt9t111_regs;
970 +mt9t111_regs patch_rev6[] ={
971 +       {0, 0x0982, 0x0},
972 +       {0, 0x098A, 0xCE7},
973 +       {0, 0x0990, 0x3C3C},
974 +       {0, 0x0992, 0x3C3C},
975 +       {0, 0x0994, 0x3C5F},
976 +       {0, 0x0996, 0x4F30},
977 +       {0, 0x0998, 0xED08},
978 +       {0, 0x099a, 0xBD61},
979 +       {0, 0x099c, 0xD5CE},
980 +       {0, 0x099e, 0x4CD},
981 +       {0, 0x098A, 0xCF7},
982 +       {0, 0x0990, 0x1F17},
983 +       {0, 0x0992, 0x211},
984 +       {0, 0x0994, 0xCC33},
985 +       {0, 0x0996, 0x2E30},
986 +       {0, 0x0998, 0xED02},
987 +       {0, 0x099a, 0xCCFF},
988 +       {0, 0x099c, 0xFDED},
989 +       {0, 0x099e, 0xCC},
990 +       {0, 0x098A, 0xD07},
991 +       {0, 0x0990, 0x2},
992 +       {0, 0x0992, 0xBD70},
993 +       {0, 0x0994, 0x6D18},
994 +       {0, 0x0996, 0xDE1F},
995 +       {0, 0x0998, 0x181F},
996 +       {0, 0x099a, 0x8E01},
997 +       {0, 0x099c, 0x10CC},
998 +       {0, 0x099e, 0x3C52},
999 +       {0, 0x098A, 0xD17},
1000 +       {0, 0x0990, 0x30ED},
1001 +       {0, 0x0992, 0x18},
1002 +       {0, 0x0994, 0xECA0},
1003 +       {0, 0x0996, 0xC4FD},
1004 +       {0, 0x0998, 0xBD70},
1005 +       {0, 0x099a, 0x2120},
1006 +       {0, 0x099c, 0x1ECC},
1007 +       {0, 0x099e, 0x3C52},
1008 +       {0, 0x098A, 0xD27},
1009 +       {0, 0x0990, 0x30ED},
1010 +       {0, 0x0992, 0xDE},
1011 +       {0, 0x0994, 0x1FEC},
1012 +       {0, 0x0996, 0xA0BD},
1013 +       {0, 0x0998, 0x7021},
1014 +       {0, 0x099a, 0xCC3C},
1015 +       {0, 0x099c, 0x5230},
1016 +       {0, 0x099e, 0xED02},
1017 +       {0, 0x098A, 0xD37},
1018 +       {0, 0x0990, 0xCCFF},
1019 +       {0, 0x0992, 0xFCED},
1020 +       {0, 0x0994, 0xCC},
1021 +       {0, 0x0996, 0x2},
1022 +       {0, 0x0998, 0xBD70},
1023 +       {0, 0x099a, 0x6DFC},
1024 +       {0, 0x099c, 0x4E1},
1025 +       {0, 0x099e, 0x1A83},
1026 +       {0, 0x098A, 0xD47},
1027 +       {0, 0x0990, 0x1},
1028 +       {0, 0x0992, 0x2720},
1029 +       {0, 0x0994, 0x1A83},
1030 +       {0, 0x0996, 0x4},
1031 +       {0, 0x0998, 0x271E},
1032 +       {0, 0x099a, 0x1A83},
1033 +       {0, 0x099c, 0x8},
1034 +       {0, 0x099e, 0x271C},
1035 +       {0, 0x098A, 0xD57},
1036 +       {0, 0x0990, 0x1A83},
1037 +       {0, 0x0992, 0x10},
1038 +       {0, 0x0994, 0x271A},
1039 +       {0, 0x0996, 0x1A83},
1040 +       {0, 0x0998, 0x20},
1041 +       {0, 0x099a, 0x2718},
1042 +       {0, 0x099c, 0x1A83},
1043 +       {0, 0x099e, 0x40},
1044 +       {0, 0x098A, 0xD67},
1045 +       {0, 0x0990, 0x2716},
1046 +       {0, 0x0992, 0x2019},
1047 +       {0, 0x0994, 0xC61E},
1048 +       {0, 0x0996, 0x2012},
1049 +       {0, 0x0998, 0xC622},
1050 +       {0, 0x099a, 0x200E},
1051 +       {0, 0x099c, 0xC621},
1052 +       {0, 0x099e, 0x200A},
1053 +       {0, 0x098A, 0xD77},
1054 +       {0, 0x0990, 0xC620},
1055 +       {0, 0x0992, 0x2006},
1056 +       {0, 0x0994, 0xC62A},
1057 +       {0, 0x0996, 0x2002},
1058 +       {0, 0x0998, 0xC62B},
1059 +       {0, 0x099a, 0x30ED},
1060 +       {0, 0x099c, 0x8CC},
1061 +       {0, 0x099e, 0x3400},
1062 +       {0, 0x098A, 0xD87},
1063 +       {0, 0x0990, 0x30ED},
1064 +       {0, 0x0992, 0x34},
1065 +       {0, 0x0994, 0xBD6F},
1066 +       {0, 0x0996, 0xD184},
1067 +       {0, 0x0998, 0x330},
1068 +       {0, 0x099a, 0xED07},
1069 +       {0, 0x099c, 0xA60A},
1070 +       {0, 0x099e, 0x4848},
1071 +       {0, 0x098A, 0xD97},
1072 +       {0, 0x0990, 0x5FED},
1073 +       {0, 0x0992, 0x5EA},
1074 +       {0, 0x0994, 0x8AA},
1075 +       {0, 0x0996, 0x731},
1076 +       {0, 0x0998, 0xBD70},
1077 +       {0, 0x099a, 0x2130},
1078 +       {0, 0x099c, 0xC60A},
1079 +       {0, 0x099e, 0x3A35},
1080 +       {0, 0x098A, 0xDA7},
1081 +       {0, 0x0990, 0x3937},
1082 +       {0, 0x0992, 0x3C3C},
1083 +       {0, 0x0994, 0x3C34},
1084 +       {0, 0x0996, 0xDE2F},
1085 +       {0, 0x0998, 0xEE0E},
1086 +       {0, 0x099a, 0xAD00},
1087 +       {0, 0x099c, 0x7D13},
1088 +       {0, 0x099e, 0xEF27},
1089 +       {0, 0x098A, 0xDB7},
1090 +       {0, 0x0990, 0x7CCE},
1091 +       {0, 0x0992, 0x13E0},
1092 +       {0, 0x0994, 0x1E05},
1093 +       {0, 0x0996, 0x1060},
1094 +       {0, 0x0998, 0xE60E},
1095 +       {0, 0x099a, 0x4FC3},
1096 +       {0, 0x099c, 0x13F0},
1097 +       {0, 0x099e, 0x8FE6},
1098 +       {0, 0x098A, 0xDC7},
1099 +       {0, 0x0990, 0x30},
1100 +       {0, 0x0992, 0xE107},
1101 +       {0, 0x0994, 0x2216},
1102 +       {0, 0x0996, 0xF613},
1103 +       {0, 0x0998, 0xEE4F},
1104 +       {0, 0x099a, 0xC313},
1105 +       {0, 0x099c, 0xF38F},
1106 +       {0, 0x099e, 0xE600},
1107 +       {0, 0x098A, 0xDD7},
1108 +       {0, 0x0990, 0x30E1},
1109 +       {0, 0x0992, 0x725},
1110 +       {0, 0x0994, 0x7F6},
1111 +       {0, 0x0996, 0x13EE},
1112 +       {0, 0x0998, 0xC103},
1113 +       {0, 0x099a, 0x253C},
1114 +       {0, 0x099c, 0x7F13},
1115 +       {0, 0x099e, 0xEEF6},
1116 +       {0, 0x098A, 0xDE7},
1117 +       {0, 0x0990, 0x13EF},
1118 +       {0, 0x0992, 0xE706},
1119 +       {0, 0x0994, 0xCC13},
1120 +       {0, 0x0996, 0xF0ED},
1121 +       {0, 0x0998, 0x4CC},
1122 +       {0, 0x099a, 0x13F3},
1123 +       {0, 0x099c, 0x200F},
1124 +       {0, 0x099e, 0x7C13},
1125 +       {0, 0x098A, 0xDF7},
1126 +       {0, 0x0990, 0xEEEC},
1127 +       {0, 0x0992, 0x4C3},
1128 +       {0, 0x0994, 0x1},
1129 +       {0, 0x0996, 0xED04},
1130 +       {0, 0x0998, 0xEC02},
1131 +       {0, 0x099a, 0xC300},
1132 +       {0, 0x099c, 0x1ED},
1133 +       {0, 0x099e, 0x2F6},
1134 +       {0, 0x098A, 0xE07},
1135 +       {0, 0x0990, 0x13EE},
1136 +       {0, 0x0992, 0xE106},
1137 +       {0, 0x0994, 0x2412},
1138 +       {0, 0x0996, 0xEE04},
1139 +       {0, 0x0998, 0xE600},
1140 +       {0, 0x099a, 0x30E1},
1141 +       {0, 0x099c, 0x722},
1142 +       {0, 0x099e, 0xDFEE},
1143 +       {0, 0x098A, 0xE17},
1144 +       {0, 0x0990, 0x2E6},
1145 +       {0, 0x0992, 0x30},
1146 +       {0, 0x0994, 0xE107},
1147 +       {0, 0x0996, 0x25D6},
1148 +       {0, 0x0998, 0xDE49},
1149 +       {0, 0x099a, 0xEE08},
1150 +       {0, 0x099c, 0xAD00},
1151 +       {0, 0x099e, 0xCC13},
1152 +       {0, 0x098A, 0xE27},
1153 +       {0, 0x0990, 0xF630},
1154 +       {0, 0x0992, 0xED00},
1155 +       {0, 0x0994, 0xDE2F},
1156 +       {0, 0x0996, 0xEE10},
1157 +       {0, 0x0998, 0xCC13},
1158 +       {0, 0x099a, 0xFAAD},
1159 +       {0, 0x099c, 0x38},
1160 +       {0, 0x099e, 0x3838},
1161 +       {0, 0x098A, 0xE37},
1162 +       {0, 0x0990, 0x3839},
1163 +       {0, 0x098A, 0x1000},
1164 +       {0, 0x0990, 0xCC10},
1165 +       {0, 0x0992, 0x9BD},
1166 +       {0, 0x0994, 0x4224},
1167 +       {0, 0x0996, 0x7E10},
1168 +       {0, 0x0998, 0x9C6},
1169 +       {0, 0x099a, 0x1F7},
1170 +       {0, 0x099c, 0x18A},
1171 +       {0, 0x099e, 0xC606},
1172 +       {0, 0x098A, 0x1010},
1173 +       {0, 0x0990, 0xF701},
1174 +       {0, 0x0992, 0x8BDE},
1175 +       {0, 0x0994, 0x3F18},
1176 +       {0, 0x0996, 0xCE0B},
1177 +       {0, 0x0998, 0xF1CC},
1178 +       {0, 0x099a, 0x11},
1179 +       {0, 0x099c, 0xBDD7},
1180 +       {0, 0x099e, 0xCC},
1181 +       {0, 0x098A, 0x1020},
1182 +       {0, 0x0990, 0xBF1},
1183 +       {0, 0x0992, 0xDD3F},
1184 +       {0, 0x0994, 0xDE35},
1185 +       {0, 0x0996, 0x18CE},
1186 +       {0, 0x0998, 0xC03},
1187 +       {0, 0x099a, 0xCC00},
1188 +       {0, 0x099c, 0x3FBD},
1189 +       {0, 0x099e, 0xD700},
1190 +       {0, 0x098A, 0x1030},
1191 +       {0, 0x0990, 0xCC0C},
1192 +       {0, 0x0992, 0x3DD},
1193 +       {0, 0x0994, 0x35DE},
1194 +       {0, 0x0996, 0x4718},
1195 +       {0, 0x0998, 0xCE0C},
1196 +       {0, 0x099a, 0x43CC},
1197 +       {0, 0x099c, 0x15},
1198 +       {0, 0x099e, 0xBDD7},
1199 +       {0, 0x098A, 0x1040},
1200 +       {0, 0x0990, 0xCC},
1201 +       {0, 0x0992, 0xC43},
1202 +       {0, 0x0994, 0xDD47},
1203 +       {0, 0x0996, 0xFE00},
1204 +       {0, 0x0998, 0x3318},
1205 +       {0, 0x099a, 0xCE0C},
1206 +       {0, 0x099c, 0x59CC},
1207 +       {0, 0x099e, 0x9},
1208 +       {0, 0x098A, 0x1050},
1209 +       {0, 0x0990, 0xBDD7},
1210 +       {0, 0x0992, 0xCC},
1211 +       {0, 0x0994, 0xC59},
1212 +       {0, 0x0996, 0xFD00},
1213 +       {0, 0x0998, 0x33DE},
1214 +       {0, 0x099a, 0x4118},
1215 +       {0, 0x099c, 0xCE0C},
1216 +       {0, 0x099e, 0x63CC},
1217 +       {0, 0x098A, 0x1060},
1218 +       {0, 0x0990, 0xD},
1219 +       {0, 0x0992, 0xBDD7},
1220 +       {0, 0x0994, 0xCC},
1221 +       {0, 0x0996, 0xC63},
1222 +       {0, 0x0998, 0xDD41},
1223 +       {0, 0x099a, 0xFE00},
1224 +       {0, 0x099c, 0x3118},
1225 +       {0, 0x099e, 0xCE0C},
1226 +       {0, 0x098A, 0x1070},
1227 +       {0, 0x0990, 0x71CC},
1228 +       {0, 0x0992, 0x29},
1229 +       {0, 0x0994, 0xBDD7},
1230 +       {0, 0x0996, 0xCC},
1231 +       {0, 0x0998, 0xC71},
1232 +       {0, 0x099a, 0xFD00},
1233 +       {0, 0x099c, 0x31DE},
1234 +       {0, 0x099e, 0x3918},
1235 +       {0, 0x098A, 0x1080},
1236 +       {0, 0x0990, 0xCE0C},
1237 +       {0, 0x0992, 0x9BCC},
1238 +       {0, 0x0994, 0x23},
1239 +       {0, 0x0996, 0xBDD7},
1240 +       {0, 0x0998, 0xCC},
1241 +       {0, 0x099a, 0xC9B},
1242 +       {0, 0x099c, 0xDD39},
1243 +       {0, 0x099e, 0xDE49},
1244 +       {0, 0x098A, 0x1090},
1245 +       {0, 0x0990, 0x18CE},
1246 +       {0, 0x0992, 0xCBF},
1247 +       {0, 0x0994, 0xCC00},
1248 +       {0, 0x0996, 0xDBD},
1249 +       {0, 0x0998, 0xD700},
1250 +       {0, 0x099a, 0xCC0C},
1251 +       {0, 0x099c, 0xBFDD},
1252 +       {0, 0x099e, 0x49CC},
1253 +       {0, 0x098A, 0x10A0},
1254 +       {0, 0x0990, 0x1162},
1255 +       {0, 0x0992, 0xFD0B},
1256 +       {0, 0x0994, 0xFDCC},
1257 +       {0, 0x0996, 0xCE7},
1258 +       {0, 0x0998, 0xFD0C},
1259 +       {0, 0x099a, 0x1FCC},
1260 +       {0, 0x099c, 0x1245},
1261 +       {0, 0x099e, 0xFD0C},
1262 +       {0, 0x098A, 0x10B0},
1263 +       {0, 0x0990, 0x51CC},
1264 +       {0, 0x0992, 0x110B},
1265 +       {0, 0x0994, 0xFD0C},
1266 +       {0, 0x0996, 0x5BCC},
1267 +       {0, 0x0998, 0x1108},
1268 +       {0, 0x099a, 0xFD0C},
1269 +       {0, 0x099c, 0x65CC},
1270 +       {0, 0x099e, 0x10D0},
1271 +       {0, 0x098A, 0x10C0},
1272 +       {0, 0x0990, 0xFD0C},
1273 +       {0, 0x0992, 0x7BCC},
1274 +       {0, 0x0994, 0x12DE},
1275 +       {0, 0x0996, 0xFD0C},
1276 +       {0, 0x0998, 0xA7CC},
1277 +       {0, 0x099a, 0xDA8},
1278 +       {0, 0x099c, 0xFD0C},
1279 +       {0, 0x099e, 0xCB39},
1280 +       {0, 0x098A, 0x10D0},
1281 +       {0, 0x0990, 0x37DE},
1282 +       {0, 0x0992, 0x1DEC},
1283 +       {0, 0x0994, 0xC5F},
1284 +       {0, 0x0996, 0x8402},
1285 +       {0, 0x0998, 0x4416},
1286 +       {0, 0x099a, 0x4FF7},
1287 +       {0, 0x099c, 0xCCD},
1288 +       {0, 0x099e, 0xE60B},
1289 +       {0, 0x098A, 0x10E0},
1290 +       {0, 0x0990, 0xC407},
1291 +       {0, 0x0992, 0xF70C},
1292 +       {0, 0x0994, 0xCE7F},
1293 +       {0, 0x0996, 0x30C4},
1294 +       {0, 0x0998, 0xEC25},
1295 +       {0, 0x099a, 0xFD30},
1296 +       {0, 0x099c, 0xC5FC},
1297 +       {0, 0x099e, 0x6D6},
1298 +       {0, 0x098A, 0x10F0},
1299 +       {0, 0x0990, 0xFD30},
1300 +       {0, 0x0992, 0xC701},
1301 +       {0, 0x0994, 0xFC30},
1302 +       {0, 0x0996, 0xC0FD},
1303 +       {0, 0x0998, 0xBED},
1304 +       {0, 0x099a, 0xFC30},
1305 +       {0, 0x099c, 0xC2FD},
1306 +       {0, 0x099e, 0xBEF},
1307 +       {0, 0x098A, 0x1100},
1308 +       {0, 0x0990, 0x30E6},
1309 +       {0, 0x0992, 0xBD},
1310 +       {0, 0x0994, 0x5203},
1311 +       {0, 0x0996, 0x3139},
1312 +       {0, 0x0998, 0x7E9E},
1313 +       {0, 0x099a, 0x143C},
1314 +       {0, 0x099c, 0x3C3C},
1315 +       {0, 0x099e, 0x2101},
1316 +       {0, 0x098A, 0x1110},
1317 +       {0, 0x0990, 0xCC00},
1318 +       {0, 0x0992, 0x18BD},
1319 +       {0, 0x0994, 0x6FD1},
1320 +       {0, 0x0996, 0xC504},
1321 +       {0, 0x0998, 0x26F5},
1322 +       {0, 0x099a, 0xDC25},
1323 +       {0, 0x099c, 0x30ED},
1324 +       {0, 0x099e, 0x420},
1325 +       {0, 0x098A, 0x1120},
1326 +       {0, 0x0990, 0x12EE},
1327 +       {0, 0x0992, 0x43C},
1328 +       {0, 0x0994, 0x1838},
1329 +       {0, 0x0996, 0xE621},
1330 +       {0, 0x0998, 0x18E7},
1331 +       {0, 0x099a, 0xBE30},
1332 +       {0, 0x099c, 0xEE04},
1333 +       {0, 0x099e, 0xEC1D},
1334 +       {0, 0x098A, 0x1130},
1335 +       {0, 0x0990, 0x30ED},
1336 +       {0, 0x0992, 0x4EC},
1337 +       {0, 0x0994, 0x426},
1338 +       {0, 0x0996, 0xEACC},
1339 +       {0, 0x0998, 0x1A},
1340 +       {0, 0x099a, 0xED02},
1341 +       {0, 0x099c, 0xCCFB},
1342 +       {0, 0x099e, 0xFFED},
1343 +       {0, 0x098A, 0x1140},
1344 +       {0, 0x0990, 0xCC},
1345 +       {0, 0x0992, 0x400},
1346 +       {0, 0x0994, 0xBD70},
1347 +       {0, 0x0996, 0x6DCC},
1348 +       {0, 0x0998, 0x1A},
1349 +       {0, 0x099a, 0x30ED},
1350 +       {0, 0x099c, 0x2CC},
1351 +       {0, 0x099e, 0xFBFF},
1352 +       {0, 0x098A, 0x1150},
1353 +       {0, 0x0990, 0xED00},
1354 +       {0, 0x0992, 0x5F4F},
1355 +       {0, 0x0994, 0xBD70},
1356 +       {0, 0x0996, 0x6D5F},
1357 +       {0, 0x0998, 0xBD5B},
1358 +       {0, 0x099a, 0x17BD},
1359 +       {0, 0x099c, 0x558B},
1360 +       {0, 0x099e, 0x3838},
1361 +       {0, 0x098A, 0x1160},
1362 +       {0, 0x0990, 0x3839},
1363 +       {0, 0x0992, 0x3C3C},
1364 +       {0, 0x0994, 0xC640},
1365 +       {0, 0x0996, 0xF730},
1366 +       {0, 0x0998, 0xC4FC},
1367 +       {0, 0x099a, 0xBED},
1368 +       {0, 0x099c, 0xFD30},
1369 +       {0, 0x099e, 0xC0FC},
1370 +       {0, 0x098A, 0x1170},
1371 +       {0, 0x0990, 0xBEF},
1372 +       {0, 0x0992, 0xFD30},
1373 +       {0, 0x0994, 0xC2DE},
1374 +       {0, 0x0996, 0x1DEC},
1375 +       {0, 0x0998, 0x25FD},
1376 +       {0, 0x099a, 0x30C5},
1377 +       {0, 0x099c, 0x101},
1378 +       {0, 0x099e, 0x1FC},
1379 +       {0, 0x098A, 0x1180},
1380 +       {0, 0x0990, 0x30C2},
1381 +       {0, 0x0992, 0xFD06},
1382 +       {0, 0x0994, 0xD6EC},
1383 +       {0, 0x0996, 0xC5F},
1384 +       {0, 0x0998, 0x8402},
1385 +       {0, 0x099a, 0x4416},
1386 +       {0, 0x099c, 0x4F30},
1387 +       {0, 0x099e, 0xE703},
1388 +       {0, 0x098A, 0x1190},
1389 +       {0, 0x0990, 0xF10C},
1390 +       {0, 0x0992, 0xCD27},
1391 +       {0, 0x0994, 0x15F1},
1392 +       {0, 0x0996, 0xCCD},
1393 +       {0, 0x0998, 0x2309},
1394 +       {0, 0x099a, 0xFC06},
1395 +       {0, 0x099c, 0xD604},
1396 +       {0, 0x099e, 0xFD06},
1397 +       {0, 0x098A, 0x11A0},
1398 +       {0, 0x0990, 0xD620},
1399 +       {0, 0x0992, 0x7FC},
1400 +       {0, 0x0994, 0x6D6},
1401 +       {0, 0x0996, 0x5FD},
1402 +       {0, 0x0998, 0x6D6},
1403 +       {0, 0x099a, 0xDE1D},
1404 +       {0, 0x099c, 0xE60B},
1405 +       {0, 0x099e, 0xC407},
1406 +       {0, 0x098A, 0x11B0},
1407 +       {0, 0x0990, 0x30E7},
1408 +       {0, 0x0992, 0x2F1},
1409 +       {0, 0x0994, 0xCCE},
1410 +       {0, 0x0996, 0x272C},
1411 +       {0, 0x0998, 0x7D0C},
1412 +       {0, 0x099a, 0xCE27},
1413 +       {0, 0x099c, 0x275D},
1414 +       {0, 0x099e, 0x2724},
1415 +       {0, 0x098A, 0x11C0},
1416 +       {0, 0x0990, 0x7F30},
1417 +       {0, 0x0992, 0xC4FC},
1418 +       {0, 0x0994, 0x6D6},
1419 +       {0, 0x0996, 0xFD30},
1420 +       {0, 0x0998, 0xC5F6},
1421 +       {0, 0x099a, 0xCCE},
1422 +       {0, 0x099c, 0x4FFD},
1423 +       {0, 0x099e, 0x30C7},
1424 +       {0, 0x098A, 0x11D0},
1425 +       {0, 0x0990, 0xC640},
1426 +       {0, 0x0992, 0xF730},
1427 +       {0, 0x0994, 0xC4E6},
1428 +       {0, 0x0996, 0x24F},
1429 +       {0, 0x0998, 0xFD30},
1430 +       {0, 0x099a, 0xC501},
1431 +       {0, 0x099c, 0x101},
1432 +       {0, 0x099e, 0xFC30},
1433 +       {0, 0x098A, 0x11E0},
1434 +       {0, 0x0990, 0xC2FD},
1435 +       {0, 0x0992, 0x6D6},
1436 +       {0, 0x0994, 0x7D06},
1437 +       {0, 0x0996, 0xCB27},
1438 +       {0, 0x0998, 0x2EC6},
1439 +       {0, 0x099a, 0x40F7},
1440 +       {0, 0x099c, 0x30C4},
1441 +       {0, 0x099e, 0xFC06},
1442 +       {0, 0x098A, 0x11F0},
1443 +       {0, 0x0990, 0xC104},
1444 +       {0, 0x0992, 0xF306},
1445 +       {0, 0x0994, 0xD6ED},
1446 +       {0, 0x0996, 0x5F},
1447 +       {0, 0x0998, 0x6D00},
1448 +       {0, 0x099a, 0x2A01},
1449 +       {0, 0x099c, 0x5317},
1450 +       {0, 0x099e, 0xFD30},
1451 +       {0, 0x098A, 0x1200},
1452 +       {0, 0x0990, 0xC0EC},
1453 +       {0, 0x0992, 0xFD},
1454 +       {0, 0x0994, 0x30C2},
1455 +       {0, 0x0996, 0xFC06},
1456 +       {0, 0x0998, 0xC1FD},
1457 +       {0, 0x099a, 0x30C5},
1458 +       {0, 0x099c, 0x101},
1459 +       {0, 0x099e, 0x1FC},
1460 +       {0, 0x098A, 0x1210},
1461 +       {0, 0x0990, 0x30C2},
1462 +       {0, 0x0992, 0xFD06},
1463 +       {0, 0x0994, 0xC720},
1464 +       {0, 0x0996, 0x227F},
1465 +       {0, 0x0998, 0x30C4},
1466 +       {0, 0x099a, 0xDE1D},
1467 +       {0, 0x099c, 0xEC25},
1468 +       {0, 0x099e, 0xFD30},
1469 +       {0, 0x098A, 0x1220},
1470 +       {0, 0x0990, 0xC5FC},
1471 +       {0, 0x0992, 0x6D6},
1472 +       {0, 0x0994, 0xFD30},
1473 +       {0, 0x0996, 0xC701},
1474 +       {0, 0x0998, 0xFC30},
1475 +       {0, 0x099a, 0xC0FD},
1476 +       {0, 0x099c, 0x6D0},
1477 +       {0, 0x099e, 0xFC30},
1478 +       {0, 0x098A, 0x1230},
1479 +       {0, 0x0990, 0xC2FD},
1480 +       {0, 0x0992, 0x6D2},
1481 +       {0, 0x0994, 0xEC25},
1482 +       {0, 0x0996, 0xFD06},
1483 +       {0, 0x0998, 0xC3BD},
1484 +       {0, 0x099a, 0x953C},
1485 +       {0, 0x099c, 0xDE3F},
1486 +       {0, 0x099e, 0xEE10},
1487 +       {0, 0x098A, 0x1240},
1488 +       {0, 0x0990, 0xAD00},
1489 +       {0, 0x0992, 0x3838},
1490 +       {0, 0x0994, 0x3930},
1491 +       {0, 0x0996, 0x8FC3},
1492 +       {0, 0x0998, 0xFFE9},
1493 +       {0, 0x099a, 0x8F35},
1494 +       {0, 0x099c, 0xBDAD},
1495 +       {0, 0x099e, 0x1530},
1496 +       {0, 0x098A, 0x1250},
1497 +       {0, 0x0990, 0x6F16},
1498 +       {0, 0x0992, 0x18DE},
1499 +       {0, 0x0994, 0x1918},
1500 +       {0, 0x0996, 0x8FC3},
1501 +       {0, 0x0998, 0x14B},
1502 +       {0, 0x099a, 0x188F},
1503 +       {0, 0x099c, 0x18EC},
1504 +       {0, 0x099e, 0xFD},
1505 +       {0, 0x098A, 0x1260},
1506 +       {0, 0x0990, 0x50E},
1507 +       {0, 0x0992, 0x18EC},
1508 +       {0, 0x0994, 0x2FD},
1509 +       {0, 0x0996, 0x510},
1510 +       {0, 0x0998, 0xE616},
1511 +       {0, 0x099a, 0x4FED},
1512 +       {0, 0x099c, 0x418},
1513 +       {0, 0x099e, 0x8FC3},
1514 +       {0, 0x098A, 0x1270},
1515 +       {0, 0x0990, 0xFFCB},
1516 +       {0, 0x0992, 0xE304},
1517 +       {0, 0x0994, 0x8FE6},
1518 +       {0, 0x0996, 0xF7},
1519 +       {0, 0x0998, 0x514},
1520 +       {0, 0x099a, 0x18DE},
1521 +       {0, 0x099c, 0x1930},
1522 +       {0, 0x099e, 0xE616},
1523 +       {0, 0x098A, 0x1280},
1524 +       {0, 0x0990, 0x4FED},
1525 +       {0, 0x0992, 0x418},
1526 +       {0, 0x0994, 0x8FC3},
1527 +       {0, 0x0996, 0x119},
1528 +       {0, 0x0998, 0xE304},
1529 +       {0, 0x099a, 0x8FE6},
1530 +       {0, 0x099c, 0xF7},
1531 +       {0, 0x099e, 0x515},
1532 +       {0, 0x098A, 0x1290},
1533 +       {0, 0x0990, 0xFC05},
1534 +       {0, 0x0992, 0x5BFD},
1535 +       {0, 0x0994, 0x512},
1536 +       {0, 0x0996, 0xDE37},
1537 +       {0, 0x0998, 0xEE08},
1538 +       {0, 0x099a, 0xAD00},
1539 +       {0, 0x099c, 0x30E6},
1540 +       {0, 0x099e, 0x164F},
1541 +       {0, 0x098A, 0x12A0},
1542 +       {0, 0x0990, 0x5ED},
1543 +       {0, 0x0992, 0x48F},
1544 +       {0, 0x0994, 0xC300},
1545 +       {0, 0x0996, 0x630},
1546 +       {0, 0x0998, 0xE304},
1547 +       {0, 0x099a, 0x8FF6},
1548 +       {0, 0x099c, 0x516},
1549 +       {0, 0x099e, 0x4FED},
1550 +       {0, 0x098A, 0x12B0},
1551 +       {0, 0x0990, 0x30},
1552 +       {0, 0x0992, 0x6C16},
1553 +       {0, 0x0994, 0xE616},
1554 +       {0, 0x0996, 0xC103},
1555 +       {0, 0x0998, 0x2598},
1556 +       {0, 0x099a, 0xCC32},
1557 +       {0, 0x099c, 0x8EED},
1558 +       {0, 0x099e, 0xEC},
1559 +       {0, 0x098A, 0x12C0},
1560 +       {0, 0x0990, 0x6BD},
1561 +       {0, 0x0992, 0x7021},
1562 +       {0, 0x0994, 0xCC32},
1563 +       {0, 0x0996, 0x6C30},
1564 +       {0, 0x0998, 0xED02},
1565 +       {0, 0x099a, 0xCCF8},
1566 +       {0, 0x099c, 0xED},
1567 +       {0, 0x099e, 0xA6},
1568 +       {0, 0x098A, 0x12D0},
1569 +       {0, 0x0990, 0x9E3},
1570 +       {0, 0x0992, 0xA84},
1571 +       {0, 0x0994, 0x7BD},
1572 +       {0, 0x0996, 0x706D},
1573 +       {0, 0x0998, 0x30C6},
1574 +       {0, 0x099a, 0x173A},
1575 +       {0, 0x099c, 0x3539},
1576 +       {0, 0x099e, 0x3CBD},
1577 +       {0, 0x098A, 0x12E0},
1578 +       {0, 0x0990, 0x776D},
1579 +       {0, 0x0992, 0xCC32},
1580 +       {0, 0x0994, 0x5C30},
1581 +       {0, 0x0996, 0xED00},
1582 +       {0, 0x0998, 0xFC13},
1583 +       {0, 0x099a, 0x8683},
1584 +       {0, 0x099c, 0x1},
1585 +       {0, 0x099e, 0xBD70},
1586 +       {0, 0x098A, 0x12F0},
1587 +       {0, 0x0990, 0x21CC},
1588 +       {0, 0x0992, 0x325E},
1589 +       {0, 0x0994, 0x30ED},
1590 +       {0, 0x0996, 0xFC},
1591 +       {0, 0x0998, 0x1388},
1592 +       {0, 0x099a, 0x8300},
1593 +       {0, 0x099c, 0x1BD},
1594 +       {0, 0x099e, 0x7021},
1595 +       {0, 0x098A, 0x1300},
1596 +       {0, 0x0990, 0x3839},
1597 +       {0, 0x098E, 0x0010},
1598 +       {0, 0x0990, 0x1000},
1599 +       {0, 0x098E, 0x0003},
1600 +       {100, 0x0990, 0x0004}
1601 +};
1603 +mt9t111_regs def_regs1[] ={
1604 +       {0, 0x001A, 0x0218},
1605 +       {0, 0x001E, 0x0777},
1606 +       {0, 0x3084, 0x2409},
1607 +       {0, 0x3092, 0x0A49},
1608 +       {0, 0x3094, 0x4949},
1609 +       {0, 0x3096, 0x4950},
1610 +       {0, 0x0018, 0x402D},
1611 +       {100, 0x0018, 0x402C},
1612 +       {0, 0x098E, 0x6800},
1613 +       {0, 0x0990, 0x0280},
1614 +       {0, 0x098E, 0x6802},
1615 +       {0, 0x0990, 0x01E0},
1616 +       {0, 0x098E, 0xE88E},
1617 +       {0, 0x0990, 0x0000},
1618 +       {0, 0x098E, 0x68A0},
1619 +       {0, 0x0990, 0x082D},
1620 +       {0, 0x098E, 0x4802},
1621 +       {0, 0x0990, 0x0000},
1622 +       {0, 0x098E, 0x4804},
1623 +       {0, 0x0990, 0x0000},
1624 +       {0, 0x098E, 0x4806},
1625 +       {0, 0x0990, 0x060D},
1626 +       {0, 0x098E, 0x4808},
1627 +       {0, 0x0990, 0x080D},
1628 +       {0, 0x098E, 0x480A},
1629 +       {0, 0x0990, 0x0111},
1630 +       {0, 0x098E, 0x480C},
1631 +       {0, 0x0990, 0x046C},
1632 +       {0, 0x098E, 0x480F},
1633 +       {0, 0x0990, 0x00CC},
1634 +       {0, 0x098E, 0x4811},
1635 +       {0, 0x0990, 0x0381},
1636 +       {0, 0x098E, 0x4813},
1637 +       {0, 0x0990, 0x024F},
1638 +       {0, 0x098E, 0x481D},
1639 +       {0, 0x0990, 0x05AE},
1640 +       {0, 0x098E, 0x481F},
1641 +       {0, 0x0990, 0x05D0},
1642 +       {0, 0x098E, 0x4825},
1643 +       {0, 0x0990, 0x07AC},
1644 +       {0, 0x098E, 0x6C00},
1645 +       {0, 0x0990, 0x0800},
1646 +       {0, 0x098E, 0x6C02},
1647 +       {0, 0x0990, 0x0600},
1648 +       {0, 0x098E, 0xEC8E},
1649 +       {0, 0x0990, 0x0000},
1650 +       {0, 0x098E, 0x6CA0},
1651 +       {0, 0x0990, 0x082D},
1652 +       {0, 0x098E, 0x484A},
1653 +       {0, 0x0990, 0x0000},
1654 +       {0, 0x098E, 0x484C},
1655 +       {0, 0x0990, 0x0000},
1656 +       {0, 0x098E, 0x484E},
1657 +       {0, 0x0990, 0x060D},
1658 +       {0, 0x098E, 0x4850},
1659 +       {0, 0x0990, 0x080D},
1660 +       {0, 0x098E, 0x4852},
1661 +       {0, 0x0990, 0x0111},
1662 +       {0, 0x098E, 0x4854},
1663 +       {0, 0x0990, 0x146C},
1664 +       {0, 0x098E, 0x4857},
1665 +       {0, 0x0990, 0x00CC},
1666 +       {0, 0x098E, 0x4859},
1667 +       {0, 0x0990, 0x0381},
1668 +       {0, 0x098E, 0x485B},
1669 +       {0, 0x0990, 0x024F},
1670 +       {0, 0x098E, 0x4865},
1671 +       {0, 0x0990, 0x05AE},
1672 +       {0, 0x098E, 0x4867},
1673 +       {0, 0x0990, 0x05D0},
1674 +       {0, 0x098E, 0x486D},
1675 +       {0, 0x0990, 0x07AC},
1676 +       {0, 0x098E, 0xC8A5},
1677 +       {0, 0x0990, 0x001D},
1678 +       {0, 0x098E, 0xC8A6},
1679 +       {0, 0x0990, 0x0020},
1680 +       {0, 0x098E, 0xC8A7},
1681 +       {0, 0x0990, 0x0023},
1682 +       {0, 0x098E, 0xC8A8},
1683 +       {0, 0x0990, 0x0026},
1684 +       {0, 0x098E, 0xC844},
1685 +       {0, 0x0990, 0x0091},
1686 +       {0, 0x098E, 0xC92F},
1687 +       {0, 0x0990, 0x0000},
1688 +       {0, 0x098E, 0xC845},
1689 +       {0, 0x0990, 0x0079},
1690 +       {0, 0x098E, 0xC92D},
1691 +       {0, 0x0990, 0x0000},
1692 +       {0, 0x098E, 0xC88C},
1693 +       {0, 0x0990, 0x0091},
1694 +       {0, 0x098E, 0xC930},
1695 +       {0, 0x0990, 0x0000},
1696 +       {0, 0x098E, 0xC88D},
1697 +       {0, 0x0990, 0x0079},
1698 +       {0, 0x098E, 0xC92E},
1699 +       {0, 0x0990, 0x0000},
1700 +       {0, 0x098E, 0xA002},
1701 +       {0, 0x0990, 0x0010},
1702 +       {0, 0x098E, 0xA009},
1703 +       {0, 0x0990, 0x0002},
1704 +       {0, 0x098E, 0xA00A},
1705 +       {0, 0x0990, 0x0003},
1706 +       {0, 0x098E, 0xA00C},
1707 +       {0, 0x0990, 0x000A},
1708 +       {0, 0x098E, 0x4846},
1709 +       {0, 0x0990, 0x0014},
1710 +       {0, 0x098E, 0x68AA},
1711 +       {0, 0x0990, 0x0278},
1712 +       {0, 0x098E, 0x488E},
1713 +       {0, 0x0990, 0x0014},
1714 +       {0, 0x098E, 0x6CAA},
1715 +       {0, 0x0990, 0x0218},
1716 +       {0, 0x098E, 0x8400},
1717 +       {0, 0x0990, 0x0006},
1718 +       {0, 0x098E, 0x8400},
1719 +       {0, 0x0990, 0x0005},
1720 +       {0, 0x3C20, 0x0001},
1721 +       {0, 0x364A, 0x7D2F},
1722 +       {0, 0x364C, 0x79EB},
1723 +       {0, 0x364E, 0x18D2},
1724 +       {0, 0x3650, 0x9F8F},
1725 +       {0, 0x3652, 0xA7D2},
1726 +       {0, 0x368A, 0x460C},
1727 +       {0, 0x368C, 0x14F0},
1728 +       {0, 0x368E, 0x946F},
1729 +       {0, 0x3690, 0xC471},
1730 +       {0, 0x3692, 0x04B1},
1731 +       {0, 0x36CA, 0x0433},
1732 +       {0, 0x36CC, 0x680D},
1733 +       {0, 0x36CE, 0xEEF3},
1734 +       {0, 0x36D0, 0x4850},
1735 +       {0, 0x36D2, 0xF233},
1736 +       {0, 0x370A, 0xB2AF},
1737 +       {0, 0x370C, 0x2CF0},
1738 +       {0, 0x370E, 0x3F10},
1739 +       {0, 0x3710, 0xC673},
1740 +       {0, 0x3712, 0xA972},
1741 +       {0, 0x374A, 0x0590},
1742 +       {0, 0x374C, 0xAFB3},
1743 +       {0, 0x374E, 0x93D7},
1744 +       {0, 0x3750, 0x8D12},
1745 +       {0, 0x3752, 0x2539},
1746 +       {0, 0x3640, 0x0350},
1747 +       {0, 0x3642, 0x322C},
1748 +       {0, 0x3644, 0x77D1},
1749 +       {0, 0x3646, 0xA26F},
1750 +       {0, 0x3648, 0xC872},
1751 +       {0, 0x3680, 0x0C4C},
1752 +       {0, 0x3682, 0x9510},
1753 +       {0, 0x3684, 0x110E},
1754 +       {0, 0x3686, 0x4331},
1755 +       {0, 0x3688, 0xC1CF},
1756 +       {0, 0x36C0, 0x6152},
1757 +       {0, 0x36C2, 0x038E},
1758 +       {0, 0x36C4, 0x9AF4},
1759 +       {0, 0x36C6, 0xE12F},
1760 +       {0, 0x36C8, 0x09F3},
1761 +       {0, 0x3700, 0xC5AF},
1762 +       {0, 0x3702, 0xCA90},
1763 +       {0, 0x3704, 0x5D0F},
1764 +       {0, 0x3706, 0x3293},
1765 +       {0, 0x3708, 0x2B92},
1766 +       {0, 0x3740, 0xC590},
1767 +       {0, 0x3742, 0x8133},
1768 +       {0, 0x3744, 0xE0F6},
1769 +       {0, 0x3746, 0x0254},
1770 +       {0, 0x3748, 0x10B9},
1771 +       {0, 0x3654, 0x7F8F},
1772 +       {0, 0x3656, 0x6F6C},
1773 +       {0, 0x3658, 0x5971},
1774 +       {0, 0x365A, 0x9A0F},
1775 +       {0, 0x365C, 0xA1B2},
1776 +       {0, 0x3694, 0xB00C},
1777 +       {0, 0x3696, 0xEBCF},
1778 +       {0, 0x3698, 0x06AD},
1779 +       {0, 0x369A, 0x4D31},
1780 +       {0, 0x369C, 0x2A4E},
1781 +       {0, 0x36D4, 0x4752},
1782 +       {0, 0x36D6, 0x724D},
1783 +       {0, 0x36D8, 0xAD34},
1784 +       {0, 0x36DA, 0x1350},
1785 +       {0, 0x36DC, 0x4E94},
1786 +       {0, 0x3714, 0xA06E},
1787 +       {0, 0x3716, 0x9152},
1788 +       {0, 0x3718, 0x1F53},
1789 +       {0, 0x371A, 0x3933},
1790 +       {0, 0x371C, 0xBA94},
1791 +       {0, 0x3754, 0x1233},
1792 +       {0, 0x3756, 0xA032},
1793 +       {0, 0x3758, 0xE936},
1794 +       {0, 0x375A, 0xBE34},
1795 +       {0, 0x375C, 0x02D9},
1796 +       {0, 0x365E, 0x7DEF},
1797 +       {0, 0x3660, 0x434B},
1798 +       {0, 0x3662, 0x69F1},
1799 +       {0, 0x3664, 0x8A0F},
1800 +       {0, 0x3666, 0xBDB2},
1801 +       {0, 0x369E, 0x290D},
1802 +       {0, 0x36A0, 0x42CF},
1803 +       {0, 0x36A2, 0xDC6D},
1804 +       {0, 0x36A4, 0x91B1},
1805 +       {0, 0x36A6, 0x9DE9},
1806 +       {0, 0x36DE, 0x70B2},
1807 +       {0, 0x36E0, 0x02AC},
1808 +       {0, 0x36E2, 0x9714},
1809 +       {0, 0x36E4, 0xF3CF},
1810 +       {0, 0x36E6, 0x6BD1},
1811 +       {0, 0x371E, 0xE42E},
1812 +       {0, 0x3720, 0x1D32},
1813 +       {0, 0x3722, 0xCC31},
1814 +       {0, 0x3724, 0xAE94},
1815 +       {0, 0x3726, 0x6413},
1816 +       {0, 0x375E, 0xE290},
1817 +       {0, 0x3760, 0x8F53},
1818 +       {0, 0x3762, 0xF936},
1819 +       {0, 0x3764, 0x4614},
1820 +       {0, 0x3766, 0x1B59},
1821 +       {0, 0x3784, 0x0404},
1822 +       {0, 0x3782, 0x0304},
1823 +       {0, 0x3210, 0x01B8},
1824 +       {0, 0x098E, 0xC913},
1825 +       {0, 0x0990, 0x000A},
1826 +       {0, 0x098E, 0x686B},
1827 +       {0, 0x0990, 0x05DC},
1828 +       {0, 0x098E, 0x686D},
1829 +       {0, 0x0990, 0x0BB8},
1830 +       {0, 0x098E, 0x6C6B},
1831 +       {0, 0x0990, 0x05DC},
1832 +       {0, 0x098E, 0x6C6D},
1833 +       {0, 0x0990, 0x0BB8},
1834 +       {0, 0x098E, 0x3439},
1835 +       {0, 0x0990, 0x05DC},
1836 +       {0, 0x098E, 0x343B},
1837 +       {0, 0x0990, 0x0BB8},
1838 +       {0, 0x098E, 0x4926},
1839 +       {0, 0x0990, 0x0001},
1840 +       {0, 0x098E, 0x4928},
1841 +       {0, 0x0990, 0x0002},
1842 +       {0, 0x098E, 0x492A},
1843 +       {0, 0x0990, 0x0656},
1844 +       {0, 0x098E, 0x4D26},
1845 +       {0, 0x0990, 0x0001},
1846 +       {0, 0x098E, 0x4D28},
1847 +       {0, 0x0990, 0x0002},
1848 +       {0, 0x098E, 0x4D2A},
1849 +       {0, 0x0990, 0x0656},
1850 +       {0, 0x33F4, 0x040B},
1851 +       {0, 0x098E, 0xC916},
1852 +       {0, 0x0990, 0x0014},
1853 +       {0, 0x098E, 0xC919},
1854 +       {0, 0x0990, 0x0028},
1855 +       {0, 0x098E, 0xC917},
1856 +       {0, 0x0990, 0x0004},
1857 +       {0, 0x098E, 0xC918},
1858 +       {0, 0x0990, 0x0000},
1859 +       {0, 0x098E, 0xC91A},
1860 +       {0, 0x0990, 0x0001},
1861 +       {0, 0x098E, 0xC91B},
1862 +       {0, 0x0990, 0x0009},
1863 +       {0, 0x326C, 0x0C00},
1864 +       {0, 0x098E, 0x494B},
1865 +       {0, 0x0990, 0x0042},
1866 +       {0, 0x098E, 0x494D},
1867 +       {0, 0x0990, 0x012C},
1868 +       {0, 0x098E, 0xC91E},
1869 +       {0, 0x0990, 0x0012},
1870 +       {0, 0x098E, 0xC91F},
1871 +       {0, 0x0990, 0x000A},
1872 +       {0, 0x098E, 0xC920},
1873 +       {0, 0x0990, 0x0012},
1874 +       {0, 0x098E, 0xC921},
1875 +       {0, 0x0990, 0x000A},
1876 +       {0, 0x098E, 0xC922},
1877 +       {0, 0x0990, 0x0026},
1878 +       {0, 0x098E, 0xC923},
1879 +       {0, 0x0990, 0x001E},
1880 +       {0, 0x098E, 0xC924},
1881 +       {0, 0x0990, 0x0026},
1882 +       {0, 0x098E, 0xC925},
1883 +       {0, 0x0990, 0x0026},
1884 +       {0, 0x098E, 0xBC02},
1885 +       {0, 0x0990, 0x0003},
1886 +       {0, 0x098E, 0xBC05},
1887 +       {0, 0x0990, 0x000E},
1888 +       {0, 0x098E, 0xC950},
1889 +       {0, 0x0990, 0x0064},
1890 +       {0, 0x098E, 0xC94F},
1891 +       {0, 0x0990, 0x0038},
1892 +       {0, 0x098E, 0xC952},
1893 +       {0, 0x0990, 0x0064},
1894 +       {0, 0x098E, 0xC951},
1895 +       {0, 0x0990, 0x0051},
1896 +       {0, 0x098E, 0xC954},
1897 +       {0, 0x0990, 0x0010},
1898 +       {0, 0x098E, 0xC953},
1899 +       {0, 0x0990, 0x0020},
1900 +       {0, 0x098E, 0xC956},
1901 +       {0, 0x0990, 0x0010},
1902 +       {0, 0x098E, 0xC955},
1903 +       {0, 0x0990, 0x0020},
1904 +       {0, 0x098E, 0xC958},
1905 +       {0, 0x0990, 0x0020},
1906 +       {0, 0x098E, 0xC957},
1907 +       {0, 0x0990, 0x0014},
1908 +       {0, 0x098E, 0xC95A},
1909 +       {0, 0x0990, 0x001D},
1910 +       {0, 0x098E, 0xC959},
1911 +       {0, 0x0990, 0x0020},
1912 +       {0, 0x098E, 0xC95C},
1913 +       {0, 0x0990, 0x000C},
1914 +       {0, 0x098E, 0xC95B},
1915 +       {0, 0x0990, 0x0008},
1916 +       {0, 0x098E, 0xC95E},
1917 +       {0, 0x0990, 0x000C},
1918 +       {0, 0x098E, 0xC95D},
1919 +       {0, 0x0990, 0x0008},
1920 +       {0, 0x098E, 0xC95F},
1921 +       {0, 0x0990, 0x0064},
1922 +       {0, 0x098E, 0x48DC},
1923 +       {0, 0x0990, 0x004D},
1924 +       {0, 0x098E, 0x48DE},
1925 +       {0, 0x0990, 0x0096},
1926 +       {0, 0x098E, 0x48E0},
1927 +       {0, 0x0990, 0x001D},
1928 +       {0, 0x098E, 0x48E2},
1929 +       {0, 0x0990, 0x004D},
1930 +       {0, 0x098E, 0x48E4},
1931 +       {0, 0x0990, 0x0096},
1932 +       {0, 0x098E, 0x48E6},
1933 +       {0, 0x0990, 0x001D},
1934 +       {0, 0x098E, 0x48E8},
1935 +       {0, 0x0990, 0x004D},
1936 +       {0, 0x098E, 0x48EA},
1937 +       {0, 0x0990, 0x0096},
1938 +       {0, 0x098E, 0x48EC},
1939 +       {0, 0x0990, 0x001D},
1940 +       {0, 0x098E, 0xDC2A},
1941 +       {0, 0x0990, 0x000B},
1942 +       {0, 0x098E, 0xDC2B},
1943 +       {0, 0x0990, 0x0017},
1944 +       {0, 0x098E, 0xBC0B},
1945 +       {0, 0x0990, 0x0000},
1946 +       {0, 0x098E, 0xBC0C},
1947 +       {0, 0x0990, 0x001B},
1948 +       {0, 0x098E, 0xBC0D},
1949 +       {0, 0x0990, 0x002A},
1950 +       {0, 0x098E, 0xBC0E},
1951 +       {0, 0x0990, 0x003E},
1952 +       {0, 0x098E, 0xBC0F},
1953 +       {0, 0x0990, 0x005A},
1954 +       {0, 0x098E, 0xBC10},
1955 +       {0, 0x0990, 0x0070},
1956 +       {0, 0x098E, 0xBC11},
1957 +       {0, 0x0990, 0x0081},
1958 +       {0, 0x098E, 0xBC12},
1959 +       {0, 0x0990, 0x0090},
1960 +       {0, 0x098E, 0xBC13},
1961 +       {0, 0x0990, 0x009E},
1962 +       {0, 0x098E, 0xBC14},
1963 +       {0, 0x0990, 0x00AB},
1964 +       {0, 0x098E, 0xBC15},
1965 +       {0, 0x0990, 0x00B6},
1966 +       {0, 0x098E, 0xBC16},
1967 +       {0, 0x0990, 0x00C1},
1968 +       {0, 0x098E, 0xBC17},
1969 +       {0, 0x0990, 0x00CB},
1970 +       {0, 0x098E, 0xBC18},
1971 +       {0, 0x0990, 0x00D5},
1972 +       {0, 0x098E, 0xBC19},
1973 +       {0, 0x0990, 0x00DE},
1974 +       {0, 0x098E, 0xBC1A},
1975 +       {0, 0x0990, 0x00E7},
1976 +       {0, 0x098E, 0xBC1B},
1977 +       {0, 0x0990, 0x00EF},
1978 +       {0, 0x098E, 0xBC1C},
1979 +       {0, 0x0990, 0x00F7},
1980 +       {0, 0x098E, 0xBC1D},
1981 +       {0, 0x0990, 0x00FF},
1982 +       {0, 0x098E, 0xBC1E},
1983 +       {0, 0x0990, 0x0000},
1984 +       {0, 0x098E, 0xBC1F},
1985 +       {0, 0x0990, 0x001B},
1986 +       {0, 0x098E, 0xBC20},
1987 +       {0, 0x0990, 0x002A},
1988 +       {0, 0x098E, 0xBC21},
1989 +       {0, 0x0990, 0x003E},
1990 +       {0, 0x098E, 0xBC22},
1991 +       {0, 0x0990, 0x005A},
1992 +       {0, 0x098E, 0xBC23},
1993 +       {0, 0x0990, 0x0070},
1994 +       {0, 0x098E, 0xBC24},
1995 +       {0, 0x0990, 0x0081},
1996 +       {0, 0x098E, 0xBC25},
1997 +       {0, 0x0990, 0x0090},
1998 +       {0, 0x098E, 0xBC26},
1999 +       {0, 0x0990, 0x009E},
2000 +       {0, 0x098E, 0xBC27},
2001 +       {0, 0x0990, 0x00AB},
2002 +       {0, 0x098E, 0xBC28},
2003 +       {0, 0x0990, 0x00B6},
2004 +       {0, 0x098E, 0xBC29},
2005 +       {0, 0x0990, 0x00C1},
2006 +       {0, 0x098E, 0xBC2A},
2007 +       {0, 0x0990, 0x00CB},
2008 +       {0, 0x098E, 0xBC2B},
2009 +       {0, 0x0990, 0x00D5},
2010 +       {0, 0x098E, 0xBC2C},
2011 +       {0, 0x0990, 0x00DE},
2012 +       {0, 0x098E, 0xBC2D},
2013 +       {0, 0x0990, 0x00E7},
2014 +       {0, 0x098E, 0xBC2E},
2015 +       {0, 0x0990, 0x00EF},
2016 +       {0, 0x098E, 0xBC2F},
2017 +       {0, 0x0990, 0x00F7},
2018 +       {0, 0x098E, 0xBC30},
2019 +       {0, 0x0990, 0x00FF},
2020 +       {0, 0x098E, 0xBC31},
2021 +       {0, 0x0990, 0x0000},
2022 +       {0, 0x098E, 0xBC32},
2023 +       {0, 0x0990, 0x000D},
2024 +       {0, 0x098E, 0xBC33},
2025 +       {0, 0x0990, 0x0019},
2026 +       {0, 0x098E, 0xBC34},
2027 +       {0, 0x0990, 0x0030},
2028 +       {0, 0x098E, 0xBC35},
2029 +       {0, 0x0990, 0x0056},
2030 +       {0, 0x098E, 0xBC36},
2031 +       {0, 0x0990, 0x0070},
2032 +       {0, 0x098E, 0xBC37},
2033 +       {0, 0x0990, 0x0081},
2034 +       {0, 0x098E, 0xBC38},
2035 +       {0, 0x0990, 0x0090},
2036 +       {0, 0x098E, 0xBC39},
2037 +       {0, 0x0990, 0x009E},
2038 +       {0, 0x098E, 0xBC3A},
2039 +       {0, 0x0990, 0x00AB},
2040 +       {0, 0x098E, 0xBC3B},
2041 +       {0, 0x0990, 0x00B6},
2042 +       {0, 0x098E, 0xBC3C},
2043 +       {0, 0x0990, 0x00C1},
2044 +       {0, 0x098E, 0xBC3D},
2045 +       {0, 0x0990, 0x00CB},
2046 +       {0, 0x098E, 0xBC3E},
2047 +       {0, 0x0990, 0x00D5},
2048 +       {0, 0x098E, 0xBC3F},
2049 +       {0, 0x0990, 0x00DE},
2050 +       {0, 0x098E, 0xBC40},
2051 +       {0, 0x0990, 0x00E7},
2052 +       {0, 0x098E, 0xBC41},
2053 +       {0, 0x0990, 0x00EF},
2054 +       {0, 0x098E, 0xBC42},
2055 +       {0, 0x0990, 0x00F7},
2056 +       {0, 0x098E, 0xBC43},
2057 +       {0, 0x0990, 0x00FF},
2058 +       {0, 0x098E, 0x6865},
2059 +       {0, 0x0990, 0x00E0},
2060 +       {0, 0x098E, 0x6867},
2061 +       {0, 0x0990, 0x00F4},
2062 +       {0, 0x098E, 0x8400},
2063 +       {0, 0x0990, 0x0006},
2064 +       {0, 0x098E, 0xBC4A},
2065 +       {0, 0x0990, 0x007F},
2066 +       {0, 0x098E, 0xBC4B},
2067 +       {0, 0x0990, 0x007F},
2068 +       {0, 0x098E, 0xBC4C},
2069 +       {0, 0x0990, 0x007F},
2070 +       {0, 0x3542, 0x0010},
2071 +       {0, 0x3544, 0x0030},
2072 +       {0, 0x3546, 0x0040},
2073 +       {0, 0x3548, 0x0080},
2074 +       {0, 0x354A, 0x0100},
2075 +       {0, 0x354C, 0x0200},
2076 +       {0, 0x354E, 0x0300},
2077 +       {0, 0x3550, 0x0010},
2078 +       {0, 0x3552, 0x0030},
2079 +       {0, 0x3554, 0x0040},
2080 +       {0, 0x3556, 0x0080},
2081 +       {0, 0x3558, 0x012C},
2082 +       {0, 0x355A, 0x0320},
2083 +       {0, 0x355C, 0x03E8},
2084 +       {0, 0x3560, 0x0040},
2085 +       {0, 0x3562, 0x0020},
2086 +       {0, 0x3564, 0x0040},
2087 +       {0, 0x3566, 0x0010},
2088 +       {0, 0x3568, 0x0008},
2089 +       {0, 0x356A, 0x0004},
2090 +       {0, 0x356C, 0x0004},
2091 +       {0, 0x356E, 0x0004},
2092 +       {0, 0x098E, 0x3C4D},
2093 +       {0, 0x0990, 0x0DAC},
2094 +       {0, 0x098E, 0x3C4F},
2095 +       {0, 0x0990, 0x148A},
2096 +       {0, 0x098E, 0xC911},
2097 +       {0, 0x0990, 0x00C8},
2098 +       {0, 0x098E, 0xC8F4},
2099 +       {0, 0x0990, 0x0004},
2100 +       {0, 0x098E, 0xC8F5},
2101 +       {0, 0x0990, 0x0002},
2102 +       {0, 0x098E, 0x48F6},
2103 +       {0, 0x0990, 0x3B4D},
2104 +       {0, 0x098E, 0x48F8},
2105 +       {0, 0x0990, 0x6380},
2106 +       {0, 0x098E, 0x48FA},
2107 +       {0, 0x0990, 0x9B18},
2108 +       {0, 0x098E, 0x48FC},
2109 +       {0, 0x0990, 0x5D51},
2110 +       {0, 0x098E, 0x48FE},
2111 +       {0, 0x0990, 0xEDE8},
2112 +       {0, 0x098E, 0x4900},
2113 +       {0, 0x0990, 0xE515},
2114 +       {0, 0x098E, 0x4902},
2115 +       {0, 0x0990, 0xBFF4},
2116 +       {0, 0x098E, 0x4904},
2117 +       {0, 0x0990, 0x001E},
2118 +       {0, 0x098E, 0x4906},
2119 +       {0, 0x0990, 0x0026},
2120 +       {0, 0x098E, 0x4908},
2121 +       {0, 0x0990, 0x0033},
2122 +       {0, 0x098E, 0xE84A},
2123 +       {0, 0x0990, 0x0083},
2124 +       {0, 0x098E, 0xE84D},
2125 +       {0, 0x0990, 0x0083},
2126 +       {0, 0x098E, 0xE84C},
2127 +       {0, 0x0990, 0x0080},
2128 +       {0, 0x098E, 0xE84F},
2129 +       {0, 0x0990, 0x0080},
2130 +       {0, 0x098E, 0x8400},
2131 +       {0, 0x0990, 0x0006},
2132 +       {0, 0x098E, 0x48B0},
2133 +       {0, 0x0990, 0x0180},
2134 +       {0, 0x098E, 0x48B2},
2135 +       {0, 0x0990, 0xFF7A},
2136 +       {0, 0x098E, 0x48B4},
2137 +       {0, 0x0990, 0x0018},
2138 +       {0, 0x098E, 0x48B6},
2139 +       {0, 0x0990, 0xFFCA},
2140 +       {0, 0x098E, 0x48B8},
2141 +       {0, 0x0990, 0x017C},
2142 +       {0, 0x098E, 0x48BA},
2143 +       {0, 0x0990, 0xFFCC},
2144 +       {0, 0x098E, 0x48BC},
2145 +       {0, 0x0990, 0x000C},
2146 +       {0, 0x098E, 0x48BE},
2147 +       {0, 0x0990, 0xFF1F},
2148 +       {0, 0x098E, 0x48C0},
2149 +       {0, 0x0990, 0x01E8},
2150 +       {0, 0x098E, 0x48C2},
2151 +       {0, 0x0990, 0x0020},
2152 +       {0, 0x098E, 0x48C4},
2153 +       {0, 0x0990, 0x0044},
2154 +       {0, 0x098E, 0x48C6},
2155 +       {0, 0x0990, 0x0079},
2156 +       {0, 0x098E, 0x48C8},
2157 +       {0, 0x0990, 0xFFAD},
2158 +       {0, 0x098E, 0x48CA},
2159 +       {0, 0x0990, 0xFFE2},
2160 +       {0, 0x098E, 0x48CC},
2161 +       {0, 0x0990, 0x0033},
2162 +       {0, 0x098E, 0x48CE},
2163 +       {0, 0x0990, 0x002A},
2164 +       {0, 0x098E, 0x48D0},
2165 +       {0, 0x0990, 0xFFAA},
2166 +       {0, 0x098E, 0x48D2},
2167 +       {0, 0x0990, 0x0017},
2168 +       {0, 0x098E, 0x48D4},
2169 +       {0, 0x0990, 0x004B},
2170 +       {0, 0x098E, 0x48D6},
2171 +       {0, 0x0990, 0xFFA5},
2172 +       {0, 0x098E, 0x48D8},
2173 +       {0, 0x0990, 0x0015},
2174 +       {0, 0x098E, 0x48DA},
2175 +       {0, 0x0990, 0xFFE2},
2176 +       {0, 0x35A2, 0x0014},
2177 +       {0, 0x098E, 0xC949},
2178 +       {0, 0x0990, 0x0024},
2179 +       {0, 0x35A4, 0x0596},
2180 +       {0, 0x098E, 0xC94A},
2181 +       {0, 0x0990, 0x0062},
2182 +       {0, 0x098E, 0xC948},
2183 +       {0, 0x0990, 0x0006},
2184 +       {0, 0x098E, 0xC914},
2185 +       {0, 0x0990, 0x0000},
2186 +       {0, 0x098E, 0xC915},
2187 +       {0, 0x0990, 0x00FF},
2188 +       {0, 0x098E, 0xE86F},
2189 +       {0, 0x0990, 0x0060},
2190 +       {0, 0x098E, 0xE870},
2191 +       {0, 0x0990, 0x003C},
2192 +       {0, 0x098E, 0xEC6F},
2193 +       {0, 0x0990, 0x0060},
2194 +       {0, 0x098E, 0xEC70},
2195 +       {0, 0x0990, 0x003C},
2196 +       {0, 0x098E, 0xE883},
2197 +       {0, 0x0990, 0x0000},
2198 +       {0, 0x098E, 0xEC83},
2199 +       {0, 0x0990, 0x0000},
2200 +       {0, 0x098E, 0x8400},
2201 +       {0, 0x0990, 0x0006},
2202 +       {0, 0x098E, 0xE885},
2203 +       {0, 0x0990, 0x001E},
2204 +       {0, 0x098E, 0xE886},
2205 +       {0, 0x0990, 0x00D8},
2206 +       {0, 0x098E, 0xEC85},
2207 +       {0, 0x0990, 0x001E},
2208 +       {0, 0x098E, 0xEC86},
2209 +       {0, 0x0990, 0x00D8},
2210 +       {0, 0x098E, 0xE884},
2211 +       {0, 0x0990, 0x005C},
2212 +       {0, 0x098E, 0xEC84},
2213 +       {0, 0x0990, 0x005C},
2214 +       {0, 0x098E, 0x490A},
2215 +       {0, 0x0990, 0x0666},
2216 +       {0, 0x098E, 0x490C},
2217 +       {0, 0x0990, 0x0140},
2218 +       {0, 0x098E, 0x6857},
2219 +       {0, 0x0990, 0x0014},
2220 +       {0, 0x098E, 0x685C},
2221 +       {0, 0x0990, 0x0005},
2222 +       {0, 0x098E, 0x490E},
2223 +       {0, 0x0990, 0x00A4},
2224 +       {0, 0x098E, 0xB43D},
2225 +       {0, 0x0990, 0x0031},
2226 +       {0, 0x098E, 0xB43E},
2227 +       {0, 0x0990, 0x001B},
2228 +       {0, 0x098E, 0xB43F},
2229 +       {0, 0x0990, 0x0028},
2230 +       {0, 0x098E, 0xB440},
2231 +       {0, 0x0990, 0x0003},
2232 +       {0, 0x098E, 0xB441},
2233 +       {0, 0x0990, 0x00CD},
2234 +       {0, 0x098E, 0xB442},
2235 +       {0, 0x0990, 0x0064},
2236 +       {0, 0x098E, 0xB443},
2237 +       {0, 0x0990, 0x000F},
2238 +       {0, 0x098E, 0xB444},
2239 +       {0, 0x0990, 0x0007},
2240 +       {0, 0x098E, 0x300D},
2241 +       {0, 0x0990, 0x000F},
2242 +       {0, 0x098E, 0x3017},
2243 +       {0, 0x0990, 0x0F0F},
2244 +       {0, 0x098E, 0x8400},
2245 +       {0, 0x0990, 0x0006},
2246 +       {0, 0x098E, 0xE81F},
2247 +       {0, 0x0990, 0x0020},
2248 +       {0, 0x098E, 0x68A0},
2249 +       {0, 0x0990, 0x082E},
2250 +       {0, 0x098E, 0x6CA0},
2251 +       {0, 0x0990, 0x082E},
2252 +       {0, 0x098E, 0x70A0},
2253 +       {0, 0x0990, 0x082E},
2254 +       {0, 0x098E, 0x74A0},
2255 +       {0, 0x0990, 0x082E},
2256 +       {0, 0x3C52, 0x082E},
2257 +       {0, 0x098E, 0x488E},
2258 +       {0, 0x0990, 0x0020},
2259 +       {0, 0x098E, 0xECAC},
2260 +       {0, 0x0990, 0x0000}
2261 +};
2263 +mt9t111_regs def_regs2[] = {
2264 +       {100, 0x0018, 0x0028},
2265 +       {0, 0x316C, 0x350F},
2266 +       {0, 0x098E, 0x6817},
2267 +       {0, 0x0990, 0x000C},
2268 +       {0, 0x0034, 0x0000}
2269 +};
2271 +mt9t111_regs pll_regs1[] = {
2272 +       {0, 0x0014, 0x2425},
2273 +       {0, 0x0014, 0x2425},
2274 +       {0, 0x0014, 0x2145},
2275 +       {0, 0x0010, 0x0219},
2276 +       {0, 0x0012, 0x0090},
2277 +       {0, 0x002A, 0x79DD},
2278 +       {0, 0x0014, 0x2545},
2279 +       {0, 0x0014, 0x2547},
2280 +       {0, 0x0014, 0x3447},
2281 +       {0, 0x0014, 0x3047}
2282 +};
2284 +mt9t111_regs pll_regs2[] = {
2285 +       {0, 0x0014, 0x3046},
2286 +       {0, 0x0022, 0x01E0},
2287 +       {0, 0x001E, 0x0707},
2288 +       {0, 0x3B84, 0x011D}     
2289 +};
2291 +mt9t111_regs bayer_pattern_regs[] = {
2292 +       {0, 0x098E, 0x6807},
2293 +       {0, 0x0990, 0x0100},
2294 +       {0, 0x098E, 0x6809},
2295 +       {0, 0x0990, 0x0000},
2296 +       {0, 0x098E, 0xE88E},
2297 +       {0, 0x0990, 0x0000},
2298 +       {0, 0x098E, 0x6C07},
2299 +       {0, 0x0990, 0x0100},
2300 +       {0, 0x098E, 0x6C09},
2301 +       {0, 0x0990, 0x0000},
2302 +       {0, 0x098E, 0xEC8E},
2303 +       {0, 0x0990, 0x0000}
2304 +};
2306 +#endif
2307 diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
2308 new file mode 100644
2309 index 0000000..7acbeed
2310 --- /dev/null
2311 +++ b/include/media/mt9t111.h
2312 @@ -0,0 +1,79 @@
2313 +/*
2314 + * include/media/mt9t111.h
2315 + *
2316 + * mt9t111 sensor driver
2317 + *
2318 + * Copyright (C) 2009 Leopard Imaging
2319 + *
2320 + * This file is licensed under the terms of the GNU General Public License
2321 + * version 2. This program is licensed "as is" without any warranty of any
2322 + * kind, whether express or implied.
2323 + */
2325 +#ifndef        MT9T111_H
2326 +#define        MT9T111_H
2328 +/*********************************
2329 + * Defines and Macros and globals
2330 + ********************************/
2332 +#ifdef TRUE
2333 +#undef TRUE
2334 +#endif
2336 +#ifdef FALSE
2337 +#undef FALSE
2338 +#endif
2340 +#define        TRUE    1
2341 +#define        FALSE   0
2343 +#ifdef DEBUG
2344 +#undef DEBUG
2345 +#endif
2347 +#ifndef TYPES
2348 +#define TYPES
2349 +#endif
2351 +#define MT9T111_I2C_REGISTERED                 (1)
2352 +#define MT9T111_I2C_UNREGISTERED               (0)
2354 +/*i2c adress for MT9T111*/
2355 +#define MT9T111_I2C_ADDR               (0x78 >>1)
2357 +#define MT9T111_CLK_MAX        (75000000) /* 75MHz */
2358 +#define MT9T111_CLK_MIN        (6000000)  /* 6Mhz */
2360 +#define MT9T111_I2C_CONFIG             (1)
2361 +#define I2C_ONE_BYTE_TRANSFER          (1)
2362 +#define I2C_TWO_BYTE_TRANSFER          (2)
2363 +#define I2C_THREE_BYTE_TRANSFER                (3)
2364 +#define I2C_FOUR_BYTE_TRANSFER         (4)
2365 +#define I2C_TXRX_DATA_MASK             (0x00FF)
2366 +#define I2C_TXRX_DATA_MASK_UPPER       (0xFF00)
2367 +#define I2C_TXRX_DATA_SHIFT            (8)
2369 +struct mt9t111_platform_data {
2370 +       char *master;
2371 +       int (*power_set) (enum v4l2_power on);
2372 +       int (*ifparm) (struct v4l2_ifparm *p);
2373 +       int (*priv_data_set) (void *);
2374 +       /* Interface control params */
2375 +       bool clk_polarity;
2376 +       bool hs_polarity;
2377 +       bool vs_polarity;
2378 +};
2380 +/**
2381 + * struct capture_size - image capture size information
2382 + * @width: image width in pixels
2383 + * @height: image height in pixels
2384 + */
2385 +struct capture_size {
2386 +       unsigned long width;
2387 +       unsigned long height;
2388 +};
2390 +#endif                         /*for  ifndef MT9T111 */
2392 -- 
2393 1.6.6.1