2 * drivers/media/video/tcm825x.c
4 * TCM825X camera sensor driver.
6 * Copyright (C) 2007 Nokia Corporation.
8 * Contact: Sakari Ailus <sakari.ailus@nokia.com>
10 * Based on code from David Cohen <david.cohen@indt.org.br>
12 * This driver was based on ov9640 sensor driver from MontaVista
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * version 2 as published by the Free Software Foundation.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
29 #include <linux/i2c.h>
30 #include <media/v4l2-int-device.h>
35 * The sensor has two fps modes: the lower one just gives half the fps
36 * at the same xclk than the high one.
40 #define MAX_HALF_FPS (MAX_FPS / 2)
41 #define HIGH_FPS_MODE_LOWER_LIMIT 14
42 #define DEFAULT_FPS MAX_HALF_FPS
44 struct tcm825x_sensor {
45 const struct tcm825x_platform_data *platform_data;
46 struct v4l2_int_device *v4l2_int_device;
47 struct i2c_client *i2c_client;
48 struct v4l2_pix_format pix;
49 struct v4l2_fract timeperframe;
52 /* list of image formats supported by TCM825X sensor */
53 const static struct v4l2_fmtdesc tcm825x_formats[] = {
55 .description = "YUYV (YUV 4:2:2), packed",
56 .pixelformat = V4L2_PIX_FMT_UYVY,
58 /* Note: V4L2 defines RGB565 as:
61 * g2 g1 g0 r4 r3 r2 r1 r0 b4 b3 b2 b1 b0 g5 g4 g3
63 * We interpret RGB565 as:
66 * g2 g1 g0 b4 b3 b2 b1 b0 r4 r3 r2 r1 r0 g5 g4 g3
68 .description = "RGB565, le",
69 .pixelformat = V4L2_PIX_FMT_RGB565,
73 #define TCM825X_NUM_CAPTURE_FORMATS ARRAY_SIZE(tcm825x_formats)
76 * TCM825X register configuration for all combinations of pixel format and
79 const static struct tcm825x_reg subqcif = { 0x20, TCM825X_PICSIZ };
80 const static struct tcm825x_reg qcif = { 0x18, TCM825X_PICSIZ };
81 const static struct tcm825x_reg cif = { 0x14, TCM825X_PICSIZ };
82 const static struct tcm825x_reg qqvga = { 0x0c, TCM825X_PICSIZ };
83 const static struct tcm825x_reg qvga = { 0x04, TCM825X_PICSIZ };
84 const static struct tcm825x_reg vga = { 0x00, TCM825X_PICSIZ };
86 const static struct tcm825x_reg yuv422 = { 0x00, TCM825X_PICFMT };
87 const static struct tcm825x_reg rgb565 = { 0x02, TCM825X_PICFMT };
89 /* Our own specific controls */
90 #define V4L2_CID_ALC V4L2_CID_PRIVATE_BASE
91 #define V4L2_CID_H_EDGE_EN V4L2_CID_PRIVATE_BASE + 1
92 #define V4L2_CID_V_EDGE_EN V4L2_CID_PRIVATE_BASE + 2
93 #define V4L2_CID_LENS V4L2_CID_PRIVATE_BASE + 3
94 #define V4L2_CID_MAX_EXPOSURE_TIME V4L2_CID_PRIVATE_BASE + 4
95 #define V4L2_CID_LAST_PRIV V4L2_CID_MAX_EXPOSURE_TIME
98 static struct vcontrol {
99 struct v4l2_queryctrl qc;
102 } video_control[] = {
106 .type = V4L2_CTRL_TYPE_INTEGER,
117 .id = V4L2_CID_RED_BALANCE,
118 .type = V4L2_CTRL_TYPE_INTEGER,
119 .name = "Red Balance",
129 .id = V4L2_CID_BLUE_BALANCE,
130 .type = V4L2_CTRL_TYPE_INTEGER,
131 .name = "Blue Balance",
141 .id = V4L2_CID_AUTO_WHITE_BALANCE,
142 .type = V4L2_CTRL_TYPE_BOOLEAN,
143 .name = "Auto White Balance",
148 .reg = TCM825X_AWBSW,
153 .id = V4L2_CID_EXPOSURE,
154 .type = V4L2_CTRL_TYPE_INTEGER,
155 .name = "Exposure Time",
160 .reg = TCM825X_ESRSPD_U,
165 .id = V4L2_CID_HFLIP,
166 .type = V4L2_CTRL_TYPE_BOOLEAN,
167 .name = "Mirror Image",
172 .reg = TCM825X_H_INV,
177 .id = V4L2_CID_VFLIP,
178 .type = V4L2_CTRL_TYPE_BOOLEAN,
179 .name = "Vertical Flip",
184 .reg = TCM825X_V_INV,
187 /* Private controls */
191 .type = V4L2_CTRL_TYPE_BOOLEAN,
192 .name = "Auto Luminance Control",
197 .reg = TCM825X_ALCSW,
202 .id = V4L2_CID_H_EDGE_EN,
203 .type = V4L2_CTRL_TYPE_INTEGER,
204 .name = "Horizontal Edge Enhancement",
214 .id = V4L2_CID_V_EDGE_EN,
215 .type = V4L2_CTRL_TYPE_INTEGER,
216 .name = "Vertical Edge Enhancement",
227 .type = V4L2_CTRL_TYPE_INTEGER,
228 .name = "Lens Shading Compensation",
238 .id = V4L2_CID_MAX_EXPOSURE_TIME,
239 .type = V4L2_CTRL_TYPE_INTEGER,
240 .name = "Maximum Exposure Time",
245 .reg = TCM825X_ESRLIM,
251 const static struct tcm825x_reg *tcm825x_siz_reg[NUM_IMAGE_SIZES] =
252 { &subqcif, &qqvga, &qcif, &qvga, &cif, &vga };
254 const static struct tcm825x_reg *tcm825x_fmt_reg[NUM_PIXEL_FORMATS] =
255 { &yuv422, &rgb565 };
258 * Read a value from a register in an TCM825X sensor device. The value is
260 * Returns zero if successful, or non-zero otherwise.
262 static int tcm825x_read_reg(struct i2c_client *client, int reg)
265 struct i2c_msg msg[2];
266 u8 reg_buf, data_buf = 0;
268 if (!client->adapter)
271 msg[0].addr = client->addr;
274 msg[0].buf = ®_buf;
275 msg[1].addr = client->addr;
276 msg[1].flags = I2C_M_RD;
278 msg[1].buf = &data_buf;
282 err = i2c_transfer(client->adapter, msg, 2);
289 * Write a value to a register in an TCM825X sensor device.
290 * Returns zero if successful, or non-zero otherwise.
292 static int tcm825x_write_reg(struct i2c_client *client, u8 reg, u8 val)
295 struct i2c_msg msg[1];
296 unsigned char data[2];
298 if (!client->adapter)
301 msg->addr = client->addr;
307 err = i2c_transfer(client->adapter, msg, 1);
313 static int __tcm825x_write_reg_mask(struct i2c_client *client,
314 u8 reg, u8 val, u8 mask)
318 /* need to do read - modify - write */
319 rc = tcm825x_read_reg(client, reg);
323 rc &= (~mask); /* Clear the masked bits */
324 val &= mask; /* Enforce mask on value */
327 /* write the new value to the register */
328 rc = tcm825x_write_reg(client, reg, val);
335 #define tcm825x_write_reg_mask(client, regmask, val) \
336 __tcm825x_write_reg_mask(client, TCM825X_ADDR((regmask)), val, \
337 TCM825X_MASK((regmask)))
341 * Initialize a list of TCM825X registers.
342 * The list of registers is terminated by the pair of values
343 * { TCM825X_REG_TERM, TCM825X_VAL_TERM }.
344 * Returns zero if successful, or non-zero otherwise.
346 static int tcm825x_write_default_regs(struct i2c_client *client,
347 const struct tcm825x_reg *reglist)
350 const struct tcm825x_reg *next = reglist;
352 while (!((next->reg == TCM825X_REG_TERM)
353 && (next->val == TCM825X_VAL_TERM))) {
354 err = tcm825x_write_reg(client, next->reg, next->val);
356 dev_err(&client->dev, "register writing failed\n");
365 static struct vcontrol *find_vctrl(int id)
369 if (id < V4L2_CID_BASE)
372 for (i = 0; i < ARRAY_SIZE(video_control); i++)
373 if (video_control[i].qc.id == id)
374 return &video_control[i];
380 * Find the best match for a requested image capture size. The best match
381 * is chosen as the nearest match that has the same number or fewer pixels
382 * as the requested size, or the smallest image size if the requested size
383 * has fewer pixels than the smallest image.
385 static enum image_size tcm825x_find_size(struct v4l2_int_device *s,
389 enum image_size isize;
390 unsigned long pixels = width * height;
391 struct tcm825x_sensor *sensor = s->priv;
393 for (isize = subQCIF; isize < VGA; isize++) {
394 if (tcm825x_sizes[isize + 1].height
395 * tcm825x_sizes[isize + 1].width > pixels) {
396 dev_dbg(&sensor->i2c_client->dev, "size %d\n", isize);
402 dev_dbg(&sensor->i2c_client->dev, "format default VGA\n");
408 * Configure the TCM825X for current image size, pixel format, and
409 * frame period. fper is the frame period (in seconds) expressed as a
410 * fraction. Returns zero if successful, or non-zero otherwise. The
411 * actual frame period is returned in fper.
413 static int tcm825x_configure(struct v4l2_int_device *s)
415 struct tcm825x_sensor *sensor = s->priv;
416 struct v4l2_pix_format *pix = &sensor->pix;
417 enum image_size isize = tcm825x_find_size(s, pix->width, pix->height);
418 struct v4l2_fract *fper = &sensor->timeperframe;
419 enum pixel_format pfmt;
424 /* common register initialization */
425 err = tcm825x_write_default_regs(
426 sensor->i2c_client, sensor->platform_data->default_regs());
430 /* configure image size */
431 val = tcm825x_siz_reg[isize]->val;
432 dev_dbg(&sensor->i2c_client->dev,
433 "configuring image size %d\n", isize);
434 err = tcm825x_write_reg_mask(sensor->i2c_client,
435 tcm825x_siz_reg[isize]->reg, val);
439 /* configure pixel format */
440 switch (pix->pixelformat) {
442 case V4L2_PIX_FMT_RGB565:
445 case V4L2_PIX_FMT_UYVY:
450 dev_dbg(&sensor->i2c_client->dev,
451 "configuring pixel format %d\n", pfmt);
452 val = tcm825x_fmt_reg[pfmt]->val;
454 err = tcm825x_write_reg_mask(sensor->i2c_client,
455 tcm825x_fmt_reg[pfmt]->reg, val);
460 * For frame rate < 15, the FPS reg (addr 0x02, bit 7) must be
461 * set. Frame rate will be halved from the normal.
463 tgt_fps = fper->denominator / fper->numerator;
464 if (tgt_fps <= HIGH_FPS_MODE_LOWER_LIMIT) {
465 val = tcm825x_read_reg(sensor->i2c_client, 0x02);
467 tcm825x_write_reg(sensor->i2c_client, 0x02, val);
474 * Given the image capture format in pix, the nominal frame period in
475 * timeperframe, calculate the required xclk frequency.
477 * TCM825X input frequency characteristics are:
478 * Minimum 11.9 MHz, Typical 24.57 MHz and maximum 25/27 MHz
480 #define XCLK_MIN 11900000
481 #define XCLK_MAX 25000000
483 static int ioctl_g_ext_clk(struct v4l2_int_device *s, u32 *xclk)
485 struct tcm825x_sensor *sensor = s->priv;
486 struct v4l2_fract *timeperframe = &sensor->timeperframe;
487 u32 tgt_xclk; /* target xclk */
488 u32 tgt_fps; /* target frames per secound */
490 tgt_fps = timeperframe->denominator / timeperframe->numerator;
492 tgt_xclk = (tgt_fps <= HIGH_FPS_MODE_LOWER_LIMIT) ?
493 (2457 * tgt_fps) / MAX_HALF_FPS :
494 (2457 * tgt_fps) / MAX_FPS;
497 tgt_xclk = min(tgt_xclk, (u32)XCLK_MAX);
498 tgt_xclk = max(tgt_xclk, (u32)XCLK_MIN);
505 static int ioctl_s_ext_clk(struct v4l2_int_device *s, u32 xclk)
507 if (xclk > XCLK_MAX || xclk < XCLK_MIN)
513 static int ioctl_queryctrl(struct v4l2_int_device *s,
514 struct v4l2_queryctrl *qc)
516 struct vcontrol *control;
518 control = find_vctrl(qc->id);
528 static int ioctl_g_ctrl(struct v4l2_int_device *s,
529 struct v4l2_control *vc)
531 struct tcm825x_sensor *sensor = s->priv;
532 struct i2c_client *client = sensor->i2c_client;
534 struct vcontrol *lvc;
536 /* exposure time is special, spread accross 2 registers */
537 if (vc->id == V4L2_CID_EXPOSURE) {
538 int val_lower, val_upper;
540 val_upper = tcm825x_read_reg(client,
541 TCM825X_ADDR(TCM825X_ESRSPD_U));
544 val_lower = tcm825x_read_reg(client,
545 TCM825X_ADDR(TCM825X_ESRSPD_L));
549 vc->value = ((val_upper & 0x1f) << 8) | (val_lower);
553 lvc = find_vctrl(vc->id);
557 r = tcm825x_read_reg(client, TCM825X_ADDR(lvc->reg));
560 val = r & TCM825X_MASK(lvc->reg);
561 val >>= lvc->start_bit;
570 static int ioctl_s_ctrl(struct v4l2_int_device *s,
571 struct v4l2_control *vc)
573 struct tcm825x_sensor *sensor = s->priv;
574 struct i2c_client *client = sensor->i2c_client;
575 struct vcontrol *lvc;
578 /* exposure time is special, spread accross 2 registers */
579 if (vc->id == V4L2_CID_EXPOSURE) {
580 int val_lower, val_upper;
581 val_lower = val & TCM825X_MASK(TCM825X_ESRSPD_L);
582 val_upper = (val >> 8) & TCM825X_MASK(TCM825X_ESRSPD_U);
584 if (tcm825x_write_reg_mask(client,
585 TCM825X_ESRSPD_U, val_upper))
588 if (tcm825x_write_reg_mask(client,
589 TCM825X_ESRSPD_L, val_lower))
595 lvc = find_vctrl(vc->id);
599 val = val << lvc->start_bit;
600 if (tcm825x_write_reg_mask(client, lvc->reg, val))
606 static int ioctl_enum_fmt_cap(struct v4l2_int_device *s,
607 struct v4l2_fmtdesc *fmt)
609 int index = fmt->index;
612 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
613 if (index >= TCM825X_NUM_CAPTURE_FORMATS)
621 fmt->flags = tcm825x_formats[index].flags;
622 strlcpy(fmt->description, tcm825x_formats[index].description,
623 sizeof(fmt->description));
624 fmt->pixelformat = tcm825x_formats[index].pixelformat;
629 static int ioctl_try_fmt_cap(struct v4l2_int_device *s,
630 struct v4l2_format *f)
632 struct tcm825x_sensor *sensor = s->priv;
633 enum image_size isize;
635 struct v4l2_pix_format *pix = &f->fmt.pix;
637 isize = tcm825x_find_size(s, pix->width, pix->height);
638 dev_dbg(&sensor->i2c_client->dev, "isize = %d num_capture = %d\n",
639 isize, TCM825X_NUM_CAPTURE_FORMATS);
641 pix->width = tcm825x_sizes[isize].width;
642 pix->height = tcm825x_sizes[isize].height;
644 for (ifmt = 0; ifmt < TCM825X_NUM_CAPTURE_FORMATS; ifmt++)
645 if (pix->pixelformat == tcm825x_formats[ifmt].pixelformat)
648 if (ifmt == TCM825X_NUM_CAPTURE_FORMATS)
649 ifmt = 0; /* Default = YUV 4:2:2 */
651 pix->pixelformat = tcm825x_formats[ifmt].pixelformat;
652 pix->field = V4L2_FIELD_NONE;
653 pix->bytesperline = pix->width * TCM825X_BYTES_PER_PIXEL;
654 pix->sizeimage = pix->bytesperline * pix->height;
656 dev_dbg(&sensor->i2c_client->dev, "format = 0x%08x\n",
659 switch (pix->pixelformat) {
660 case V4L2_PIX_FMT_UYVY:
662 pix->colorspace = V4L2_COLORSPACE_JPEG;
664 case V4L2_PIX_FMT_RGB565:
665 pix->colorspace = V4L2_COLORSPACE_SRGB;
672 static int ioctl_s_fmt_cap(struct v4l2_int_device *s,
673 struct v4l2_format *f)
675 struct tcm825x_sensor *sensor = s->priv;
676 struct v4l2_pix_format *pix = &f->fmt.pix;
679 rval = ioctl_try_fmt_cap(s, f);
683 rval = tcm825x_configure(s);
690 static int ioctl_g_fmt_cap(struct v4l2_int_device *s,
691 struct v4l2_format *f)
693 struct tcm825x_sensor *sensor = s->priv;
695 f->fmt.pix = sensor->pix;
700 static int ioctl_g_parm(struct v4l2_int_device *s,
701 struct v4l2_streamparm *a)
703 struct tcm825x_sensor *sensor = s->priv;
704 struct v4l2_captureparm *cparm = &a->parm.capture;
706 if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
709 memset(a, 0, sizeof(*a));
710 a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
712 cparm->capability = V4L2_CAP_TIMEPERFRAME;
713 cparm->timeperframe = sensor->timeperframe;
718 static int ioctl_s_parm(struct v4l2_int_device *s,
719 struct v4l2_streamparm *a)
721 struct tcm825x_sensor *sensor = s->priv;
722 struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe;
723 u32 tgt_fps; /* target frames per secound */
726 if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
729 if ((timeperframe->numerator == 0)
730 || (timeperframe->denominator == 0)) {
731 timeperframe->denominator = DEFAULT_FPS;
732 timeperframe->numerator = 1;
735 tgt_fps = timeperframe->denominator / timeperframe->numerator;
737 if (tgt_fps > MAX_FPS) {
738 timeperframe->denominator = MAX_FPS;
739 timeperframe->numerator = 1;
740 } else if (tgt_fps < MIN_FPS) {
741 timeperframe->denominator = MIN_FPS;
742 timeperframe->numerator = 1;
745 sensor->timeperframe = *timeperframe;
747 rval = tcm825x_configure(s);
752 static int ioctl_s_power(struct v4l2_int_device *s, int on)
754 struct tcm825x_sensor *sensor = s->priv;
756 return sensor->platform_data->power_set(on);
759 static int ioctl_g_needs_reset(struct v4l2_int_device *s, void *buf)
761 struct tcm825x_sensor *sensor = s->priv;
763 return sensor->platform_data->needs_reset(s, buf, &sensor->pix);
766 static int ioctl_reset(struct v4l2_int_device *s)
771 static int ioctl_init(struct v4l2_int_device *s)
773 return tcm825x_configure(s);
776 static int ioctl_dev_exit(struct v4l2_int_device *s)
781 static int ioctl_dev_init(struct v4l2_int_device *s)
783 struct tcm825x_sensor *sensor = s->priv;
786 r = tcm825x_read_reg(sensor->i2c_client, 0x01);
790 dev_err(&sensor->i2c_client->dev, "device not detected\n");
796 #define NUM_IOCTLS 17
798 static struct v4l2_int_ioctl_desc tcm825x_ioctl_desc[NUM_IOCTLS] = {
799 { vidioc_int_dev_init_num,
800 (v4l2_int_ioctl_func *)&ioctl_dev_init },
801 { vidioc_int_dev_exit_num,
802 (v4l2_int_ioctl_func *)&ioctl_dev_exit },
803 { vidioc_int_s_power_num,
804 (v4l2_int_ioctl_func *)&ioctl_s_power },
805 { vidioc_int_g_ext_clk_num,
806 (v4l2_int_ioctl_func *)&ioctl_g_ext_clk },
807 { vidioc_int_s_ext_clk_num,
808 (v4l2_int_ioctl_func *)&ioctl_s_ext_clk },
809 { vidioc_int_g_needs_reset_num,
810 (v4l2_int_ioctl_func *)&ioctl_g_needs_reset },
811 { vidioc_int_reset_num,
812 (v4l2_int_ioctl_func *)&ioctl_reset },
813 { vidioc_int_init_num,
814 (v4l2_int_ioctl_func *)&ioctl_init },
815 { vidioc_int_enum_fmt_cap_num,
816 (v4l2_int_ioctl_func *)&ioctl_enum_fmt_cap },
817 { vidioc_int_try_fmt_cap_num,
818 (v4l2_int_ioctl_func *)&ioctl_try_fmt_cap },
819 { vidioc_int_g_fmt_cap_num,
820 (v4l2_int_ioctl_func *)&ioctl_g_fmt_cap },
821 { vidioc_int_s_fmt_cap_num,
822 (v4l2_int_ioctl_func *)&ioctl_s_fmt_cap },
823 { vidioc_int_g_parm_num,
824 (v4l2_int_ioctl_func *)&ioctl_g_parm },
825 { vidioc_int_s_parm_num,
826 (v4l2_int_ioctl_func *)&ioctl_s_parm },
827 { vidioc_int_queryctrl_num,
828 (v4l2_int_ioctl_func *)&ioctl_queryctrl },
829 { vidioc_int_g_ctrl_num,
830 (v4l2_int_ioctl_func *)&ioctl_g_ctrl },
831 { vidioc_int_s_ctrl_num,
832 (v4l2_int_ioctl_func *)&ioctl_s_ctrl },
835 static struct v4l2_int_slave tcm825x_slave = {
836 .ioctls = tcm825x_ioctl_desc,
837 .num_ioctls = ARRAY_SIZE(tcm825x_ioctl_desc),
840 static struct tcm825x_sensor tcm825x;
842 static struct v4l2_int_device tcm825x_int_device = {
843 .module = THIS_MODULE,
844 .name = TCM825X_NAME,
846 .type = v4l2_int_type_slave,
848 .slave = &tcm825x_slave,
852 static int tcm825x_probe(struct i2c_client *client)
854 struct tcm825x_sensor *sensor = &tcm825x;
857 if (i2c_get_clientdata(client))
860 sensor->platform_data = client->dev.platform_data;
862 if (sensor->platform_data == NULL
863 && !sensor->platform_data->is_okay())
866 sensor->v4l2_int_device = &tcm825x_int_device;
868 sensor->i2c_client = client;
869 i2c_set_clientdata(client, sensor);
871 /* Make the default capture format QVGA RGB565 */
872 sensor->pix.width = tcm825x_sizes[QVGA].width;
873 sensor->pix.height = tcm825x_sizes[QVGA].height;
874 sensor->pix.pixelformat = V4L2_PIX_FMT_RGB565;
876 rval = v4l2_int_device_register(sensor->v4l2_int_device);
878 i2c_set_clientdata(client, NULL);
883 static int __exit tcm825x_remove(struct i2c_client *client)
885 struct tcm825x_sensor *sensor = i2c_get_clientdata(client);
887 if (!client->adapter)
888 return -ENODEV; /* our client isn't attached */
890 v4l2_int_device_unregister(sensor->v4l2_int_device);
891 i2c_set_clientdata(client, NULL);
896 static struct i2c_driver tcm825x_i2c_driver = {
898 .name = TCM825X_NAME,
900 .probe = &tcm825x_probe,
901 .remove = __exit_p(&tcm825x_remove),
904 static struct tcm825x_sensor tcm825x = {
907 .denominator = DEFAULT_FPS,
911 static int __init tcm825x_init(void)
916 /* Just an experiment --- don't use *_cb functions yet. */
917 tcm825x_ioctl_desc[i++] = vidioc_int_dev_init_cb(&ioctl_dev_init);
918 BUG_ON(i >= NUM_IOCTLS);
920 rval = i2c_add_driver(&tcm825x_i2c_driver);
922 printk(KERN_INFO "%s: failed registering " TCM825X_NAME "\n",
928 static void __exit tcm825x_exit(void)
930 i2c_del_driver(&tcm825x_i2c_driver);
934 * FIXME: Menelaus isn't ready (?) at module_init stage, so use
935 * late_initcall for now.
937 late_initcall(tcm825x_init);
938 module_exit(tcm825x_exit);
940 MODULE_AUTHOR("Sakari Ailus <sakari.ailus@nokia.com>");
941 MODULE_DESCRIPTION("TCM825x camera sensor driver");
942 MODULE_LICENSE("GPL");