diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam')
77 files changed, 20509 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0001-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0001-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch new file mode 100644 index 00000000..bd4a7f88 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0001-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch @@ -0,0 +1,2394 @@ +From 4e23fe54d7f8ecc1c927d225b1b74e6b00e22997 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded User <oe@OE-builder.(none)> +Date: Tue, 9 Feb 2010 17:16:13 +0100 +Subject: [PATCH 01/75] mt9t111: first stab at merging sensor driver based on a patch by Leopard Imaging + +--- + drivers/media/video/Kconfig | 8 + + drivers/media/video/Makefile | 1 + + drivers/media/video/mt9t111.c | 883 ++++++++++++++++++++++++ + drivers/media/video/mt9t111_reg.h | 1364 +++++++++++++++++++++++++++++++++++++ + include/media/mt9t111.h | 79 +++ + 5 files changed, 2335 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/video/mt9t111.c + create mode 100644 drivers/media/video/mt9t111_reg.h + create mode 100644 include/media/mt9t111.h + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index 41e39a7..f67ed46 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -344,6 +344,14 @@ config VIDEO_MT9P012 + MT9P012 camera. It is currently working with the TI OMAP3 + camera controller. + ++config VIDEO_MT9T111 ++ tristate "Micron MT9T111 raw sensor driver (3MP)" ++ depends on I2C && VIDEO_V4L2 ++ ---help--- ++ This is a Video4Linux2 sensor-level driver for the Micron ++ MT9T111 camera. It is currently working with the TI OMAP3 ++ camera controller. ++ + config VIDEO_DW9710 + tristate "Lens driver for DW9710" + depends on I2C && VIDEO_V4L2 +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index 88e8ec1..31688bf 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -127,6 +127,7 @@ obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o + obj-y += isp/ + obj-$(CONFIG_VIDEO_OMAP3) += omap34xxcam.o + obj-$(CONFIG_VIDEO_MT9P012) += mt9p012.o ++obj-$(CONFIG_VIDEO_MT9T111) += mt9t111.o + obj-$(CONFIG_VIDEO_DW9710) += dw9710.o + obj-$(CONFIG_VIDEO_TPS61059) += tps61059.o + obj-$(CONFIG_VIDEO_OV3640) += ov3640.o +diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c +new file mode 100644 +index 0000000..ecc5115 +--- /dev/null ++++ b/drivers/media/video/mt9t111.c +@@ -0,0 +1,883 @@ ++/* ++ * drivers/media/video/mt9t111.c ++ * ++ * mt9t111 sensor driver ++ * ++ * Copyright (C) 2009 Leopard Imaging ++ * ++ * This file is licensed under the terms of the GNU General Public License ++ * version 2. This program is licensed "as is" without any warranty of any ++ * kind, whether express or implied. ++ */ ++ ++#include <linux/i2c.h> ++#include <linux/delay.h> ++#include <media/v4l2-int-device.h> ++ ++#include <media/mt9t111.h> ++#include "mt9t111_reg.h" ++ ++#define USE_RAW // YCbCr mode does not work yet ++//#define COLOR_BAR // Create a Color bar test pattern, Blue, Green, Red, Grey ++ ++#define SENSOR_DETECTED 1 ++#define SENSOR_NOT_DETECTED 0 ++ ++static void mt9t111_loaddefault(struct i2c_client *client); ++ ++/* ++* as a place holder for further development ++*/ ++static void debug_dummy(char *in_msg) ++{ ++ ++} ++ ++/* list of image formats supported by mt9t111 sensor */ ++const static struct v4l2_fmtdesc mt9t111_formats[] = { ++#ifdef USE_RAW ++ { ++ .description = "RAW ", ++ .pixelformat = V4L2_PIX_FMT_SGRBG10, ++ }, ++#else ++ { ++ .description = "YUV 422 ", ++ .pixelformat = V4L2_PIX_FMT_YUYV, ++ }, ++#endif ++}; ++ ++#define NUM_CAPTURE_FORMATS ARRAY_SIZE(mt9t111_formats) ++ ++/* ++ * Array of image sizes supported by MT9T111. These must be ordered from ++ * smallest image size to largest. ++ */ ++const static struct capture_size mt9t111_sizes[] = { ++ { 640, 480 }, ++// { 2048, 1536} ++}; ++ ++#define NUM_CAPTURE_SIZE ARRAY_SIZE(mt9t111_sizes) ++ ++ ++const struct v4l2_fract mt9t111_frameintervals[] = { ++ { .numerator = 1, .denominator = 10 } ++}; ++ ++#define NUM_CAPTURE_FRAMEINTERVALS ARRAY_SIZE(mt9t111_frameintervals) ++ ++/** ++ * struct mt9t111_sensor - main structure for storage of sensor information ++ * @pdata: access functions and data for platform level information ++ * @v4l2_int_device: V4L2 device structure structure ++ * @i2c_client: iic client device structure ++ * @pix: V4L2 pixel format information structure ++ * @timeperframe: time per frame expressed as V4L fraction ++ * @scaler: ++ * @ver: mt9t111 chip version ++ * @fps: frames per second value ++ */ ++struct mt9t111_sensor { ++ const struct mt9t111_platform_data *pdata; ++ struct v4l2_int_device *v4l2_int_device; ++ struct i2c_client *i2c_client; ++ struct v4l2_pix_format pix; ++ struct v4l2_fract timeperframe; ++ int scaler; ++ int ver; ++ int fps; ++ int state; ++}; ++ ++static struct mt9t111_sensor mt9t111 = { ++ .timeperframe = { ++ .numerator = 1, ++ .denominator = 10, ++ }, ++ .state = SENSOR_NOT_DETECTED, ++}; ++ ++/** ++ * mt9t111_read_reg - Read a value from a register in an mt9t111 sensor device ++ * @client: i2c driver client structure ++ * @data_length: length of data to be read ++ * @reg: register address / offset ++ * @val: stores the value that gets read ++ * ++ * Read a value from a register in an mt9t111 sensor device. ++ * The value is returned in 'val'. ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int ++mt9t111_read_reg(struct i2c_client *client, u16 reg, u16 *val) ++{ ++ struct i2c_msg msg[1]; ++ u8 data[4]; ++ int err; ++ ++ msg->addr = client->addr; ++ msg->flags = 0; ++ msg->len = 2; ++ msg->buf = data; ++ data[0] = (reg & 0xff00) >> 8; ++ data[1] = (reg & 0x00ff); ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err >= 0) { ++ msg->flags = I2C_M_RD; ++ msg->len = 2; /* 2 byte read */ ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err >= 0) { ++ *val = ((data[0] & 0x00ff) << 8) ++ | (data[1] & 0x00ff); ++ return 0; ++ } ++ } ++ return err; ++} ++ ++/** ++ * mt9t111_write_reg - Write a value to a register in an mt9t111 sensor device ++ * @client: i2c driver client structure ++ * @data_length: length of data to be read ++ * @reg: register address / offset ++ * @val: value to be written to specified register ++ * ++ * Write a value to a register in an mt9t111 sensor device. ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int ++mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val) ++{ ++ struct i2c_msg msg[1]; ++ u8 data[20]; ++ int err; ++ ++ msg->addr = client->addr; ++ msg->flags = 0; ++ msg->len = 4; ++ msg->buf = data; ++ data[0] = (u8)((reg & 0xff00) >> 8); ++ data[1] = (u8)(reg & 0x00ff); ++ data[2] = (u8)((val & 0xff00) >> 8); ++ data[3] = (u8)(val & 0x00ff); ++ err = i2c_transfer(client->adapter, msg, 1); ++ ++ return err; ++} ++ ++/** ++ * mt9t111_write_regs - Write registers to an mt9t111 sensor device ++ * @client: i2c driver client structure ++ * @reg_in: pointer to registers to write ++ * @cnt: the number of registers ++ * ++ * Write registers . ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int ++mt9t111_write_regs(struct i2c_client *client, mt9t111_regs *reg_in, int cnt) ++{ ++ int err = 0; ++ int i; ++ mt9t111_regs *reg = reg_in; ++ ++ for (i=0;i<cnt;i++) { ++ if (reg->delay_time == 0) { ++ err |= mt9t111_write_reg(client, reg->addr, reg->data); ++ } else if (reg->addr != 0 || reg->data != 0) { ++ err |= mt9t111_write_reg(client, reg->addr, reg->data); ++ mdelay(reg->delay_time); ++ } else ++ mdelay(reg->delay_time); ++ ++ if (err < 0) { ++ dev_warn(&client->dev, "write reg error, addr = 0x%x, data = 0x%x \n", \ ++ reg->addr, reg->data); ++ return err; ++ } ++ reg++; ++ } ++ return err; ++} ++ ++/** ++ * mt9t111_detect - Detect if an mt9t111 is present, and if so which revision ++ * @client: pointer to the i2c client driver structure ++ * ++ * Detect if an mt9t111 is present ++ * Returns a negative error number if no device is detected, or the ++ * non-negative value of the version ID register if a device is detected. ++ */ ++static int ++mt9t111_detect(struct i2c_client *client) ++{ ++ u16 val; ++ ++ /* chip ID is at address 0 */ ++ if (mt9t111_read_reg(client, MT9T111_CHIP_ID, &val) < 0) ++ return -ENODEV; ++ dev_info(&client->dev, "model id detected 0x%x\n", val); ++ ++ if (val != MT9T111_CHIP_ID_VALUE) { ++ dev_warn(&client->dev, "model id mismatch received 0x%x expecting 0x%x\n", ++ val, MT9T111_CHIP_ID_VALUE); ++ ++ return -ENODEV; ++ } ++ ++ return 0; ++ ++} ++ ++/** ++ * mt9t111_configure - Configure the mt9t111 for the specified image mode ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Configure the mt9t111 for a specified image size, pixel format, and frame ++ * period. xclk is the frequency (in Hz) of the xclk input to the mt9t111. ++ * fper is the frame period (in seconds) expressed as a fraction. ++ * Returns zero if successful, or non-zero otherwise. ++ * The actual frame period is returned in fper. ++ */ ++static int mt9t111_configure(struct v4l2_int_device *s) ++{ ++ debug_dummy("debug_dummy -- to set imager mode"); ++ ++ return 0; ++} ++ ++/** ++ * ioctl_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes ++ * @s: pointer to standard V4L2 device structure ++ * @frms: pointer to standard V4L2 framesizes enumeration structure ++ * ++ * Returns possible framesizes depending on choosen pixel format ++ **/ ++static int ioctl_enum_framesizes(struct v4l2_int_device *s, ++ struct v4l2_frmsizeenum *frms) ++{ ++ int ifmt; ++ ++ for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) { ++ if (frms->pixel_format == mt9t111_formats[ifmt].pixelformat) ++ break; ++ } ++ /* Is requested pixelformat not found on sensor? */ ++ if (ifmt == NUM_CAPTURE_FORMATS) ++ return -EINVAL; ++ ++ /* Do we already reached all discrete framesizes? */ ++ if (frms->index >= NUM_CAPTURE_SIZE) ++ return -EINVAL; ++ ++ frms->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frms->discrete.width = mt9t111_sizes[frms->index].width; ++ frms->discrete.height = mt9t111_sizes[frms->index].height; ++ ++ return 0; ++ ++} ++ ++static int ioctl_enum_frameintervals(struct v4l2_int_device *s, ++ struct v4l2_frmivalenum *frmi) ++{ ++ int ifmt; ++ ++printk(KERN_INFO "entering ioctl_enum_frameintervals\n"); ++printk(KERN_INFO "index = %d, pixel_format = 0x%x, width = %d, height = %d\n", ++ frmi->index, frmi->pixel_format, frmi->width, frmi->height); ++printk(KERN_INFO "mt9t111 format = 0x%x\n", mt9t111_formats[0].pixelformat); ++ ++ if (frmi->index >= NUM_CAPTURE_FRAMEINTERVALS) ++ return -EINVAL; ++ ++ for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) { ++ if (frmi->pixel_format == mt9t111_formats[ifmt].pixelformat) ++ break; ++ } ++ /* Is requested pixelformat not found on sensor? */ ++ if (ifmt == NUM_CAPTURE_FORMATS) ++ return -EINVAL; ++ ++ frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frmi->discrete.numerator = ++ mt9t111_frameintervals[frmi->index].numerator; ++ frmi->discrete.denominator = ++ mt9t111_frameintervals[frmi->index].denominator; ++ return 0; ++} ++ ++/** ++ * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Initialize the sensor device (call mt9t111_configure()) ++ */ ++static int ioctl_init(struct v4l2_int_device *s) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_dev_exit - V4L2 sensor interface handler for vidioc_int_dev_exit_num ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Delinitialise the dev. at slave detach. The complement of ioctl_dev_init. ++ */ ++static int ioctl_dev_exit(struct v4l2_int_device *s) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Initialise the device when slave attaches to the master. Returns 0 if ++ * mt9t111 device could be found, otherwise returns appropriate error. ++ */ ++static int ioctl_dev_init(struct v4l2_int_device *s) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_s_power - V4L2 sensor interface handler for vidioc_int_s_power_num ++ * @s: pointer to standard V4L2 device structure ++ * @on: power state to which device is to be set ++ * ++ * Sets devices power state to requrested state, if possible. ++ */ ++static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ struct i2c_client *c = sensor->i2c_client; ++ int rval; ++ ++ if ((on == V4L2_POWER_STANDBY) && (sensor->state == SENSOR_DETECTED)) ++ debug_dummy("debug_dummy -- put to standby\n"); ++ ++ if (on != V4L2_POWER_ON) ++ debug_dummy("debug_dummy -- stop master clock\n"); ++ else ++ debug_dummy("debug_dummy -- enable clock\n");; ++ ++ rval = sensor->pdata->power_set(on); ++ if (rval < 0) { ++ dev_err(&c->dev, "Unable to set the power state: " "mt9t111" ++ " sensor\n"); ++ //sensor->pdata->set_xclk(0); ++ return rval; ++ } ++ ++ if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_DETECTED)) ++ mt9t111_configure(s); ++ ++ if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_NOT_DETECTED)) { ++ rval = mt9t111_detect(c); ++ if (rval < 0) { ++ dev_err(&c->dev, "Unable to detect " "mt9t111" ++ " sensor\n"); ++ sensor->state = SENSOR_NOT_DETECTED; ++ return rval; ++ } ++ mt9t111_loaddefault(c); ++ sensor->state = SENSOR_DETECTED; ++ sensor->ver = rval; ++ pr_info("mt9t111" " chip version 0x%02x detected\n", ++ sensor->ver); ++ } ++ return 0; ++} ++ ++/** ++ * ioctl_g_priv - V4L2 sensor interface handler for vidioc_int_g_priv_num ++ * @s: pointer to standard V4L2 device structure ++ * @p: void pointer to hold sensor's private data address ++ * ++ * Returns device's (sensor's) private data area address in p parameter ++ */ ++static int ioctl_g_priv(struct v4l2_int_device *s, void *p) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ ++ return sensor->pdata->priv_data_set(p); ++} ++ ++/** ++ * ioctl_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure ++ * ++ * Configures the sensor to use the input parameters, if possible. If ++ * not possible, reverts to the old parameters and returns the ++ * appropriate error code. ++ */ ++static int ioctl_s_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ //TODO: set paramters ++ debug_dummy("debug_dummy -- VIDIOC_S_PARM "); ++ return 0; ++} ++ ++/** ++ * ioctl_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure ++ * ++ * Returns the sensor's video CAPTURE parameters. ++ */ ++static int ioctl_g_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ struct v4l2_captureparm *cparm = &a->parm.capture; ++ ++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; ++ ++ memset(a, 0, sizeof(*a)); ++ a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ cparm->capability = V4L2_CAP_TIMEPERFRAME; ++ cparm->timeperframe = sensor->timeperframe; ++ ++ return 0; ++} ++ ++/** ++ * ioctl_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 v4l2_format structure ++ * ++ * Returns the sensor's current pixel format in the v4l2_format ++ * parameter. ++ */ ++static int ioctl_g_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ f->fmt.pix = sensor->pix; ++ ++ return 0; ++} ++ ++/** ++ * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure ++ * ++ * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This ++ * ioctl is used to negotiate the image capture size and pixel format ++ * without actually making it take effect. ++ */ ++static int ioctl_try_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ struct v4l2_pix_format *pix = &f->fmt.pix; ++ struct mt9t111_sensor *sensor = s->priv; ++ struct v4l2_pix_format *pix2 = &sensor->pix; ++ ++ pix->width = 640; ++ pix->height = 480; ++#ifdef USE_RAW ++ pix->pixelformat = V4L2_PIX_FMT_SGRBG10; ++ pix->bytesperline = pix->width; ++ pix->colorspace = V4L2_COLORSPACE_SRGB; ++#else ++ pix->pixelformat = V4L2_PIX_FMT_YUYV; ++ pix->bytesperline = pix->width * 2; ++ pix->colorspace = V4L2_COLORSPACE_JPEG; ++#endif ++ pix->field = V4L2_FIELD_NONE; ++ ++ pix->sizeimage = pix->bytesperline * pix->height; ++ pix->priv = 0; ++ *pix2 = *pix; ++ return 0; ++} ++ ++/** ++ * ioctl_s_fmt_cap - V4L2 sensor interface handler for VIDIOC_S_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure ++ * ++ * If the requested format is supported, configures the HW to use that ++ * format, returns error code if format not supported or HW can't be ++ * correctly configured. ++ */ ++static int ioctl_s_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ struct v4l2_pix_format *pix = &f->fmt.pix; ++ int rval; ++ ++ rval = ioctl_try_fmt_cap(s, f); ++ if (!rval) ++ sensor->pix = *pix; ++ ++ return rval; ++} ++ ++/** ++ * ioctl_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure ++ * ++ * Implement the VIDIOC_ENUM_FMT ioctl for the CAPTURE buffer type. ++ */ ++static int ioctl_enum_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_fmtdesc *fmt) ++{ ++ int index = fmt->index; ++ enum v4l2_buf_type type = fmt->type; ++ ++ memset(fmt, 0, sizeof(*fmt)); ++ fmt->index = index; ++ fmt->type = type; ++ ++ switch (fmt->type) { ++ case V4L2_BUF_TYPE_VIDEO_CAPTURE: ++ if (index >= NUM_CAPTURE_FORMATS) ++ return -EINVAL; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ fmt->flags = mt9t111_formats[index].flags; ++ strlcpy(fmt->description, mt9t111_formats[index].description, ++ sizeof(fmt->description)); ++ fmt->pixelformat = mt9t111_formats[index].pixelformat; ++ ++ return 0; ++} ++ ++/** ++ * ioctl_s_ctrl - V4L2 sensor interface handler for VIDIOC_S_CTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @vc: standard V4L2 VIDIOC_S_CTRL ioctl structure ++ * ++ * If the requested control is supported, sets the control's current ++ * value in HW (and updates the video_control[] array). Otherwise, ++ * returns -EINVAL if the control is not supported. ++ */ ++static int ioctl_s_ctrl(struct v4l2_int_device *s, ++ struct v4l2_control *vc) ++{ ++ debug_dummy("debug_dummy -- s ctrl\n"); ++ return 0; ++} ++ ++/** ++ * ioctl_g_ctrl - V4L2 sensor interface handler for VIDIOC_G_CTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @vc: standard V4L2 VIDIOC_G_CTRL ioctl structure ++ * ++ * If the requested control is supported, returns the control's current ++ * value from the video_control[] array. Otherwise, returns -EINVAL ++ * if the control is not supported. ++ */ ++static int ioctl_g_ctrl(struct v4l2_int_device *s, ++ struct v4l2_control *vc) ++{ ++ debug_dummy("debug_dummy -- g ctrl\n"); ++ return 0; ++} ++ ++/** ++ * ioctl_queryctrl - V4L2 sensor interface handler for VIDIOC_QUERYCTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @qc: standard V4L2 VIDIOC_QUERYCTRL ioctl structure ++ * ++ * If the requested control is supported, returns the control information ++ * from the video_control[] array. Otherwise, returns -EINVAL if the ++ * control is not supported. ++ */ ++static int ioctl_queryctrl(struct v4l2_int_device *s, ++ struct v4l2_queryctrl *qc) ++{ ++ debug_dummy("debug_dummy -- query ctrl\n"); ++ return-EINVAL; ++} ++ ++/** ++ * ioctl_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @index: number of the input ++ * ++ * If index is valid, selects the requested input. Otherwise, returns -EINVAL if ++ * the input is not supported or there is no active signal present in the ++ * selected input. ++ */ ++static int ioctl_s_routing(struct v4l2_int_device *s, ++ struct v4l2_routing *route) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_g_ifparm - V4L2 decoder interface handler for vidioc_int_g_ifparm_num ++ * @s: pointer to standard V4L2 device structure ++ * @p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure ++ * ++ * Gets slave interface parameters. ++ * Calculates the required xclk value to support the requested ++ * clock parameters in p. This value is returned in the p ++ * parameter. ++ */ ++static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ int rval; ++ ++ if (p == NULL) ++ return -EINVAL; ++ ++ if (NULL == sensor->pdata->ifparm) ++ return -EINVAL; ++ ++ rval = sensor->pdata->ifparm(p); ++ if (rval) { ++ v4l_err(sensor->i2c_client, "g_ifparm.Err[%d]\n", rval); ++ return rval; ++ } ++ ++ p->u.ycbcr.clock_curr = 40*1000000; // temporal value ++ ++ return 0; ++} ++ ++ ++static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = { ++ { .num = vidioc_int_enum_framesizes_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_enum_framesizes }, ++ { .num = vidioc_int_enum_frameintervals_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_enum_frameintervals }, ++ { .num = vidioc_int_dev_init_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_dev_init }, ++ { .num = vidioc_int_dev_exit_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_dev_exit }, ++ { .num = vidioc_int_s_power_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_s_power }, ++ { .num = vidioc_int_g_priv_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_g_priv }, ++ {vidioc_int_g_ifparm_num, ++ .func = (v4l2_int_ioctl_func*) ioctl_g_ifparm}, ++ { .num = vidioc_int_init_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_init }, ++ { .num = vidioc_int_enum_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_enum_fmt_cap }, ++ { .num = vidioc_int_try_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_try_fmt_cap }, ++ { .num = vidioc_int_g_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_g_fmt_cap }, ++ { .num = vidioc_int_s_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_s_fmt_cap }, ++ { .num = vidioc_int_g_parm_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_g_parm }, ++ { .num = vidioc_int_s_parm_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_s_parm }, ++ { .num = vidioc_int_queryctrl_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_queryctrl }, ++ { .num = vidioc_int_g_ctrl_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_g_ctrl }, ++ { .num = vidioc_int_s_ctrl_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_s_ctrl }, ++ {.num = vidioc_int_s_video_routing_num, ++ .func = (v4l2_int_ioctl_func *) ioctl_s_routing}, ++}; ++ ++static void mt9t111_refresh(struct i2c_client *client){ ++ int i; ++ unsigned short value; ++ // MCU_ADDRESS [SEQ_CMD] -- refresh ++ mt9t111_write_reg(client, 0x098E, 0x8400); ++ mt9t111_write_reg(client, 0x0990, 0x0006); ++ for (i=0;i<100;i++){ ++ mt9t111_write_reg(client, 0x098E, 0x8400); ++ mt9t111_read_reg(client,0x0990,&value); ++ if ( value == 0) ++ break; ++ mdelay(5); ++ } ++} ++ ++#ifdef COLOR_BAR ++static void mt9t111_color_bar(struct i2c_client *client) ++{ ++ mt9t111_write_reg(client, 0x3210, 0x01B0); // disable lens correction ++ ++ mt9t111_write_reg(client, 0x098E, 0x6003); ++ mt9t111_write_reg(client, 0x0990, 0x0100); ++ mt9t111_write_reg(client, 0x098E, 0x6025); ++ mt9t111_write_reg(client, 0x0990, 0x0003); ++} ++#endif ++ ++static void mt9t111_bayer_format(struct i2c_client *client) ++{ ++ mt9t111_write_regs(client, bayer_pattern_regs, sizeof(bayer_pattern_regs)/sizeof(mt9t111_regs)); ++} ++ ++static void mt9t111_enable_pll(struct i2c_client *client) ++{ ++ int i; ++ unsigned short value; ++ ++ mt9t111_write_regs(client, pll_regs1, sizeof(pll_regs1)/sizeof(mt9t111_regs)); ++ for (i=0;i<100;i++){ ++ mt9t111_read_reg(client,0x0014,&value); ++ if (( value & 0x8000) != 0) ++ break; ++ mdelay(2); ++ } ++ mt9t111_write_regs(client, pll_regs2, sizeof(pll_regs2)/sizeof(mt9t111_regs)); ++} ++ ++ ++static void mt9t111_loaddefault(struct i2c_client *client) ++{ ++ mt9t111_write_reg(client, 0x001A, 0x0219); ++ mt9t111_write_reg(client, 0x001A, 0x0218); ++ ++ mt9t111_enable_pll(client); ++ mt9t111_write_regs(client, def_regs1, sizeof(def_regs1)/sizeof(mt9t111_regs)); ++ mt9t111_write_regs(client, patch_rev6, sizeof(patch_rev6)/sizeof(mt9t111_regs)); ++ mt9t111_write_regs(client, def_regs2, sizeof(def_regs2)/sizeof(mt9t111_regs)); ++ ++#ifdef USE_RAW ++ mt9t111_bayer_format(client); ++#endif ++ ++#ifdef COLOR_BAR ++ mt9t111_color_bar(client); ++#endif ++ ++ mt9t111_refresh(client); ++} ++ ++static struct v4l2_int_slave mt9t111_slave = { ++ .ioctls = mt9t111_ioctl_desc, ++ .num_ioctls = ARRAY_SIZE(mt9t111_ioctl_desc), ++}; ++ ++static struct v4l2_int_device mt9t111_int_device = { ++ .module = THIS_MODULE, ++ .name = "mt9t111", ++ .priv = &mt9t111, ++ .type = v4l2_int_type_slave, ++ .u = { ++ .slave = &mt9t111_slave, ++ }, ++}; ++ ++/** ++ * mt9t111_probe - sensor driver i2c probe handler ++ * @client: i2c driver client device structure ++ * ++ * Register sensor as an i2c client device and V4L2 ++ * device. ++ */ ++static int ++mt9t111_probe(struct i2c_client *client, const struct i2c_device_id *id) ++{ ++ struct mt9t111_sensor *sensor = &mt9t111; ++ int err; ++ ++ if (i2c_get_clientdata(client)) ++ return -EBUSY; ++ ++ sensor->pdata = client->dev.platform_data; ++ ++ if (!sensor->pdata) { ++ dev_err(&client->dev, "no platform data?\n"); ++ return -ENODEV; ++ } ++ ++ sensor->v4l2_int_device = &mt9t111_int_device; ++ sensor->i2c_client = client; ++ ++ i2c_set_clientdata(client, sensor); ++ ++ sensor->pix.width = 640; ++ sensor->pix.height = 480; ++#ifdef USE_RAW ++ sensor->pix.pixelformat = V4L2_PIX_FMT_SGRBG10; ++#else ++ sensor->pix.pixelformat = V4L2_PIX_FMT_YUYV; ++#endif ++ err = v4l2_int_device_register(sensor->v4l2_int_device); ++ if (err) ++ i2c_set_clientdata(client, NULL); ++ return err; ++} ++ ++/** ++ * mt9t111_remove - sensor driver i2c remove handler ++ * @client: i2c driver client device structure ++ * ++ * Unregister sensor as an i2c client device and V4L2 ++ * device. Complement of mt9t111_probe(). ++ */ ++static int __exit ++mt9t111_remove(struct i2c_client *client) ++{ ++ struct mt9t111_sensor *sensor = i2c_get_clientdata(client); ++ ++ if (!client->adapter) ++ return -ENODEV; /* our client isn't attached */ ++ ++ v4l2_int_device_unregister(sensor->v4l2_int_device); ++ i2c_set_clientdata(client, NULL); ++ ++ return 0; ++} ++ ++static const struct i2c_device_id mt9t111_id[] = { ++ { "mt9t111", 0 }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(i2c, mt9t111_id); ++ ++static struct i2c_driver mt9t111sensor_i2c_driver = { ++ .driver = { ++ .name = "mt9t111", ++ .owner = THIS_MODULE, ++ }, ++ .probe = mt9t111_probe, ++ .remove = __exit_p(mt9t111_remove), ++ .id_table = mt9t111_id, ++}; ++ ++/** ++ * mt9t111sensor_init - sensor driver module_init handler ++ * ++ * Registers driver as an i2c client driver. Returns 0 on success, ++ * error code otherwise. ++ */ ++static int __init mt9t111sensor_init(void) ++{ ++printk(KERN_INFO "entering mt9t111sensor_init\n"); ++ return i2c_add_driver(&mt9t111sensor_i2c_driver); ++} ++module_init(mt9t111sensor_init); ++ ++/** ++ * mt9t111sensor_cleanup - sensor driver module_exit handler ++ * ++ * Unregisters/deletes driver as an i2c client driver. ++ * Complement of mt9t111sensor_init. ++ */ ++static void __exit mt9t111sensor_cleanup(void) ++{ ++ i2c_del_driver(&mt9t111sensor_i2c_driver); ++} ++module_exit(mt9t111sensor_cleanup); ++ ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("mt9t111 camera sensor driver"); +diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h +new file mode 100644 +index 0000000..e012eeb +--- /dev/null ++++ b/drivers/media/video/mt9t111_reg.h +@@ -0,0 +1,1364 @@ ++/* ++ * drivers/media/video/mt9t111_reg.h ++ * ++ * mt9t111 sensor driver header file ++ * ++ * Copyright (C) 2009 Leopard Imaging ++ * ++ * This file is licensed under the terms of the GNU General Public License ++ * version 2. This program is licensed "as is" without any warranty of any ++ * kind, whether express or implied. ++ */ ++ ++#ifndef MT9T111_REG_H ++#define MT9T111_REG_H ++ ++/* register addr */ ++#define MT9T111_CHIP_ID (0x0000) ++ ++/* register value */ ++#define MT9T111_CHIP_ID_VALUE (0x2680) ++ ++typedef struct { ++ u16 delay_time; ++ u16 addr; ++ u16 data; ++} mt9t111_regs; ++ ++mt9t111_regs patch_rev6[] ={ ++ {0, 0x0982, 0x0}, ++ {0, 0x098A, 0xCE7}, ++ {0, 0x0990, 0x3C3C}, ++ {0, 0x0992, 0x3C3C}, ++ {0, 0x0994, 0x3C5F}, ++ {0, 0x0996, 0x4F30}, ++ {0, 0x0998, 0xED08}, ++ {0, 0x099a, 0xBD61}, ++ {0, 0x099c, 0xD5CE}, ++ {0, 0x099e, 0x4CD}, ++ {0, 0x098A, 0xCF7}, ++ {0, 0x0990, 0x1F17}, ++ {0, 0x0992, 0x211}, ++ {0, 0x0994, 0xCC33}, ++ {0, 0x0996, 0x2E30}, ++ {0, 0x0998, 0xED02}, ++ {0, 0x099a, 0xCCFF}, ++ {0, 0x099c, 0xFDED}, ++ {0, 0x099e, 0xCC}, ++ {0, 0x098A, 0xD07}, ++ {0, 0x0990, 0x2}, ++ {0, 0x0992, 0xBD70}, ++ {0, 0x0994, 0x6D18}, ++ {0, 0x0996, 0xDE1F}, ++ {0, 0x0998, 0x181F}, ++ {0, 0x099a, 0x8E01}, ++ {0, 0x099c, 0x10CC}, ++ {0, 0x099e, 0x3C52}, ++ {0, 0x098A, 0xD17}, ++ {0, 0x0990, 0x30ED}, ++ {0, 0x0992, 0x18}, ++ {0, 0x0994, 0xECA0}, ++ {0, 0x0996, 0xC4FD}, ++ {0, 0x0998, 0xBD70}, ++ {0, 0x099a, 0x2120}, ++ {0, 0x099c, 0x1ECC}, ++ {0, 0x099e, 0x3C52}, ++ {0, 0x098A, 0xD27}, ++ {0, 0x0990, 0x30ED}, ++ {0, 0x0992, 0xDE}, ++ {0, 0x0994, 0x1FEC}, ++ {0, 0x0996, 0xA0BD}, ++ {0, 0x0998, 0x7021}, ++ {0, 0x099a, 0xCC3C}, ++ {0, 0x099c, 0x5230}, ++ {0, 0x099e, 0xED02}, ++ {0, 0x098A, 0xD37}, ++ {0, 0x0990, 0xCCFF}, ++ {0, 0x0992, 0xFCED}, ++ {0, 0x0994, 0xCC}, ++ {0, 0x0996, 0x2}, ++ {0, 0x0998, 0xBD70}, ++ {0, 0x099a, 0x6DFC}, ++ {0, 0x099c, 0x4E1}, ++ {0, 0x099e, 0x1A83}, ++ {0, 0x098A, 0xD47}, ++ {0, 0x0990, 0x1}, ++ {0, 0x0992, 0x2720}, ++ {0, 0x0994, 0x1A83}, ++ {0, 0x0996, 0x4}, ++ {0, 0x0998, 0x271E}, ++ {0, 0x099a, 0x1A83}, ++ {0, 0x099c, 0x8}, ++ {0, 0x099e, 0x271C}, ++ {0, 0x098A, 0xD57}, ++ {0, 0x0990, 0x1A83}, ++ {0, 0x0992, 0x10}, ++ {0, 0x0994, 0x271A}, ++ {0, 0x0996, 0x1A83}, ++ {0, 0x0998, 0x20}, ++ {0, 0x099a, 0x2718}, ++ {0, 0x099c, 0x1A83}, ++ {0, 0x099e, 0x40}, ++ {0, 0x098A, 0xD67}, ++ {0, 0x0990, 0x2716}, ++ {0, 0x0992, 0x2019}, ++ {0, 0x0994, 0xC61E}, ++ {0, 0x0996, 0x2012}, ++ {0, 0x0998, 0xC622}, ++ {0, 0x099a, 0x200E}, ++ {0, 0x099c, 0xC621}, ++ {0, 0x099e, 0x200A}, ++ {0, 0x098A, 0xD77}, ++ {0, 0x0990, 0xC620}, ++ {0, 0x0992, 0x2006}, ++ {0, 0x0994, 0xC62A}, ++ {0, 0x0996, 0x2002}, ++ {0, 0x0998, 0xC62B}, ++ {0, 0x099a, 0x30ED}, ++ {0, 0x099c, 0x8CC}, ++ {0, 0x099e, 0x3400}, ++ {0, 0x098A, 0xD87}, ++ {0, 0x0990, 0x30ED}, ++ {0, 0x0992, 0x34}, ++ {0, 0x0994, 0xBD6F}, ++ {0, 0x0996, 0xD184}, ++ {0, 0x0998, 0x330}, ++ {0, 0x099a, 0xED07}, ++ {0, 0x099c, 0xA60A}, ++ {0, 0x099e, 0x4848}, ++ {0, 0x098A, 0xD97}, ++ {0, 0x0990, 0x5FED}, ++ {0, 0x0992, 0x5EA}, ++ {0, 0x0994, 0x8AA}, ++ {0, 0x0996, 0x731}, ++ {0, 0x0998, 0xBD70}, ++ {0, 0x099a, 0x2130}, ++ {0, 0x099c, 0xC60A}, ++ {0, 0x099e, 0x3A35}, ++ {0, 0x098A, 0xDA7}, ++ {0, 0x0990, 0x3937}, ++ {0, 0x0992, 0x3C3C}, ++ {0, 0x0994, 0x3C34}, ++ {0, 0x0996, 0xDE2F}, ++ {0, 0x0998, 0xEE0E}, ++ {0, 0x099a, 0xAD00}, ++ {0, 0x099c, 0x7D13}, ++ {0, 0x099e, 0xEF27}, ++ {0, 0x098A, 0xDB7}, ++ {0, 0x0990, 0x7CCE}, ++ {0, 0x0992, 0x13E0}, ++ {0, 0x0994, 0x1E05}, ++ {0, 0x0996, 0x1060}, ++ {0, 0x0998, 0xE60E}, ++ {0, 0x099a, 0x4FC3}, ++ {0, 0x099c, 0x13F0}, ++ {0, 0x099e, 0x8FE6}, ++ {0, 0x098A, 0xDC7}, ++ {0, 0x0990, 0x30}, ++ {0, 0x0992, 0xE107}, ++ {0, 0x0994, 0x2216}, ++ {0, 0x0996, 0xF613}, ++ {0, 0x0998, 0xEE4F}, ++ {0, 0x099a, 0xC313}, ++ {0, 0x099c, 0xF38F}, ++ {0, 0x099e, 0xE600}, ++ {0, 0x098A, 0xDD7}, ++ {0, 0x0990, 0x30E1}, ++ {0, 0x0992, 0x725}, ++ {0, 0x0994, 0x7F6}, ++ {0, 0x0996, 0x13EE}, ++ {0, 0x0998, 0xC103}, ++ {0, 0x099a, 0x253C}, ++ {0, 0x099c, 0x7F13}, ++ {0, 0x099e, 0xEEF6}, ++ {0, 0x098A, 0xDE7}, ++ {0, 0x0990, 0x13EF}, ++ {0, 0x0992, 0xE706}, ++ {0, 0x0994, 0xCC13}, ++ {0, 0x0996, 0xF0ED}, ++ {0, 0x0998, 0x4CC}, ++ {0, 0x099a, 0x13F3}, ++ {0, 0x099c, 0x200F}, ++ {0, 0x099e, 0x7C13}, ++ {0, 0x098A, 0xDF7}, ++ {0, 0x0990, 0xEEEC}, ++ {0, 0x0992, 0x4C3}, ++ {0, 0x0994, 0x1}, ++ {0, 0x0996, 0xED04}, ++ {0, 0x0998, 0xEC02}, ++ {0, 0x099a, 0xC300}, ++ {0, 0x099c, 0x1ED}, ++ {0, 0x099e, 0x2F6}, ++ {0, 0x098A, 0xE07}, ++ {0, 0x0990, 0x13EE}, ++ {0, 0x0992, 0xE106}, ++ {0, 0x0994, 0x2412}, ++ {0, 0x0996, 0xEE04}, ++ {0, 0x0998, 0xE600}, ++ {0, 0x099a, 0x30E1}, ++ {0, 0x099c, 0x722}, ++ {0, 0x099e, 0xDFEE}, ++ {0, 0x098A, 0xE17}, ++ {0, 0x0990, 0x2E6}, ++ {0, 0x0992, 0x30}, ++ {0, 0x0994, 0xE107}, ++ {0, 0x0996, 0x25D6}, ++ {0, 0x0998, 0xDE49}, ++ {0, 0x099a, 0xEE08}, ++ {0, 0x099c, 0xAD00}, ++ {0, 0x099e, 0xCC13}, ++ {0, 0x098A, 0xE27}, ++ {0, 0x0990, 0xF630}, ++ {0, 0x0992, 0xED00}, ++ {0, 0x0994, 0xDE2F}, ++ {0, 0x0996, 0xEE10}, ++ {0, 0x0998, 0xCC13}, ++ {0, 0x099a, 0xFAAD}, ++ {0, 0x099c, 0x38}, ++ {0, 0x099e, 0x3838}, ++ {0, 0x098A, 0xE37}, ++ {0, 0x0990, 0x3839}, ++ {0, 0x098A, 0x1000}, ++ {0, 0x0990, 0xCC10}, ++ {0, 0x0992, 0x9BD}, ++ {0, 0x0994, 0x4224}, ++ {0, 0x0996, 0x7E10}, ++ {0, 0x0998, 0x9C6}, ++ {0, 0x099a, 0x1F7}, ++ {0, 0x099c, 0x18A}, ++ {0, 0x099e, 0xC606}, ++ {0, 0x098A, 0x1010}, ++ {0, 0x0990, 0xF701}, ++ {0, 0x0992, 0x8BDE}, ++ {0, 0x0994, 0x3F18}, ++ {0, 0x0996, 0xCE0B}, ++ {0, 0x0998, 0xF1CC}, ++ {0, 0x099a, 0x11}, ++ {0, 0x099c, 0xBDD7}, ++ {0, 0x099e, 0xCC}, ++ {0, 0x098A, 0x1020}, ++ {0, 0x0990, 0xBF1}, ++ {0, 0x0992, 0xDD3F}, ++ {0, 0x0994, 0xDE35}, ++ {0, 0x0996, 0x18CE}, ++ {0, 0x0998, 0xC03}, ++ {0, 0x099a, 0xCC00}, ++ {0, 0x099c, 0x3FBD}, ++ {0, 0x099e, 0xD700}, ++ {0, 0x098A, 0x1030}, ++ {0, 0x0990, 0xCC0C}, ++ {0, 0x0992, 0x3DD}, ++ {0, 0x0994, 0x35DE}, ++ {0, 0x0996, 0x4718}, ++ {0, 0x0998, 0xCE0C}, ++ {0, 0x099a, 0x43CC}, ++ {0, 0x099c, 0x15}, ++ {0, 0x099e, 0xBDD7}, ++ {0, 0x098A, 0x1040}, ++ {0, 0x0990, 0xCC}, ++ {0, 0x0992, 0xC43}, ++ {0, 0x0994, 0xDD47}, ++ {0, 0x0996, 0xFE00}, ++ {0, 0x0998, 0x3318}, ++ {0, 0x099a, 0xCE0C}, ++ {0, 0x099c, 0x59CC}, ++ {0, 0x099e, 0x9}, ++ {0, 0x098A, 0x1050}, ++ {0, 0x0990, 0xBDD7}, ++ {0, 0x0992, 0xCC}, ++ {0, 0x0994, 0xC59}, ++ {0, 0x0996, 0xFD00}, ++ {0, 0x0998, 0x33DE}, ++ {0, 0x099a, 0x4118}, ++ {0, 0x099c, 0xCE0C}, ++ {0, 0x099e, 0x63CC}, ++ {0, 0x098A, 0x1060}, ++ {0, 0x0990, 0xD}, ++ {0, 0x0992, 0xBDD7}, ++ {0, 0x0994, 0xCC}, ++ {0, 0x0996, 0xC63}, ++ {0, 0x0998, 0xDD41}, ++ {0, 0x099a, 0xFE00}, ++ {0, 0x099c, 0x3118}, ++ {0, 0x099e, 0xCE0C}, ++ {0, 0x098A, 0x1070}, ++ {0, 0x0990, 0x71CC}, ++ {0, 0x0992, 0x29}, ++ {0, 0x0994, 0xBDD7}, ++ {0, 0x0996, 0xCC}, ++ {0, 0x0998, 0xC71}, ++ {0, 0x099a, 0xFD00}, ++ {0, 0x099c, 0x31DE}, ++ {0, 0x099e, 0x3918}, ++ {0, 0x098A, 0x1080}, ++ {0, 0x0990, 0xCE0C}, ++ {0, 0x0992, 0x9BCC}, ++ {0, 0x0994, 0x23}, ++ {0, 0x0996, 0xBDD7}, ++ {0, 0x0998, 0xCC}, ++ {0, 0x099a, 0xC9B}, ++ {0, 0x099c, 0xDD39}, ++ {0, 0x099e, 0xDE49}, ++ {0, 0x098A, 0x1090}, ++ {0, 0x0990, 0x18CE}, ++ {0, 0x0992, 0xCBF}, ++ {0, 0x0994, 0xCC00}, ++ {0, 0x0996, 0xDBD}, ++ {0, 0x0998, 0xD700}, ++ {0, 0x099a, 0xCC0C}, ++ {0, 0x099c, 0xBFDD}, ++ {0, 0x099e, 0x49CC}, ++ {0, 0x098A, 0x10A0}, ++ {0, 0x0990, 0x1162}, ++ {0, 0x0992, 0xFD0B}, ++ {0, 0x0994, 0xFDCC}, ++ {0, 0x0996, 0xCE7}, ++ {0, 0x0998, 0xFD0C}, ++ {0, 0x099a, 0x1FCC}, ++ {0, 0x099c, 0x1245}, ++ {0, 0x099e, 0xFD0C}, ++ {0, 0x098A, 0x10B0}, ++ {0, 0x0990, 0x51CC}, ++ {0, 0x0992, 0x110B}, ++ {0, 0x0994, 0xFD0C}, ++ {0, 0x0996, 0x5BCC}, ++ {0, 0x0998, 0x1108}, ++ {0, 0x099a, 0xFD0C}, ++ {0, 0x099c, 0x65CC}, ++ {0, 0x099e, 0x10D0}, ++ {0, 0x098A, 0x10C0}, ++ {0, 0x0990, 0xFD0C}, ++ {0, 0x0992, 0x7BCC}, ++ {0, 0x0994, 0x12DE}, ++ {0, 0x0996, 0xFD0C}, ++ {0, 0x0998, 0xA7CC}, ++ {0, 0x099a, 0xDA8}, ++ {0, 0x099c, 0xFD0C}, ++ {0, 0x099e, 0xCB39}, ++ {0, 0x098A, 0x10D0}, ++ {0, 0x0990, 0x37DE}, ++ {0, 0x0992, 0x1DEC}, ++ {0, 0x0994, 0xC5F}, ++ {0, 0x0996, 0x8402}, ++ {0, 0x0998, 0x4416}, ++ {0, 0x099a, 0x4FF7}, ++ {0, 0x099c, 0xCCD}, ++ {0, 0x099e, 0xE60B}, ++ {0, 0x098A, 0x10E0}, ++ {0, 0x0990, 0xC407}, ++ {0, 0x0992, 0xF70C}, ++ {0, 0x0994, 0xCE7F}, ++ {0, 0x0996, 0x30C4}, ++ {0, 0x0998, 0xEC25}, ++ {0, 0x099a, 0xFD30}, ++ {0, 0x099c, 0xC5FC}, ++ {0, 0x099e, 0x6D6}, ++ {0, 0x098A, 0x10F0}, ++ {0, 0x0990, 0xFD30}, ++ {0, 0x0992, 0xC701}, ++ {0, 0x0994, 0xFC30}, ++ {0, 0x0996, 0xC0FD}, ++ {0, 0x0998, 0xBED}, ++ {0, 0x099a, 0xFC30}, ++ {0, 0x099c, 0xC2FD}, ++ {0, 0x099e, 0xBEF}, ++ {0, 0x098A, 0x1100}, ++ {0, 0x0990, 0x30E6}, ++ {0, 0x0992, 0xBD}, ++ {0, 0x0994, 0x5203}, ++ {0, 0x0996, 0x3139}, ++ {0, 0x0998, 0x7E9E}, ++ {0, 0x099a, 0x143C}, ++ {0, 0x099c, 0x3C3C}, ++ {0, 0x099e, 0x2101}, ++ {0, 0x098A, 0x1110}, ++ {0, 0x0990, 0xCC00}, ++ {0, 0x0992, 0x18BD}, ++ {0, 0x0994, 0x6FD1}, ++ {0, 0x0996, 0xC504}, ++ {0, 0x0998, 0x26F5}, ++ {0, 0x099a, 0xDC25}, ++ {0, 0x099c, 0x30ED}, ++ {0, 0x099e, 0x420}, ++ {0, 0x098A, 0x1120}, ++ {0, 0x0990, 0x12EE}, ++ {0, 0x0992, 0x43C}, ++ {0, 0x0994, 0x1838}, ++ {0, 0x0996, 0xE621}, ++ {0, 0x0998, 0x18E7}, ++ {0, 0x099a, 0xBE30}, ++ {0, 0x099c, 0xEE04}, ++ {0, 0x099e, 0xEC1D}, ++ {0, 0x098A, 0x1130}, ++ {0, 0x0990, 0x30ED}, ++ {0, 0x0992, 0x4EC}, ++ {0, 0x0994, 0x426}, ++ {0, 0x0996, 0xEACC}, ++ {0, 0x0998, 0x1A}, ++ {0, 0x099a, 0xED02}, ++ {0, 0x099c, 0xCCFB}, ++ {0, 0x099e, 0xFFED}, ++ {0, 0x098A, 0x1140}, ++ {0, 0x0990, 0xCC}, ++ {0, 0x0992, 0x400}, ++ {0, 0x0994, 0xBD70}, ++ {0, 0x0996, 0x6DCC}, ++ {0, 0x0998, 0x1A}, ++ {0, 0x099a, 0x30ED}, ++ {0, 0x099c, 0x2CC}, ++ {0, 0x099e, 0xFBFF}, ++ {0, 0x098A, 0x1150}, ++ {0, 0x0990, 0xED00}, ++ {0, 0x0992, 0x5F4F}, ++ {0, 0x0994, 0xBD70}, ++ {0, 0x0996, 0x6D5F}, ++ {0, 0x0998, 0xBD5B}, ++ {0, 0x099a, 0x17BD}, ++ {0, 0x099c, 0x558B}, ++ {0, 0x099e, 0x3838}, ++ {0, 0x098A, 0x1160}, ++ {0, 0x0990, 0x3839}, ++ {0, 0x0992, 0x3C3C}, ++ {0, 0x0994, 0xC640}, ++ {0, 0x0996, 0xF730}, ++ {0, 0x0998, 0xC4FC}, ++ {0, 0x099a, 0xBED}, ++ {0, 0x099c, 0xFD30}, ++ {0, 0x099e, 0xC0FC}, ++ {0, 0x098A, 0x1170}, ++ {0, 0x0990, 0xBEF}, ++ {0, 0x0992, 0xFD30}, ++ {0, 0x0994, 0xC2DE}, ++ {0, 0x0996, 0x1DEC}, ++ {0, 0x0998, 0x25FD}, ++ {0, 0x099a, 0x30C5}, ++ {0, 0x099c, 0x101}, ++ {0, 0x099e, 0x1FC}, ++ {0, 0x098A, 0x1180}, ++ {0, 0x0990, 0x30C2}, ++ {0, 0x0992, 0xFD06}, ++ {0, 0x0994, 0xD6EC}, ++ {0, 0x0996, 0xC5F}, ++ {0, 0x0998, 0x8402}, ++ {0, 0x099a, 0x4416}, ++ {0, 0x099c, 0x4F30}, ++ {0, 0x099e, 0xE703}, ++ {0, 0x098A, 0x1190}, ++ {0, 0x0990, 0xF10C}, ++ {0, 0x0992, 0xCD27}, ++ {0, 0x0994, 0x15F1}, ++ {0, 0x0996, 0xCCD}, ++ {0, 0x0998, 0x2309}, ++ {0, 0x099a, 0xFC06}, ++ {0, 0x099c, 0xD604}, ++ {0, 0x099e, 0xFD06}, ++ {0, 0x098A, 0x11A0}, ++ {0, 0x0990, 0xD620}, ++ {0, 0x0992, 0x7FC}, ++ {0, 0x0994, 0x6D6}, ++ {0, 0x0996, 0x5FD}, ++ {0, 0x0998, 0x6D6}, ++ {0, 0x099a, 0xDE1D}, ++ {0, 0x099c, 0xE60B}, ++ {0, 0x099e, 0xC407}, ++ {0, 0x098A, 0x11B0}, ++ {0, 0x0990, 0x30E7}, ++ {0, 0x0992, 0x2F1}, ++ {0, 0x0994, 0xCCE}, ++ {0, 0x0996, 0x272C}, ++ {0, 0x0998, 0x7D0C}, ++ {0, 0x099a, 0xCE27}, ++ {0, 0x099c, 0x275D}, ++ {0, 0x099e, 0x2724}, ++ {0, 0x098A, 0x11C0}, ++ {0, 0x0990, 0x7F30}, ++ {0, 0x0992, 0xC4FC}, ++ {0, 0x0994, 0x6D6}, ++ {0, 0x0996, 0xFD30}, ++ {0, 0x0998, 0xC5F6}, ++ {0, 0x099a, 0xCCE}, ++ {0, 0x099c, 0x4FFD}, ++ {0, 0x099e, 0x30C7}, ++ {0, 0x098A, 0x11D0}, ++ {0, 0x0990, 0xC640}, ++ {0, 0x0992, 0xF730}, ++ {0, 0x0994, 0xC4E6}, ++ {0, 0x0996, 0x24F}, ++ {0, 0x0998, 0xFD30}, ++ {0, 0x099a, 0xC501}, ++ {0, 0x099c, 0x101}, ++ {0, 0x099e, 0xFC30}, ++ {0, 0x098A, 0x11E0}, ++ {0, 0x0990, 0xC2FD}, ++ {0, 0x0992, 0x6D6}, ++ {0, 0x0994, 0x7D06}, ++ {0, 0x0996, 0xCB27}, ++ {0, 0x0998, 0x2EC6}, ++ {0, 0x099a, 0x40F7}, ++ {0, 0x099c, 0x30C4}, ++ {0, 0x099e, 0xFC06}, ++ {0, 0x098A, 0x11F0}, ++ {0, 0x0990, 0xC104}, ++ {0, 0x0992, 0xF306}, ++ {0, 0x0994, 0xD6ED}, ++ {0, 0x0996, 0x5F}, ++ {0, 0x0998, 0x6D00}, ++ {0, 0x099a, 0x2A01}, ++ {0, 0x099c, 0x5317}, ++ {0, 0x099e, 0xFD30}, ++ {0, 0x098A, 0x1200}, ++ {0, 0x0990, 0xC0EC}, ++ {0, 0x0992, 0xFD}, ++ {0, 0x0994, 0x30C2}, ++ {0, 0x0996, 0xFC06}, ++ {0, 0x0998, 0xC1FD}, ++ {0, 0x099a, 0x30C5}, ++ {0, 0x099c, 0x101}, ++ {0, 0x099e, 0x1FC}, ++ {0, 0x098A, 0x1210}, ++ {0, 0x0990, 0x30C2}, ++ {0, 0x0992, 0xFD06}, ++ {0, 0x0994, 0xC720}, ++ {0, 0x0996, 0x227F}, ++ {0, 0x0998, 0x30C4}, ++ {0, 0x099a, 0xDE1D}, ++ {0, 0x099c, 0xEC25}, ++ {0, 0x099e, 0xFD30}, ++ {0, 0x098A, 0x1220}, ++ {0, 0x0990, 0xC5FC}, ++ {0, 0x0992, 0x6D6}, ++ {0, 0x0994, 0xFD30}, ++ {0, 0x0996, 0xC701}, ++ {0, 0x0998, 0xFC30}, ++ {0, 0x099a, 0xC0FD}, ++ {0, 0x099c, 0x6D0}, ++ {0, 0x099e, 0xFC30}, ++ {0, 0x098A, 0x1230}, ++ {0, 0x0990, 0xC2FD}, ++ {0, 0x0992, 0x6D2}, ++ {0, 0x0994, 0xEC25}, ++ {0, 0x0996, 0xFD06}, ++ {0, 0x0998, 0xC3BD}, ++ {0, 0x099a, 0x953C}, ++ {0, 0x099c, 0xDE3F}, ++ {0, 0x099e, 0xEE10}, ++ {0, 0x098A, 0x1240}, ++ {0, 0x0990, 0xAD00}, ++ {0, 0x0992, 0x3838}, ++ {0, 0x0994, 0x3930}, ++ {0, 0x0996, 0x8FC3}, ++ {0, 0x0998, 0xFFE9}, ++ {0, 0x099a, 0x8F35}, ++ {0, 0x099c, 0xBDAD}, ++ {0, 0x099e, 0x1530}, ++ {0, 0x098A, 0x1250}, ++ {0, 0x0990, 0x6F16}, ++ {0, 0x0992, 0x18DE}, ++ {0, 0x0994, 0x1918}, ++ {0, 0x0996, 0x8FC3}, ++ {0, 0x0998, 0x14B}, ++ {0, 0x099a, 0x188F}, ++ {0, 0x099c, 0x18EC}, ++ {0, 0x099e, 0xFD}, ++ {0, 0x098A, 0x1260}, ++ {0, 0x0990, 0x50E}, ++ {0, 0x0992, 0x18EC}, ++ {0, 0x0994, 0x2FD}, ++ {0, 0x0996, 0x510}, ++ {0, 0x0998, 0xE616}, ++ {0, 0x099a, 0x4FED}, ++ {0, 0x099c, 0x418}, ++ {0, 0x099e, 0x8FC3}, ++ {0, 0x098A, 0x1270}, ++ {0, 0x0990, 0xFFCB}, ++ {0, 0x0992, 0xE304}, ++ {0, 0x0994, 0x8FE6}, ++ {0, 0x0996, 0xF7}, ++ {0, 0x0998, 0x514}, ++ {0, 0x099a, 0x18DE}, ++ {0, 0x099c, 0x1930}, ++ {0, 0x099e, 0xE616}, ++ {0, 0x098A, 0x1280}, ++ {0, 0x0990, 0x4FED}, ++ {0, 0x0992, 0x418}, ++ {0, 0x0994, 0x8FC3}, ++ {0, 0x0996, 0x119}, ++ {0, 0x0998, 0xE304}, ++ {0, 0x099a, 0x8FE6}, ++ {0, 0x099c, 0xF7}, ++ {0, 0x099e, 0x515}, ++ {0, 0x098A, 0x1290}, ++ {0, 0x0990, 0xFC05}, ++ {0, 0x0992, 0x5BFD}, ++ {0, 0x0994, 0x512}, ++ {0, 0x0996, 0xDE37}, ++ {0, 0x0998, 0xEE08}, ++ {0, 0x099a, 0xAD00}, ++ {0, 0x099c, 0x30E6}, ++ {0, 0x099e, 0x164F}, ++ {0, 0x098A, 0x12A0}, ++ {0, 0x0990, 0x5ED}, ++ {0, 0x0992, 0x48F}, ++ {0, 0x0994, 0xC300}, ++ {0, 0x0996, 0x630}, ++ {0, 0x0998, 0xE304}, ++ {0, 0x099a, 0x8FF6}, ++ {0, 0x099c, 0x516}, ++ {0, 0x099e, 0x4FED}, ++ {0, 0x098A, 0x12B0}, ++ {0, 0x0990, 0x30}, ++ {0, 0x0992, 0x6C16}, ++ {0, 0x0994, 0xE616}, ++ {0, 0x0996, 0xC103}, ++ {0, 0x0998, 0x2598}, ++ {0, 0x099a, 0xCC32}, ++ {0, 0x099c, 0x8EED}, ++ {0, 0x099e, 0xEC}, ++ {0, 0x098A, 0x12C0}, ++ {0, 0x0990, 0x6BD}, ++ {0, 0x0992, 0x7021}, ++ {0, 0x0994, 0xCC32}, ++ {0, 0x0996, 0x6C30}, ++ {0, 0x0998, 0xED02}, ++ {0, 0x099a, 0xCCF8}, ++ {0, 0x099c, 0xED}, ++ {0, 0x099e, 0xA6}, ++ {0, 0x098A, 0x12D0}, ++ {0, 0x0990, 0x9E3}, ++ {0, 0x0992, 0xA84}, ++ {0, 0x0994, 0x7BD}, ++ {0, 0x0996, 0x706D}, ++ {0, 0x0998, 0x30C6}, ++ {0, 0x099a, 0x173A}, ++ {0, 0x099c, 0x3539}, ++ {0, 0x099e, 0x3CBD}, ++ {0, 0x098A, 0x12E0}, ++ {0, 0x0990, 0x776D}, ++ {0, 0x0992, 0xCC32}, ++ {0, 0x0994, 0x5C30}, ++ {0, 0x0996, 0xED00}, ++ {0, 0x0998, 0xFC13}, ++ {0, 0x099a, 0x8683}, ++ {0, 0x099c, 0x1}, ++ {0, 0x099e, 0xBD70}, ++ {0, 0x098A, 0x12F0}, ++ {0, 0x0990, 0x21CC}, ++ {0, 0x0992, 0x325E}, ++ {0, 0x0994, 0x30ED}, ++ {0, 0x0996, 0xFC}, ++ {0, 0x0998, 0x1388}, ++ {0, 0x099a, 0x8300}, ++ {0, 0x099c, 0x1BD}, ++ {0, 0x099e, 0x7021}, ++ {0, 0x098A, 0x1300}, ++ {0, 0x0990, 0x3839}, ++ {0, 0x098E, 0x0010}, ++ {0, 0x0990, 0x1000}, ++ {0, 0x098E, 0x0003}, ++ {100, 0x0990, 0x0004} ++}; ++ ++mt9t111_regs def_regs1[] ={ ++ {0, 0x001A, 0x0218}, ++ {0, 0x001E, 0x0777}, ++ {0, 0x3084, 0x2409}, ++ {0, 0x3092, 0x0A49}, ++ {0, 0x3094, 0x4949}, ++ {0, 0x3096, 0x4950}, ++ {0, 0x0018, 0x402D}, ++ {100, 0x0018, 0x402C}, ++ {0, 0x098E, 0x6800}, ++ {0, 0x0990, 0x0280}, ++ {0, 0x098E, 0x6802}, ++ {0, 0x0990, 0x01E0}, ++ {0, 0x098E, 0xE88E}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x68A0}, ++ {0, 0x0990, 0x082D}, ++ {0, 0x098E, 0x4802}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x4804}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x4806}, ++ {0, 0x0990, 0x060D}, ++ {0, 0x098E, 0x4808}, ++ {0, 0x0990, 0x080D}, ++ {0, 0x098E, 0x480A}, ++ {0, 0x0990, 0x0111}, ++ {0, 0x098E, 0x480C}, ++ {0, 0x0990, 0x046C}, ++ {0, 0x098E, 0x480F}, ++ {0, 0x0990, 0x00CC}, ++ {0, 0x098E, 0x4811}, ++ {0, 0x0990, 0x0381}, ++ {0, 0x098E, 0x4813}, ++ {0, 0x0990, 0x024F}, ++ {0, 0x098E, 0x481D}, ++ {0, 0x0990, 0x05AE}, ++ {0, 0x098E, 0x481F}, ++ {0, 0x0990, 0x05D0}, ++ {0, 0x098E, 0x4825}, ++ {0, 0x0990, 0x07AC}, ++ {0, 0x098E, 0x6C00}, ++ {0, 0x0990, 0x0800}, ++ {0, 0x098E, 0x6C02}, ++ {0, 0x0990, 0x0600}, ++ {0, 0x098E, 0xEC8E}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x6CA0}, ++ {0, 0x0990, 0x082D}, ++ {0, 0x098E, 0x484A}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x484C}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x484E}, ++ {0, 0x0990, 0x060D}, ++ {0, 0x098E, 0x4850}, ++ {0, 0x0990, 0x080D}, ++ {0, 0x098E, 0x4852}, ++ {0, 0x0990, 0x0111}, ++ {0, 0x098E, 0x4854}, ++ {0, 0x0990, 0x146C}, ++ {0, 0x098E, 0x4857}, ++ {0, 0x0990, 0x00CC}, ++ {0, 0x098E, 0x4859}, ++ {0, 0x0990, 0x0381}, ++ {0, 0x098E, 0x485B}, ++ {0, 0x0990, 0x024F}, ++ {0, 0x098E, 0x4865}, ++ {0, 0x0990, 0x05AE}, ++ {0, 0x098E, 0x4867}, ++ {0, 0x0990, 0x05D0}, ++ {0, 0x098E, 0x486D}, ++ {0, 0x0990, 0x07AC}, ++ {0, 0x098E, 0xC8A5}, ++ {0, 0x0990, 0x001D}, ++ {0, 0x098E, 0xC8A6}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0xC8A7}, ++ {0, 0x0990, 0x0023}, ++ {0, 0x098E, 0xC8A8}, ++ {0, 0x0990, 0x0026}, ++ {0, 0x098E, 0xC844}, ++ {0, 0x0990, 0x0091}, ++ {0, 0x098E, 0xC92F}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xC845}, ++ {0, 0x0990, 0x0079}, ++ {0, 0x098E, 0xC92D}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xC88C}, ++ {0, 0x0990, 0x0091}, ++ {0, 0x098E, 0xC930}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xC88D}, ++ {0, 0x0990, 0x0079}, ++ {0, 0x098E, 0xC92E}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xA002}, ++ {0, 0x0990, 0x0010}, ++ {0, 0x098E, 0xA009}, ++ {0, 0x0990, 0x0002}, ++ {0, 0x098E, 0xA00A}, ++ {0, 0x0990, 0x0003}, ++ {0, 0x098E, 0xA00C}, ++ {0, 0x0990, 0x000A}, ++ {0, 0x098E, 0x4846}, ++ {0, 0x0990, 0x0014}, ++ {0, 0x098E, 0x68AA}, ++ {0, 0x0990, 0x0278}, ++ {0, 0x098E, 0x488E}, ++ {0, 0x0990, 0x0014}, ++ {0, 0x098E, 0x6CAA}, ++ {0, 0x0990, 0x0218}, ++ {0, 0x098E, 0x8400}, ++ {0, 0x0990, 0x0006}, ++ {0, 0x098E, 0x8400}, ++ {0, 0x0990, 0x0005}, ++ {0, 0x3C20, 0x0001}, ++ {0, 0x364A, 0x7D2F}, ++ {0, 0x364C, 0x79EB}, ++ {0, 0x364E, 0x18D2}, ++ {0, 0x3650, 0x9F8F}, ++ {0, 0x3652, 0xA7D2}, ++ {0, 0x368A, 0x460C}, ++ {0, 0x368C, 0x14F0}, ++ {0, 0x368E, 0x946F}, ++ {0, 0x3690, 0xC471}, ++ {0, 0x3692, 0x04B1}, ++ {0, 0x36CA, 0x0433}, ++ {0, 0x36CC, 0x680D}, ++ {0, 0x36CE, 0xEEF3}, ++ {0, 0x36D0, 0x4850}, ++ {0, 0x36D2, 0xF233}, ++ {0, 0x370A, 0xB2AF}, ++ {0, 0x370C, 0x2CF0}, ++ {0, 0x370E, 0x3F10}, ++ {0, 0x3710, 0xC673}, ++ {0, 0x3712, 0xA972}, ++ {0, 0x374A, 0x0590}, ++ {0, 0x374C, 0xAFB3}, ++ {0, 0x374E, 0x93D7}, ++ {0, 0x3750, 0x8D12}, ++ {0, 0x3752, 0x2539}, ++ {0, 0x3640, 0x0350}, ++ {0, 0x3642, 0x322C}, ++ {0, 0x3644, 0x77D1}, ++ {0, 0x3646, 0xA26F}, ++ {0, 0x3648, 0xC872}, ++ {0, 0x3680, 0x0C4C}, ++ {0, 0x3682, 0x9510}, ++ {0, 0x3684, 0x110E}, ++ {0, 0x3686, 0x4331}, ++ {0, 0x3688, 0xC1CF}, ++ {0, 0x36C0, 0x6152}, ++ {0, 0x36C2, 0x038E}, ++ {0, 0x36C4, 0x9AF4}, ++ {0, 0x36C6, 0xE12F}, ++ {0, 0x36C8, 0x09F3}, ++ {0, 0x3700, 0xC5AF}, ++ {0, 0x3702, 0xCA90}, ++ {0, 0x3704, 0x5D0F}, ++ {0, 0x3706, 0x3293}, ++ {0, 0x3708, 0x2B92}, ++ {0, 0x3740, 0xC590}, ++ {0, 0x3742, 0x8133}, ++ {0, 0x3744, 0xE0F6}, ++ {0, 0x3746, 0x0254}, ++ {0, 0x3748, 0x10B9}, ++ {0, 0x3654, 0x7F8F}, ++ {0, 0x3656, 0x6F6C}, ++ {0, 0x3658, 0x5971}, ++ {0, 0x365A, 0x9A0F}, ++ {0, 0x365C, 0xA1B2}, ++ {0, 0x3694, 0xB00C}, ++ {0, 0x3696, 0xEBCF}, ++ {0, 0x3698, 0x06AD}, ++ {0, 0x369A, 0x4D31}, ++ {0, 0x369C, 0x2A4E}, ++ {0, 0x36D4, 0x4752}, ++ {0, 0x36D6, 0x724D}, ++ {0, 0x36D8, 0xAD34}, ++ {0, 0x36DA, 0x1350}, ++ {0, 0x36DC, 0x4E94}, ++ {0, 0x3714, 0xA06E}, ++ {0, 0x3716, 0x9152}, ++ {0, 0x3718, 0x1F53}, ++ {0, 0x371A, 0x3933}, ++ {0, 0x371C, 0xBA94}, ++ {0, 0x3754, 0x1233}, ++ {0, 0x3756, 0xA032}, ++ {0, 0x3758, 0xE936}, ++ {0, 0x375A, 0xBE34}, ++ {0, 0x375C, 0x02D9}, ++ {0, 0x365E, 0x7DEF}, ++ {0, 0x3660, 0x434B}, ++ {0, 0x3662, 0x69F1}, ++ {0, 0x3664, 0x8A0F}, ++ {0, 0x3666, 0xBDB2}, ++ {0, 0x369E, 0x290D}, ++ {0, 0x36A0, 0x42CF}, ++ {0, 0x36A2, 0xDC6D}, ++ {0, 0x36A4, 0x91B1}, ++ {0, 0x36A6, 0x9DE9}, ++ {0, 0x36DE, 0x70B2}, ++ {0, 0x36E0, 0x02AC}, ++ {0, 0x36E2, 0x9714}, ++ {0, 0x36E4, 0xF3CF}, ++ {0, 0x36E6, 0x6BD1}, ++ {0, 0x371E, 0xE42E}, ++ {0, 0x3720, 0x1D32}, ++ {0, 0x3722, 0xCC31}, ++ {0, 0x3724, 0xAE94}, ++ {0, 0x3726, 0x6413}, ++ {0, 0x375E, 0xE290}, ++ {0, 0x3760, 0x8F53}, ++ {0, 0x3762, 0xF936}, ++ {0, 0x3764, 0x4614}, ++ {0, 0x3766, 0x1B59}, ++ {0, 0x3784, 0x0404}, ++ {0, 0x3782, 0x0304}, ++ {0, 0x3210, 0x01B8}, ++ {0, 0x098E, 0xC913}, ++ {0, 0x0990, 0x000A}, ++ {0, 0x098E, 0x686B}, ++ {0, 0x0990, 0x05DC}, ++ {0, 0x098E, 0x686D}, ++ {0, 0x0990, 0x0BB8}, ++ {0, 0x098E, 0x6C6B}, ++ {0, 0x0990, 0x05DC}, ++ {0, 0x098E, 0x6C6D}, ++ {0, 0x0990, 0x0BB8}, ++ {0, 0x098E, 0x3439}, ++ {0, 0x0990, 0x05DC}, ++ {0, 0x098E, 0x343B}, ++ {0, 0x0990, 0x0BB8}, ++ {0, 0x098E, 0x4926}, ++ {0, 0x0990, 0x0001}, ++ {0, 0x098E, 0x4928}, ++ {0, 0x0990, 0x0002}, ++ {0, 0x098E, 0x492A}, ++ {0, 0x0990, 0x0656}, ++ {0, 0x098E, 0x4D26}, ++ {0, 0x0990, 0x0001}, ++ {0, 0x098E, 0x4D28}, ++ {0, 0x0990, 0x0002}, ++ {0, 0x098E, 0x4D2A}, ++ {0, 0x0990, 0x0656}, ++ {0, 0x33F4, 0x040B}, ++ {0, 0x098E, 0xC916}, ++ {0, 0x0990, 0x0014}, ++ {0, 0x098E, 0xC919}, ++ {0, 0x0990, 0x0028}, ++ {0, 0x098E, 0xC917}, ++ {0, 0x0990, 0x0004}, ++ {0, 0x098E, 0xC918}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xC91A}, ++ {0, 0x0990, 0x0001}, ++ {0, 0x098E, 0xC91B}, ++ {0, 0x0990, 0x0009}, ++ {0, 0x326C, 0x0C00}, ++ {0, 0x098E, 0x494B}, ++ {0, 0x0990, 0x0042}, ++ {0, 0x098E, 0x494D}, ++ {0, 0x0990, 0x012C}, ++ {0, 0x098E, 0xC91E}, ++ {0, 0x0990, 0x0012}, ++ {0, 0x098E, 0xC91F}, ++ {0, 0x0990, 0x000A}, ++ {0, 0x098E, 0xC920}, ++ {0, 0x0990, 0x0012}, ++ {0, 0x098E, 0xC921}, ++ {0, 0x0990, 0x000A}, ++ {0, 0x098E, 0xC922}, ++ {0, 0x0990, 0x0026}, ++ {0, 0x098E, 0xC923}, ++ {0, 0x0990, 0x001E}, ++ {0, 0x098E, 0xC924}, ++ {0, 0x0990, 0x0026}, ++ {0, 0x098E, 0xC925}, ++ {0, 0x0990, 0x0026}, ++ {0, 0x098E, 0xBC02}, ++ {0, 0x0990, 0x0003}, ++ {0, 0x098E, 0xBC05}, ++ {0, 0x0990, 0x000E}, ++ {0, 0x098E, 0xC950}, ++ {0, 0x0990, 0x0064}, ++ {0, 0x098E, 0xC94F}, ++ {0, 0x0990, 0x0038}, ++ {0, 0x098E, 0xC952}, ++ {0, 0x0990, 0x0064}, ++ {0, 0x098E, 0xC951}, ++ {0, 0x0990, 0x0051}, ++ {0, 0x098E, 0xC954}, ++ {0, 0x0990, 0x0010}, ++ {0, 0x098E, 0xC953}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0xC956}, ++ {0, 0x0990, 0x0010}, ++ {0, 0x098E, 0xC955}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0xC958}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0xC957}, ++ {0, 0x0990, 0x0014}, ++ {0, 0x098E, 0xC95A}, ++ {0, 0x0990, 0x001D}, ++ {0, 0x098E, 0xC959}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0xC95C}, ++ {0, 0x0990, 0x000C}, ++ {0, 0x098E, 0xC95B}, ++ {0, 0x0990, 0x0008}, ++ {0, 0x098E, 0xC95E}, ++ {0, 0x0990, 0x000C}, ++ {0, 0x098E, 0xC95D}, ++ {0, 0x0990, 0x0008}, ++ {0, 0x098E, 0xC95F}, ++ {0, 0x0990, 0x0064}, ++ {0, 0x098E, 0x48DC}, ++ {0, 0x0990, 0x004D}, ++ {0, 0x098E, 0x48DE}, ++ {0, 0x0990, 0x0096}, ++ {0, 0x098E, 0x48E0}, ++ {0, 0x0990, 0x001D}, ++ {0, 0x098E, 0x48E2}, ++ {0, 0x0990, 0x004D}, ++ {0, 0x098E, 0x48E4}, ++ {0, 0x0990, 0x0096}, ++ {0, 0x098E, 0x48E6}, ++ {0, 0x0990, 0x001D}, ++ {0, 0x098E, 0x48E8}, ++ {0, 0x0990, 0x004D}, ++ {0, 0x098E, 0x48EA}, ++ {0, 0x0990, 0x0096}, ++ {0, 0x098E, 0x48EC}, ++ {0, 0x0990, 0x001D}, ++ {0, 0x098E, 0xDC2A}, ++ {0, 0x0990, 0x000B}, ++ {0, 0x098E, 0xDC2B}, ++ {0, 0x0990, 0x0017}, ++ {0, 0x098E, 0xBC0B}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xBC0C}, ++ {0, 0x0990, 0x001B}, ++ {0, 0x098E, 0xBC0D}, ++ {0, 0x0990, 0x002A}, ++ {0, 0x098E, 0xBC0E}, ++ {0, 0x0990, 0x003E}, ++ {0, 0x098E, 0xBC0F}, ++ {0, 0x0990, 0x005A}, ++ {0, 0x098E, 0xBC10}, ++ {0, 0x0990, 0x0070}, ++ {0, 0x098E, 0xBC11}, ++ {0, 0x0990, 0x0081}, ++ {0, 0x098E, 0xBC12}, ++ {0, 0x0990, 0x0090}, ++ {0, 0x098E, 0xBC13}, ++ {0, 0x0990, 0x009E}, ++ {0, 0x098E, 0xBC14}, ++ {0, 0x0990, 0x00AB}, ++ {0, 0x098E, 0xBC15}, ++ {0, 0x0990, 0x00B6}, ++ {0, 0x098E, 0xBC16}, ++ {0, 0x0990, 0x00C1}, ++ {0, 0x098E, 0xBC17}, ++ {0, 0x0990, 0x00CB}, ++ {0, 0x098E, 0xBC18}, ++ {0, 0x0990, 0x00D5}, ++ {0, 0x098E, 0xBC19}, ++ {0, 0x0990, 0x00DE}, ++ {0, 0x098E, 0xBC1A}, ++ {0, 0x0990, 0x00E7}, ++ {0, 0x098E, 0xBC1B}, ++ {0, 0x0990, 0x00EF}, ++ {0, 0x098E, 0xBC1C}, ++ {0, 0x0990, 0x00F7}, ++ {0, 0x098E, 0xBC1D}, ++ {0, 0x0990, 0x00FF}, ++ {0, 0x098E, 0xBC1E}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xBC1F}, ++ {0, 0x0990, 0x001B}, ++ {0, 0x098E, 0xBC20}, ++ {0, 0x0990, 0x002A}, ++ {0, 0x098E, 0xBC21}, ++ {0, 0x0990, 0x003E}, ++ {0, 0x098E, 0xBC22}, ++ {0, 0x0990, 0x005A}, ++ {0, 0x098E, 0xBC23}, ++ {0, 0x0990, 0x0070}, ++ {0, 0x098E, 0xBC24}, ++ {0, 0x0990, 0x0081}, ++ {0, 0x098E, 0xBC25}, ++ {0, 0x0990, 0x0090}, ++ {0, 0x098E, 0xBC26}, ++ {0, 0x0990, 0x009E}, ++ {0, 0x098E, 0xBC27}, ++ {0, 0x0990, 0x00AB}, ++ {0, 0x098E, 0xBC28}, ++ {0, 0x0990, 0x00B6}, ++ {0, 0x098E, 0xBC29}, ++ {0, 0x0990, 0x00C1}, ++ {0, 0x098E, 0xBC2A}, ++ {0, 0x0990, 0x00CB}, ++ {0, 0x098E, 0xBC2B}, ++ {0, 0x0990, 0x00D5}, ++ {0, 0x098E, 0xBC2C}, ++ {0, 0x0990, 0x00DE}, ++ {0, 0x098E, 0xBC2D}, ++ {0, 0x0990, 0x00E7}, ++ {0, 0x098E, 0xBC2E}, ++ {0, 0x0990, 0x00EF}, ++ {0, 0x098E, 0xBC2F}, ++ {0, 0x0990, 0x00F7}, ++ {0, 0x098E, 0xBC30}, ++ {0, 0x0990, 0x00FF}, ++ {0, 0x098E, 0xBC31}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xBC32}, ++ {0, 0x0990, 0x000D}, ++ {0, 0x098E, 0xBC33}, ++ {0, 0x0990, 0x0019}, ++ {0, 0x098E, 0xBC34}, ++ {0, 0x0990, 0x0030}, ++ {0, 0x098E, 0xBC35}, ++ {0, 0x0990, 0x0056}, ++ {0, 0x098E, 0xBC36}, ++ {0, 0x0990, 0x0070}, ++ {0, 0x098E, 0xBC37}, ++ {0, 0x0990, 0x0081}, ++ {0, 0x098E, 0xBC38}, ++ {0, 0x0990, 0x0090}, ++ {0, 0x098E, 0xBC39}, ++ {0, 0x0990, 0x009E}, ++ {0, 0x098E, 0xBC3A}, ++ {0, 0x0990, 0x00AB}, ++ {0, 0x098E, 0xBC3B}, ++ {0, 0x0990, 0x00B6}, ++ {0, 0x098E, 0xBC3C}, ++ {0, 0x0990, 0x00C1}, ++ {0, 0x098E, 0xBC3D}, ++ {0, 0x0990, 0x00CB}, ++ {0, 0x098E, 0xBC3E}, ++ {0, 0x0990, 0x00D5}, ++ {0, 0x098E, 0xBC3F}, ++ {0, 0x0990, 0x00DE}, ++ {0, 0x098E, 0xBC40}, ++ {0, 0x0990, 0x00E7}, ++ {0, 0x098E, 0xBC41}, ++ {0, 0x0990, 0x00EF}, ++ {0, 0x098E, 0xBC42}, ++ {0, 0x0990, 0x00F7}, ++ {0, 0x098E, 0xBC43}, ++ {0, 0x0990, 0x00FF}, ++ {0, 0x098E, 0x6865}, ++ {0, 0x0990, 0x00E0}, ++ {0, 0x098E, 0x6867}, ++ {0, 0x0990, 0x00F4}, ++ {0, 0x098E, 0x8400}, ++ {0, 0x0990, 0x0006}, ++ {0, 0x098E, 0xBC4A}, ++ {0, 0x0990, 0x007F}, ++ {0, 0x098E, 0xBC4B}, ++ {0, 0x0990, 0x007F}, ++ {0, 0x098E, 0xBC4C}, ++ {0, 0x0990, 0x007F}, ++ {0, 0x3542, 0x0010}, ++ {0, 0x3544, 0x0030}, ++ {0, 0x3546, 0x0040}, ++ {0, 0x3548, 0x0080}, ++ {0, 0x354A, 0x0100}, ++ {0, 0x354C, 0x0200}, ++ {0, 0x354E, 0x0300}, ++ {0, 0x3550, 0x0010}, ++ {0, 0x3552, 0x0030}, ++ {0, 0x3554, 0x0040}, ++ {0, 0x3556, 0x0080}, ++ {0, 0x3558, 0x012C}, ++ {0, 0x355A, 0x0320}, ++ {0, 0x355C, 0x03E8}, ++ {0, 0x3560, 0x0040}, ++ {0, 0x3562, 0x0020}, ++ {0, 0x3564, 0x0040}, ++ {0, 0x3566, 0x0010}, ++ {0, 0x3568, 0x0008}, ++ {0, 0x356A, 0x0004}, ++ {0, 0x356C, 0x0004}, ++ {0, 0x356E, 0x0004}, ++ {0, 0x098E, 0x3C4D}, ++ {0, 0x0990, 0x0DAC}, ++ {0, 0x098E, 0x3C4F}, ++ {0, 0x0990, 0x148A}, ++ {0, 0x098E, 0xC911}, ++ {0, 0x0990, 0x00C8}, ++ {0, 0x098E, 0xC8F4}, ++ {0, 0x0990, 0x0004}, ++ {0, 0x098E, 0xC8F5}, ++ {0, 0x0990, 0x0002}, ++ {0, 0x098E, 0x48F6}, ++ {0, 0x0990, 0x3B4D}, ++ {0, 0x098E, 0x48F8}, ++ {0, 0x0990, 0x6380}, ++ {0, 0x098E, 0x48FA}, ++ {0, 0x0990, 0x9B18}, ++ {0, 0x098E, 0x48FC}, ++ {0, 0x0990, 0x5D51}, ++ {0, 0x098E, 0x48FE}, ++ {0, 0x0990, 0xEDE8}, ++ {0, 0x098E, 0x4900}, ++ {0, 0x0990, 0xE515}, ++ {0, 0x098E, 0x4902}, ++ {0, 0x0990, 0xBFF4}, ++ {0, 0x098E, 0x4904}, ++ {0, 0x0990, 0x001E}, ++ {0, 0x098E, 0x4906}, ++ {0, 0x0990, 0x0026}, ++ {0, 0x098E, 0x4908}, ++ {0, 0x0990, 0x0033}, ++ {0, 0x098E, 0xE84A}, ++ {0, 0x0990, 0x0083}, ++ {0, 0x098E, 0xE84D}, ++ {0, 0x0990, 0x0083}, ++ {0, 0x098E, 0xE84C}, ++ {0, 0x0990, 0x0080}, ++ {0, 0x098E, 0xE84F}, ++ {0, 0x0990, 0x0080}, ++ {0, 0x098E, 0x8400}, ++ {0, 0x0990, 0x0006}, ++ {0, 0x098E, 0x48B0}, ++ {0, 0x0990, 0x0180}, ++ {0, 0x098E, 0x48B2}, ++ {0, 0x0990, 0xFF7A}, ++ {0, 0x098E, 0x48B4}, ++ {0, 0x0990, 0x0018}, ++ {0, 0x098E, 0x48B6}, ++ {0, 0x0990, 0xFFCA}, ++ {0, 0x098E, 0x48B8}, ++ {0, 0x0990, 0x017C}, ++ {0, 0x098E, 0x48BA}, ++ {0, 0x0990, 0xFFCC}, ++ {0, 0x098E, 0x48BC}, ++ {0, 0x0990, 0x000C}, ++ {0, 0x098E, 0x48BE}, ++ {0, 0x0990, 0xFF1F}, ++ {0, 0x098E, 0x48C0}, ++ {0, 0x0990, 0x01E8}, ++ {0, 0x098E, 0x48C2}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0x48C4}, ++ {0, 0x0990, 0x0044}, ++ {0, 0x098E, 0x48C6}, ++ {0, 0x0990, 0x0079}, ++ {0, 0x098E, 0x48C8}, ++ {0, 0x0990, 0xFFAD}, ++ {0, 0x098E, 0x48CA}, ++ {0, 0x0990, 0xFFE2}, ++ {0, 0x098E, 0x48CC}, ++ {0, 0x0990, 0x0033}, ++ {0, 0x098E, 0x48CE}, ++ {0, 0x0990, 0x002A}, ++ {0, 0x098E, 0x48D0}, ++ {0, 0x0990, 0xFFAA}, ++ {0, 0x098E, 0x48D2}, ++ {0, 0x0990, 0x0017}, ++ {0, 0x098E, 0x48D4}, ++ {0, 0x0990, 0x004B}, ++ {0, 0x098E, 0x48D6}, ++ {0, 0x0990, 0xFFA5}, ++ {0, 0x098E, 0x48D8}, ++ {0, 0x0990, 0x0015}, ++ {0, 0x098E, 0x48DA}, ++ {0, 0x0990, 0xFFE2}, ++ {0, 0x35A2, 0x0014}, ++ {0, 0x098E, 0xC949}, ++ {0, 0x0990, 0x0024}, ++ {0, 0x35A4, 0x0596}, ++ {0, 0x098E, 0xC94A}, ++ {0, 0x0990, 0x0062}, ++ {0, 0x098E, 0xC948}, ++ {0, 0x0990, 0x0006}, ++ {0, 0x098E, 0xC914}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xC915}, ++ {0, 0x0990, 0x00FF}, ++ {0, 0x098E, 0xE86F}, ++ {0, 0x0990, 0x0060}, ++ {0, 0x098E, 0xE870}, ++ {0, 0x0990, 0x003C}, ++ {0, 0x098E, 0xEC6F}, ++ {0, 0x0990, 0x0060}, ++ {0, 0x098E, 0xEC70}, ++ {0, 0x0990, 0x003C}, ++ {0, 0x098E, 0xE883}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xEC83}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x8400}, ++ {0, 0x0990, 0x0006}, ++ {0, 0x098E, 0xE885}, ++ {0, 0x0990, 0x001E}, ++ {0, 0x098E, 0xE886}, ++ {0, 0x0990, 0x00D8}, ++ {0, 0x098E, 0xEC85}, ++ {0, 0x0990, 0x001E}, ++ {0, 0x098E, 0xEC86}, ++ {0, 0x0990, 0x00D8}, ++ {0, 0x098E, 0xE884}, ++ {0, 0x0990, 0x005C}, ++ {0, 0x098E, 0xEC84}, ++ {0, 0x0990, 0x005C}, ++ {0, 0x098E, 0x490A}, ++ {0, 0x0990, 0x0666}, ++ {0, 0x098E, 0x490C}, ++ {0, 0x0990, 0x0140}, ++ {0, 0x098E, 0x6857}, ++ {0, 0x0990, 0x0014}, ++ {0, 0x098E, 0x685C}, ++ {0, 0x0990, 0x0005}, ++ {0, 0x098E, 0x490E}, ++ {0, 0x0990, 0x00A4}, ++ {0, 0x098E, 0xB43D}, ++ {0, 0x0990, 0x0031}, ++ {0, 0x098E, 0xB43E}, ++ {0, 0x0990, 0x001B}, ++ {0, 0x098E, 0xB43F}, ++ {0, 0x0990, 0x0028}, ++ {0, 0x098E, 0xB440}, ++ {0, 0x0990, 0x0003}, ++ {0, 0x098E, 0xB441}, ++ {0, 0x0990, 0x00CD}, ++ {0, 0x098E, 0xB442}, ++ {0, 0x0990, 0x0064}, ++ {0, 0x098E, 0xB443}, ++ {0, 0x0990, 0x000F}, ++ {0, 0x098E, 0xB444}, ++ {0, 0x0990, 0x0007}, ++ {0, 0x098E, 0x300D}, ++ {0, 0x0990, 0x000F}, ++ {0, 0x098E, 0x3017}, ++ {0, 0x0990, 0x0F0F}, ++ {0, 0x098E, 0x8400}, ++ {0, 0x0990, 0x0006}, ++ {0, 0x098E, 0xE81F}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0x68A0}, ++ {0, 0x0990, 0x082E}, ++ {0, 0x098E, 0x6CA0}, ++ {0, 0x0990, 0x082E}, ++ {0, 0x098E, 0x70A0}, ++ {0, 0x0990, 0x082E}, ++ {0, 0x098E, 0x74A0}, ++ {0, 0x0990, 0x082E}, ++ {0, 0x3C52, 0x082E}, ++ {0, 0x098E, 0x488E}, ++ {0, 0x0990, 0x0020}, ++ {0, 0x098E, 0xECAC}, ++ {0, 0x0990, 0x0000} ++}; ++ ++mt9t111_regs def_regs2[] = { ++ {100, 0x0018, 0x0028}, ++ {0, 0x316C, 0x350F}, ++ {0, 0x098E, 0x6817}, ++ {0, 0x0990, 0x000C}, ++ {0, 0x0034, 0x0000} ++}; ++ ++mt9t111_regs pll_regs1[] = { ++ {0, 0x0014, 0x2425}, ++ {0, 0x0014, 0x2425}, ++ {0, 0x0014, 0x2145}, ++ {0, 0x0010, 0x0219}, ++ {0, 0x0012, 0x0090}, ++ {0, 0x002A, 0x79DD}, ++ {0, 0x0014, 0x2545}, ++ {0, 0x0014, 0x2547}, ++ {0, 0x0014, 0x3447}, ++ {0, 0x0014, 0x3047} ++}; ++ ++mt9t111_regs pll_regs2[] = { ++ {0, 0x0014, 0x3046}, ++ {0, 0x0022, 0x01E0}, ++ {0, 0x001E, 0x0707}, ++ {0, 0x3B84, 0x011D} ++}; ++ ++mt9t111_regs bayer_pattern_regs[] = { ++ {0, 0x098E, 0x6807}, ++ {0, 0x0990, 0x0100}, ++ {0, 0x098E, 0x6809}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xE88E}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0x6C07}, ++ {0, 0x0990, 0x0100}, ++ {0, 0x098E, 0x6C09}, ++ {0, 0x0990, 0x0000}, ++ {0, 0x098E, 0xEC8E}, ++ {0, 0x0990, 0x0000} ++}; ++ ++#endif +diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h +new file mode 100644 +index 0000000..7acbeed +--- /dev/null ++++ b/include/media/mt9t111.h +@@ -0,0 +1,79 @@ ++/* ++ * include/media/mt9t111.h ++ * ++ * mt9t111 sensor driver ++ * ++ * Copyright (C) 2009 Leopard Imaging ++ * ++ * This file is licensed under the terms of the GNU General Public License ++ * version 2. This program is licensed "as is" without any warranty of any ++ * kind, whether express or implied. ++ */ ++ ++#ifndef MT9T111_H ++#define MT9T111_H ++ ++/********************************* ++ * Defines and Macros and globals ++ ********************************/ ++ ++#ifdef TRUE ++#undef TRUE ++#endif ++ ++#ifdef FALSE ++#undef FALSE ++#endif ++ ++#define TRUE 1 ++#define FALSE 0 ++ ++#ifdef DEBUG ++#undef DEBUG ++#endif ++ ++#ifndef TYPES ++#define TYPES ++#endif ++ ++#define MT9T111_I2C_REGISTERED (1) ++#define MT9T111_I2C_UNREGISTERED (0) ++ ++/*i2c adress for MT9T111*/ ++#define MT9T111_I2C_ADDR (0x78 >>1) ++ ++#define MT9T111_CLK_MAX (75000000) /* 75MHz */ ++#define MT9T111_CLK_MIN (6000000) /* 6Mhz */ ++ ++#define MT9T111_I2C_CONFIG (1) ++#define I2C_ONE_BYTE_TRANSFER (1) ++#define I2C_TWO_BYTE_TRANSFER (2) ++#define I2C_THREE_BYTE_TRANSFER (3) ++#define I2C_FOUR_BYTE_TRANSFER (4) ++#define I2C_TXRX_DATA_MASK (0x00FF) ++#define I2C_TXRX_DATA_MASK_UPPER (0xFF00) ++#define I2C_TXRX_DATA_SHIFT (8) ++ ++struct mt9t111_platform_data { ++ char *master; ++ int (*power_set) (enum v4l2_power on); ++ int (*ifparm) (struct v4l2_ifparm *p); ++ int (*priv_data_set) (void *); ++ /* Interface control params */ ++ bool clk_polarity; ++ bool hs_polarity; ++ bool vs_polarity; ++}; ++ ++/** ++ * struct capture_size - image capture size information ++ * @width: image width in pixels ++ * @height: image height in pixels ++ */ ++struct capture_size { ++ unsigned long width; ++ unsigned long height; ++}; ++ ++#endif /*for ifndef MT9T111 */ ++ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0002-mt9t111-Fix-all-checkpatch-errors.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0002-mt9t111-Fix-all-checkpatch-errors.patch new file mode 100644 index 00000000..4fa44f00 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0002-mt9t111-Fix-all-checkpatch-errors.patch @@ -0,0 +1,398 @@ +From 5609c8fe642a0517bd151ad477fcd05d0abc7dc4 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 11 Jun 2010 13:51:49 -0500 +Subject: [PATCH 02/75] mt9t111: Fix all checkpatch errors + +The code was plagued with checkpatch errors. Fix them! + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t111.c | 153 ++++++++++++++++++++----------------- + drivers/media/video/mt9t111_reg.h | 6 +- + include/media/mt9t111.h | 2 +- + 3 files changed, 87 insertions(+), 74 deletions(-) + +diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c +index ecc5115..95e1508 100644 +--- a/drivers/media/video/mt9t111.c ++++ b/drivers/media/video/mt9t111.c +@@ -17,20 +17,21 @@ + #include <media/mt9t111.h> + #include "mt9t111_reg.h" + +-#define USE_RAW // YCbCr mode does not work yet +-//#define COLOR_BAR // Create a Color bar test pattern, Blue, Green, Red, Grey ++/* YCbCr mode does not work yet */ ++#define USE_RAW ++/* Create a Color bar test pattern, Blue, Green, Red, Grey */ ++/* #define COLOR_BAR */ + + #define SENSOR_DETECTED 1 + #define SENSOR_NOT_DETECTED 0 + + static void mt9t111_loaddefault(struct i2c_client *client); + +-/* +-* as a place holder for further development +-*/ ++/* ++ * as a place holder for further development ++ */ + static void debug_dummy(char *in_msg) + { +- + } + + /* list of image formats supported by mt9t111 sensor */ +@@ -55,8 +56,8 @@ const static struct v4l2_fmtdesc mt9t111_formats[] = { + * smallest image size to largest. + */ + const static struct capture_size mt9t111_sizes[] = { +- { 640, 480 }, +-// { 2048, 1536} ++ { 640, 480 }, ++ /* { 2048, 1536} */ + }; + + #define NUM_CAPTURE_SIZE ARRAY_SIZE(mt9t111_sizes) +@@ -120,17 +121,17 @@ mt9t111_read_reg(struct i2c_client *client, u16 reg, u16 *val) + msg->addr = client->addr; + msg->flags = 0; + msg->len = 2; +- msg->buf = data; ++ msg->buf = data; + data[0] = (reg & 0xff00) >> 8; + data[1] = (reg & 0x00ff); + err = i2c_transfer(client->adapter, msg, 1); +- if (err >= 0) { +- msg->flags = I2C_M_RD; +- msg->len = 2; /* 2 byte read */ +- err = i2c_transfer(client->adapter, msg, 1); +- if (err >= 0) { +- *val = ((data[0] & 0x00ff) << 8) +- | (data[1] & 0x00ff); ++ if (err >= 0) { ++ msg->flags = I2C_M_RD; ++ msg->len = 2; /* 2 byte read */ ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err >= 0) { ++ *val = ((data[0] & 0x00ff) << 8) ++ | (data[1] & 0x00ff); + return 0; + } + } +@@ -159,7 +160,7 @@ mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val) + msg->len = 4; + msg->buf = data; + data[0] = (u8)((reg & 0xff00) >> 8); +- data[1] = (u8)(reg & 0x00ff); ++ data[1] = (u8)(reg & 0x00ff); + data[2] = (u8)((val & 0xff00) >> 8); + data[3] = (u8)(val & 0x00ff); + err = i2c_transfer(client->adapter, msg, 1); +@@ -171,7 +172,7 @@ mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val) + * mt9t111_write_regs - Write registers to an mt9t111 sensor device + * @client: i2c driver client structure + * @reg_in: pointer to registers to write +- * @cnt: the number of registers ++ * @cnt: the number of registers + * + * Write registers . + * Returns zero if successful, or non-zero otherwise. +@@ -182,19 +183,21 @@ mt9t111_write_regs(struct i2c_client *client, mt9t111_regs *reg_in, int cnt) + int err = 0; + int i; + mt9t111_regs *reg = reg_in; +- +- for (i=0;i<cnt;i++) { ++ ++ for (i = 0; i < cnt; i++) { + if (reg->delay_time == 0) { + err |= mt9t111_write_reg(client, reg->addr, reg->data); + } else if (reg->addr != 0 || reg->data != 0) { + err |= mt9t111_write_reg(client, reg->addr, reg->data); + mdelay(reg->delay_time); +- } else ++ } else { + mdelay(reg->delay_time); +- ++ } ++ + if (err < 0) { +- dev_warn(&client->dev, "write reg error, addr = 0x%x, data = 0x%x \n", \ +- reg->addr, reg->data); ++ dev_warn(&client->dev, "write reg error, addr = 0x%x," ++ " data = 0x%x \n", ++ reg->addr, reg->data); + return err; + } + reg++; +@@ -219,10 +222,11 @@ mt9t111_detect(struct i2c_client *client) + if (mt9t111_read_reg(client, MT9T111_CHIP_ID, &val) < 0) + return -ENODEV; + dev_info(&client->dev, "model id detected 0x%x\n", val); +- ++ + if (val != MT9T111_CHIP_ID_VALUE) { +- dev_warn(&client->dev, "model id mismatch received 0x%x expecting 0x%x\n", +- val, MT9T111_CHIP_ID_VALUE); ++ dev_warn(&client->dev, "model id mismatch received 0x%x" ++ " expecting 0x%x\n", ++ val, MT9T111_CHIP_ID_VALUE); + + return -ENODEV; + } +@@ -285,14 +289,17 @@ static int ioctl_enum_frameintervals(struct v4l2_int_device *s, + { + int ifmt; + +-printk(KERN_INFO "entering ioctl_enum_frameintervals\n"); +-printk(KERN_INFO "index = %d, pixel_format = 0x%x, width = %d, height = %d\n", +- frmi->index, frmi->pixel_format, frmi->width, frmi->height); +-printk(KERN_INFO "mt9t111 format = 0x%x\n", mt9t111_formats[0].pixelformat); ++ printk(KERN_INFO "entering ioctl_enum_frameintervals\n"); ++ printk(KERN_INFO "index = %d, pixel_format = 0x%x," ++ " width = %d, height = %d\n", ++ frmi->index, frmi->pixel_format, ++ frmi->width, frmi->height); ++ printk(KERN_INFO "mt9t111 format = 0x%x\n", ++ mt9t111_formats[0].pixelformat); + + if (frmi->index >= NUM_CAPTURE_FRAMEINTERVALS) + return -EINVAL; +- ++ + for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) { + if (frmi->pixel_format == mt9t111_formats[ifmt].pixelformat) + break; +@@ -368,7 +375,7 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + if (rval < 0) { + dev_err(&c->dev, "Unable to set the power state: " "mt9t111" + " sensor\n"); +- //sensor->pdata->set_xclk(0); ++ /* sensor->pdata->set_xclk(0); */ + return rval; + } + +@@ -418,7 +425,7 @@ static int ioctl_g_priv(struct v4l2_int_device *s, void *p) + static int ioctl_s_parm(struct v4l2_int_device *s, + struct v4l2_streamparm *a) + { +- //TODO: set paramters ++ /* TODO: set paramters */ + debug_dummy("debug_dummy -- VIDIOC_S_PARM "); + return 0; + } +@@ -483,13 +490,13 @@ static int ioctl_try_fmt_cap(struct v4l2_int_device *s, + + pix->width = 640; + pix->height = 480; +-#ifdef USE_RAW ++#ifdef USE_RAW + pix->pixelformat = V4L2_PIX_FMT_SGRBG10; +- pix->bytesperline = pix->width; ++ pix->bytesperline = pix->width; + pix->colorspace = V4L2_COLORSPACE_SRGB; + #else + pix->pixelformat = V4L2_PIX_FMT_YUYV; +- pix->bytesperline = pix->width * 2; ++ pix->bytesperline = pix->width * 2; + pix->colorspace = V4L2_COLORSPACE_JPEG; + #endif + pix->field = V4L2_FIELD_NONE; +@@ -585,7 +592,7 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s, + static int ioctl_g_ctrl(struct v4l2_int_device *s, + struct v4l2_control *vc) + { +- debug_dummy("debug_dummy -- g ctrl\n"); ++ debug_dummy("debug_dummy -- g ctrl\n"); + return 0; + } + +@@ -601,8 +608,8 @@ static int ioctl_g_ctrl(struct v4l2_int_device *s, + static int ioctl_queryctrl(struct v4l2_int_device *s, + struct v4l2_queryctrl *qc) + { +- debug_dummy("debug_dummy -- query ctrl\n"); +- return-EINVAL; ++ debug_dummy("debug_dummy -- query ctrl\n"); ++ return -EINVAL; + } + + /** +@@ -647,12 +654,11 @@ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) + return rval; + } + +- p->u.ycbcr.clock_curr = 40*1000000; // temporal value ++ p->u.ycbcr.clock_curr = 40 * 1000000; /* temporal value */ + + return 0; + } + +- + static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = { + { .num = vidioc_int_enum_framesizes_num, + .func = (v4l2_int_ioctl_func *)ioctl_enum_framesizes }, +@@ -666,8 +672,8 @@ static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = { + .func = (v4l2_int_ioctl_func *)ioctl_s_power }, + { .num = vidioc_int_g_priv_num, + .func = (v4l2_int_ioctl_func *)ioctl_g_priv }, +- {vidioc_int_g_ifparm_num, +- .func = (v4l2_int_ioctl_func*) ioctl_g_ifparm}, ++ { .num = vidioc_int_g_ifparm_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_g_ifparm }, + { .num = vidioc_int_init_num, + .func = (v4l2_int_ioctl_func *)ioctl_init }, + { .num = vidioc_int_enum_fmt_cap_num, +@@ -688,29 +694,30 @@ static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = { + .func = (v4l2_int_ioctl_func *)ioctl_g_ctrl }, + { .num = vidioc_int_s_ctrl_num, + .func = (v4l2_int_ioctl_func *)ioctl_s_ctrl }, +- {.num = vidioc_int_s_video_routing_num, +- .func = (v4l2_int_ioctl_func *) ioctl_s_routing}, ++ { .num = vidioc_int_s_video_routing_num, ++ .func = (v4l2_int_ioctl_func *)ioctl_s_routing }, + }; + +-static void mt9t111_refresh(struct i2c_client *client){ +- int i; +- unsigned short value; +- // MCU_ADDRESS [SEQ_CMD] -- refresh +- mt9t111_write_reg(client, 0x098E, 0x8400); +- mt9t111_write_reg(client, 0x0990, 0x0006); +- for (i=0;i<100;i++){ +- mt9t111_write_reg(client, 0x098E, 0x8400); +- mt9t111_read_reg(client,0x0990,&value); +- if ( value == 0) +- break; +- mdelay(5); ++static void mt9t111_refresh(struct i2c_client *client) ++{ ++ int i; ++ unsigned short value; ++ /* MCU_ADDRESS [SEQ_CMD] -- refresh */ ++ mt9t111_write_reg(client, 0x098E, 0x8400); ++ mt9t111_write_reg(client, 0x0990, 0x0006); ++ for (i = 0; i < 100; i++) { ++ mt9t111_write_reg(client, 0x098E, 0x8400); ++ mt9t111_read_reg(client, 0x0990, &value); ++ if (value == 0) ++ break; ++ mdelay(5); + } + } + + #ifdef COLOR_BAR + static void mt9t111_color_bar(struct i2c_client *client) + { +- mt9t111_write_reg(client, 0x3210, 0x01B0); // disable lens correction ++ mt9t111_write_reg(client, 0x3210, 0x01B0); /* disable lens correction */ + + mt9t111_write_reg(client, 0x098E, 0x6003); + mt9t111_write_reg(client, 0x0990, 0x0100); +@@ -721,22 +728,25 @@ static void mt9t111_color_bar(struct i2c_client *client) + + static void mt9t111_bayer_format(struct i2c_client *client) + { +- mt9t111_write_regs(client, bayer_pattern_regs, sizeof(bayer_pattern_regs)/sizeof(mt9t111_regs)); ++ mt9t111_write_regs(client, bayer_pattern_regs, ++ sizeof(bayer_pattern_regs) / sizeof(mt9t111_regs)); + } + + static void mt9t111_enable_pll(struct i2c_client *client) + { + int i; +- unsigned short value; ++ unsigned short value; + +- mt9t111_write_regs(client, pll_regs1, sizeof(pll_regs1)/sizeof(mt9t111_regs)); +- for (i=0;i<100;i++){ +- mt9t111_read_reg(client,0x0014,&value); +- if (( value & 0x8000) != 0) ++ mt9t111_write_regs(client, pll_regs1, ++ sizeof(pll_regs1) / sizeof(mt9t111_regs)); ++ for (i = 0; i < 100; i++) { ++ mt9t111_read_reg(client, 0x0014, &value); ++ if ((value & 0x8000) != 0) + break; + mdelay(2); + } +- mt9t111_write_regs(client, pll_regs2, sizeof(pll_regs2)/sizeof(mt9t111_regs)); ++ mt9t111_write_regs(client, pll_regs2, ++ sizeof(pll_regs2) / sizeof(mt9t111_regs)); + } + + +@@ -746,9 +756,12 @@ static void mt9t111_loaddefault(struct i2c_client *client) + mt9t111_write_reg(client, 0x001A, 0x0218); + + mt9t111_enable_pll(client); +- mt9t111_write_regs(client, def_regs1, sizeof(def_regs1)/sizeof(mt9t111_regs)); +- mt9t111_write_regs(client, patch_rev6, sizeof(patch_rev6)/sizeof(mt9t111_regs)); +- mt9t111_write_regs(client, def_regs2, sizeof(def_regs2)/sizeof(mt9t111_regs)); ++ mt9t111_write_regs(client, def_regs1, ++ sizeof(def_regs1) / sizeof(mt9t111_regs)); ++ mt9t111_write_regs(client, patch_rev6, ++ sizeof(patch_rev6) / sizeof(mt9t111_regs)); ++ mt9t111_write_regs(client, def_regs2, ++ sizeof(def_regs2) / sizeof(mt9t111_regs)); + + #ifdef USE_RAW + mt9t111_bayer_format(client); +@@ -806,7 +819,7 @@ mt9t111_probe(struct i2c_client *client, const struct i2c_device_id *id) + + sensor->pix.width = 640; + sensor->pix.height = 480; +-#ifdef USE_RAW ++#ifdef USE_RAW + sensor->pix.pixelformat = V4L2_PIX_FMT_SGRBG10; + #else + sensor->pix.pixelformat = V4L2_PIX_FMT_YUYV; +diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h +index e012eeb..e226c37 100644 +--- a/drivers/media/video/mt9t111_reg.h ++++ b/drivers/media/video/mt9t111_reg.h +@@ -25,7 +25,7 @@ typedef struct { + u16 data; + } mt9t111_regs; + +-mt9t111_regs patch_rev6[] ={ ++mt9t111_regs patch_rev6[] = { + {0, 0x0982, 0x0}, + {0, 0x098A, 0xCE7}, + {0, 0x0990, 0x3C3C}, +@@ -658,7 +658,7 @@ mt9t111_regs patch_rev6[] ={ + {100, 0x0990, 0x0004} + }; + +-mt9t111_regs def_regs1[] ={ ++mt9t111_regs def_regs1[] = { + {0, 0x001A, 0x0218}, + {0, 0x001E, 0x0777}, + {0, 0x3084, 0x2409}, +@@ -1343,7 +1343,7 @@ mt9t111_regs pll_regs2[] = { + {0, 0x0014, 0x3046}, + {0, 0x0022, 0x01E0}, + {0, 0x001E, 0x0707}, +- {0, 0x3B84, 0x011D} ++ {0, 0x3B84, 0x011D} + }; + + mt9t111_regs bayer_pattern_regs[] = { +diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h +index 7acbeed..0a5161a 100644 +--- a/include/media/mt9t111.h ++++ b/include/media/mt9t111.h +@@ -40,7 +40,7 @@ + #define MT9T111_I2C_UNREGISTERED (0) + + /*i2c adress for MT9T111*/ +-#define MT9T111_I2C_ADDR (0x78 >>1) ++#define MT9T111_I2C_ADDR (0x78 >> 1) + + #define MT9T111_CLK_MAX (75000000) /* 75MHz */ + #define MT9T111_CLK_MIN (6000000) /* 6Mhz */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0003-mt9t111-Pass-v4l2_int_device-data.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0003-mt9t111-Pass-v4l2_int_device-data.patch new file mode 100644 index 00000000..0c6b90aa --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0003-mt9t111-Pass-v4l2_int_device-data.patch @@ -0,0 +1,40 @@ +From bb40914cf9e313d70385e647f956a55df15e717f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 11 Jun 2010 16:17:56 -0500 +Subject: [PATCH 03/75] mt9t111: Pass v4l2_int_device data + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t111.c | 2 +- + include/media/mt9t111.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c +index 95e1508..6a7b2c0 100644 +--- a/drivers/media/video/mt9t111.c ++++ b/drivers/media/video/mt9t111.c +@@ -371,7 +371,7 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + else + debug_dummy("debug_dummy -- enable clock\n");; + +- rval = sensor->pdata->power_set(on); ++ rval = sensor->pdata->power_set(s, on); + if (rval < 0) { + dev_err(&c->dev, "Unable to set the power state: " "mt9t111" + " sensor\n"); +diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h +index 0a5161a..aae3f99 100644 +--- a/include/media/mt9t111.h ++++ b/include/media/mt9t111.h +@@ -56,7 +56,7 @@ + + struct mt9t111_platform_data { + char *master; +- int (*power_set) (enum v4l2_power on); ++ int (*power_set) (struct v4l2_int_device *s, enum v4l2_power on); + int (*ifparm) (struct v4l2_ifparm *p); + int (*priv_data_set) (void *); + /* Interface control params */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0004-omap3beagle-Add-camera-support.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0004-omap3beagle-Add-camera-support.patch new file mode 100644 index 00000000..511bd93c --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0004-omap3beagle-Add-camera-support.patch @@ -0,0 +1,352 @@ +From 8b7b00860ac8c558c7156ff676655942027f7f53 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 11 Jun 2010 16:15:58 -0500 +Subject: [PATCH 04/75] omap3beagle: Add camera support + +This is tested with the xM + Leopard imaging module camera, which +has a MT9T111. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/Makefile | 3 +- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 228 ++++++++++++++++++++++++ + arch/arm/mach-omap2/board-omap3beagle-camera.h | 41 +++++ + arch/arm/mach-omap2/board-omap3beagle.c | 25 +++ + 4 files changed, 296 insertions(+), 1 deletions(-) + create mode 100644 arch/arm/mach-omap2/board-omap3beagle-camera.c + create mode 100644 arch/arm/mach-omap2/board-omap3beagle-camera.h + +diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile +index 9042317..a49d436 100644 +--- a/arch/arm/mach-omap2/Makefile ++++ b/arch/arm/mach-omap2/Makefile +@@ -87,7 +87,8 @@ obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \ + mmc-twl4030.o + obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o + obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \ +- mmc-twl4030.o ++ mmc-twl4030.o \ ++ board-omap3beagle-camera.o + obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ + mmc-twl4030.o \ + board-ldp-camera.o +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +new file mode 100644 +index 0000000..e93437f +--- /dev/null ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -0,0 +1,228 @@ ++/* ++ * Driver for Leopard Module Board used in Beagleboard (xM) ++ * ++ * Copyright (C) 2010 Texas Instruments Inc ++ * Author: Sergio Aguirre <saaguirre@ti.com> ++ * ++ * Based on work done by: ++ * Vaibhav Hiremath <hvaibhav@ti.com> ++ * Anuj Aggarwal <anuj.aggarwal@ti.com> ++ * Sivaraj R <sivaraj@ti.com> ++ * ++ * This package is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#include <linux/init.h> ++#include <linux/i2c.h> ++#include <linux/gpio.h> ++#include <linux/mm.h> ++#include <linux/videodev2.h> ++#include <linux/i2c/twl.h> ++#include <linux/delay.h> ++ ++#include <plat/mux.h> ++#include <plat/board.h> ++ ++#include <media/v4l2-int-device.h> ++#include <media/mt9t111.h> ++ ++/* Include V4L2 ISP-Camera driver related header file */ ++#include <../drivers/media/video/omap34xxcam.h> ++#include <../drivers/media/video/isp/ispreg.h> ++ ++#include "mux.h" ++#include "board-omap3beagle-camera.h" ++ ++#define MODULE_NAME "omap3beaglelmb" ++ ++#define MT9T111_I2C_BUSNUM (2) ++ ++#define CAM_USE_XCLKA 1 ++ ++#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++static struct isp_interface_config mt9t111_if_config = { ++ .ccdc_par_ser = ISP_PARLL, ++ .dataline_shift = 0x0, ++ .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE, ++ .strobe = 0x0, ++ .prestrobe = 0x0, ++ .shutter = 0x0, ++ .u.par.par_bridge = 0x1, ++ .u.par.par_clk_pol = 0x0, ++}; ++ ++static struct v4l2_ifparm mt9t111_ifparm_s = { ++#if 1 ++ .if_type = V4L2_IF_TYPE_RAW, ++ .u = { ++ .raw = { ++ .frame_start_on_rising_vs = 1, ++ .bt_sync_correct = 0, ++ .swap = 0, ++ .latch_clk_inv = 0, ++ .nobt_hs_inv = 0, /* active high */ ++ .nobt_vs_inv = 0, /* active high */ ++ .clock_min = MT9T111_CLK_MIN, ++ .clock_max = MT9T111_CLK_MAX, ++ }, ++ }, ++#else ++ .if_type = V4L2_IF_TYPE_YCbCr, ++ .u = { ++ .ycbcr = { ++ .frame_start_on_rising_vs = 1, ++ .bt_sync_correct = 0, ++ .swap = 0, ++ .latch_clk_inv = 0, ++ .nobt_hs_inv = 0, /* active high */ ++ .nobt_vs_inv = 0, /* active high */ ++ .clock_min = MT9T111_CLK_MIN, ++ .clock_max = MT9T111_CLK_MAX, ++ }, ++ }, ++#endif ++}; ++ ++/** ++ * @brief mt9t111_ifparm - Returns the mt9t111 interface parameters ++ * ++ * @param p - pointer to v4l2_ifparm structure ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9t111_ifparm(struct v4l2_ifparm *p) ++{ ++ if (p == NULL) ++ return -EINVAL; ++ ++ *p = mt9t111_ifparm_s; ++ return 0; ++} ++ ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++static struct omap34xxcam_hw_config mt9t111_hwc = { ++ .dev_index = 0, ++ .dev_minor = 0, ++ .dev_type = OMAP34XXCAM_SLAVE_SENSOR, ++ .u.sensor.sensor_isp = 1, ++}; ++#endif ++ ++/** ++ * @brief mt9t111_set_prv_data - Returns mt9t111 omap34xx driver private data ++ * ++ * @param priv - pointer to omap34xxcam_hw_config structure ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9t111_set_prv_data(void *priv) ++{ ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++ struct omap34xxcam_hw_config *hwc = priv; ++ ++ if (priv == NULL) ++ return -EINVAL; ++ ++ hwc->u.sensor = mt9t111_hwc.u.sensor; ++ hwc->dev_index = mt9t111_hwc.dev_index; ++ hwc->dev_minor = mt9t111_hwc.dev_minor; ++ hwc->dev_type = mt9t111_hwc.dev_type; ++ return 0; ++#else ++ return -EINVAL; ++#endif ++} ++ ++/** ++ * @brief mt9t111_power_set - Power-on or power-off TVP5146 device ++ * ++ * @param power - enum, Power on/off, resume/standby ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) ++{ ++ struct omap34xxcam_videodev *vdev = s->u.slave->master->priv; ++ ++ switch (power) { ++ case V4L2_POWER_OFF: ++ isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); ++ break; ++ ++ case V4L2_POWER_STANDBY: ++ break; ++ ++ case V4L2_POWER_ON: ++ isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); ++ ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++ isp_configure_interface(vdev->cam->isp, &mt9t111_if_config); ++#endif ++ break; ++ ++ default: ++ return -ENODEV; ++ break; ++ } ++ return 0; ++} ++ ++static struct mt9t111_platform_data mt9t111_pdata = { ++ .master = "omap34xxcam", ++ .power_set = mt9t111_power_set, ++ .priv_data_set = mt9t111_set_prv_data, ++ .ifparm = mt9t111_ifparm, ++ /* Some interface dependent params */ ++ .clk_polarity = 0, /* data clocked out on falling edge */ ++ .hs_polarity = 1, /* 0 - Active low, 1- Active high */ ++ .vs_polarity = 1, /* 0 - Active low, 1- Active high */ ++}; ++ ++static struct i2c_board_info __initdata mt9t111_i2c_board_info = { ++ I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR), ++ .platform_data = &mt9t111_pdata, ++}; ++ ++#endif /* #ifdef CONFIG_VIDEO_MT9T111 */ ++ ++/** ++ * @brief omap3beaglelmb_init - module init function. Should be called before any ++ * client driver init call ++ * ++ * @return result of operation - 0 is success ++ */ ++int __init omap3beaglelmb_init(void) ++{ ++ int err; ++ ++ /* ++ * Register the I2C devices present in the board to the I2C ++ * framework. ++ * If more I2C devices are added, then each device information should ++ * be registered with I2C using i2c_register_board_info(). ++ */ ++#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++ err = i2c_register_board_info(MT9T111_I2C_BUSNUM, ++ &mt9t111_i2c_board_info, 1); ++ if (err) { ++ printk(KERN_ERR MODULE_NAME \ ++ ": MT9T111 I2C Board Registration failed \n"); ++ return err; ++ } ++#endif ++ printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); ++ ++ return 0; ++} ++arch_initcall(omap3beaglelmb_init); +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.h b/arch/arm/mach-omap2/board-omap3beagle-camera.h +new file mode 100644 +index 0000000..1026aeb +--- /dev/null ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.h +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (C) 2010 Texas Instruments Inc ++ * Author: Sergio Aguirre <saaguirre@ti.com> ++ * ++ * Based on work done by: ++ * Vaibhav Hiremath <hvaibhav@ti.com> ++ * Anuj Aggarwal <anuj.aggarwal@ti.com> ++ * Sivaraj R <sivaraj@ti.com> ++ * ++ * This package is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#ifndef __BOARD_OMAP3BEAGLE_LMB_H_ ++#define __BOARD_OMAP3BEAGLE_LMB_H_ ++ ++/* mux id to enable/disable signal routing to different peripherals */ ++enum omap3beaglelmb_mux { ++ MUX_TVP5146 = 0, ++ MUX_CAMERA_SENSOR, ++ MUX_EXP_CAMERA_SENSOR, ++ NUM_MUX ++}; ++ ++/* enum to enable or disable mux */ ++enum config_mux { ++ DISABLE_MUX, ++ ENABLE_MUX ++}; ++ ++#endif /* __BOARD_OMAP3BEAGLE_LMB_H_ */ +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index b313350..d6b69a6 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -712,6 +712,31 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { + + #ifdef CONFIG_OMAP_MUX + static struct omap_board_mux board_mux[] __initdata = { ++ /* Camera - Parallel Data */ ++ OMAP3_MUX(CAM_D0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D8, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D9, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D10, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_D11, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ ++ /* Camera - HS/VS signals */ ++ OMAP3_MUX(CAM_HS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ OMAP3_MUX(CAM_VS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), ++ ++ /* Camera - Reset GPIO 98 */ ++ OMAP3_MUX(CAM_FLD, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), ++ ++ /* Camera - XCLK */ ++ OMAP3_MUX(CAM_XCLKA, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), ++ + { .reg_offset = OMAP_MUX_TERMINATOR }, + }; + #else +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0005-TEMP-omap3beagle-camera-Add-defconfig.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0005-TEMP-omap3beagle-camera-Add-defconfig.patch new file mode 100644 index 00000000..b14321ba --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0005-TEMP-omap3beagle-camera-Add-defconfig.patch @@ -0,0 +1,3070 @@ +From 754e3fe541b0784ed84282b95268fbb9c68d65c5 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 11 Jun 2010 16:18:30 -0500 +Subject: [PATCH 05/75] TEMP: omap3beagle: camera: Add defconfig + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/configs/omap3_beagle_cam_defconfig | 3050 +++++++++++++++++++++++++++ + 1 files changed, 3050 insertions(+), 0 deletions(-) + create mode 100644 arch/arm/configs/omap3_beagle_cam_defconfig + +diff --git a/arch/arm/configs/omap3_beagle_cam_defconfig b/arch/arm/configs/omap3_beagle_cam_defconfig +new file mode 100644 +index 0000000..0ea8300 +--- /dev/null ++++ b/arch/arm/configs/omap3_beagle_cam_defconfig +@@ -0,0 +1,3050 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.32 ++# Fri Jun 11 14:25:23 2010 ++# ++CONFIG_ARM=y ++CONFIG_SYS_SUPPORTS_APM_EMULATION=y ++CONFIG_GENERIC_GPIO=y ++CONFIG_GENERIC_TIME=y ++CONFIG_GENERIC_CLOCKEVENTS=y ++CONFIG_GENERIC_HARDIRQS=y ++CONFIG_STACKTRACE_SUPPORT=y ++CONFIG_HAVE_LATENCYTOP_SUPPORT=y ++CONFIG_LOCKDEP_SUPPORT=y ++CONFIG_TRACE_IRQFLAGS_SUPPORT=y ++CONFIG_HARDIRQS_SW_RESEND=y ++CONFIG_GENERIC_IRQ_PROBE=y ++CONFIG_RWSEM_GENERIC_SPINLOCK=y ++CONFIG_ARCH_HAS_CPUFREQ=y ++CONFIG_GENERIC_HWEIGHT=y ++CONFIG_GENERIC_CALIBRATE_DELAY=y ++CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y ++CONFIG_OPROFILE_ARMV7=y ++CONFIG_VECTORS_BASE=0xffff0000 ++CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" ++CONFIG_CONSTRUCTORS=y ++ ++# ++# General setup ++# ++CONFIG_EXPERIMENTAL=y ++CONFIG_BROKEN_ON_SMP=y ++CONFIG_LOCK_KERNEL=y ++CONFIG_INIT_ENV_ARG_LIMIT=32 ++CONFIG_LOCALVERSION="" ++# CONFIG_LOCALVERSION_AUTO is not set ++CONFIG_SWAP=y ++CONFIG_SYSVIPC=y ++CONFIG_SYSVIPC_SYSCTL=y ++# CONFIG_POSIX_MQUEUE is not set ++CONFIG_BSD_PROCESS_ACCT=y ++# CONFIG_BSD_PROCESS_ACCT_V3 is not set ++CONFIG_TASKSTATS=y ++CONFIG_TASK_DELAY_ACCT=y ++CONFIG_TASK_XACCT=y ++CONFIG_TASK_IO_ACCOUNTING=y ++# CONFIG_AUDIT is not set ++ ++# ++# RCU Subsystem ++# ++CONFIG_TREE_RCU=y ++# CONFIG_TREE_PREEMPT_RCU is not set ++# CONFIG_TINY_RCU is not set ++# CONFIG_RCU_TRACE is not set ++CONFIG_RCU_FANOUT=32 ++# CONFIG_RCU_FANOUT_EXACT is not set ++# CONFIG_TREE_RCU_TRACE is not set ++CONFIG_IKCONFIG=y ++CONFIG_IKCONFIG_PROC=y ++CONFIG_LOG_BUF_SHIFT=16 ++CONFIG_GROUP_SCHED=y ++CONFIG_FAIR_GROUP_SCHED=y ++# CONFIG_RT_GROUP_SCHED is not set ++CONFIG_USER_SCHED=y ++# CONFIG_CGROUP_SCHED is not set ++# CONFIG_CGROUPS is not set ++# CONFIG_SYSFS_DEPRECATED_V2 is not set ++# CONFIG_RELAY is not set ++# CONFIG_NAMESPACES is not set ++CONFIG_BLK_DEV_INITRD=y ++CONFIG_INITRAMFS_SOURCE="" ++CONFIG_RD_GZIP=y ++# CONFIG_RD_BZIP2 is not set ++# CONFIG_RD_LZMA is not set ++CONFIG_CC_OPTIMIZE_FOR_SIZE=y ++CONFIG_SYSCTL=y ++CONFIG_ANON_INODES=y ++CONFIG_EMBEDDED=y ++CONFIG_UID16=y ++# CONFIG_SYSCTL_SYSCALL is not set ++CONFIG_KALLSYMS=y ++# CONFIG_KALLSYMS_ALL is not set ++# CONFIG_KALLSYMS_EXTRA_PASS is not set ++CONFIG_HOTPLUG=y ++CONFIG_PRINTK=y ++CONFIG_BUG=y ++# CONFIG_ELF_CORE is not set ++CONFIG_BASE_FULL=y ++CONFIG_FUTEX=y ++CONFIG_EPOLL=y ++CONFIG_SIGNALFD=y ++CONFIG_TIMERFD=y ++CONFIG_EVENTFD=y ++CONFIG_SHMEM=y ++CONFIG_AIO=y ++ ++# ++# Kernel Performance Events And Counters ++# ++CONFIG_VM_EVENT_COUNTERS=y ++# CONFIG_COMPAT_BRK is not set ++CONFIG_SLAB=y ++# CONFIG_SLUB is not set ++# CONFIG_SLOB is not set ++CONFIG_PROFILING=y ++CONFIG_TRACEPOINTS=y ++CONFIG_OPROFILE=y ++CONFIG_HAVE_OPROFILE=y ++# CONFIG_KPROBES is not set ++CONFIG_HAVE_KPROBES=y ++CONFIG_HAVE_KRETPROBES=y ++CONFIG_HAVE_CLK=y ++ ++# ++# GCOV-based kernel profiling ++# ++# CONFIG_GCOV_KERNEL is not set ++CONFIG_SLOW_WORK=y ++# CONFIG_SLOW_WORK_DEBUG is not set ++CONFIG_HAVE_GENERIC_DMA_COHERENT=y ++CONFIG_SLABINFO=y ++CONFIG_RT_MUTEXES=y ++CONFIG_BASE_SMALL=0 ++CONFIG_MODULES=y ++CONFIG_MODULE_FORCE_LOAD=y ++CONFIG_MODULE_UNLOAD=y ++CONFIG_MODULE_FORCE_UNLOAD=y ++CONFIG_MODVERSIONS=y ++CONFIG_MODULE_SRCVERSION_ALL=y ++CONFIG_BLOCK=y ++CONFIG_LBDAF=y ++CONFIG_BLK_DEV_BSG=y ++# CONFIG_BLK_DEV_INTEGRITY is not set ++ ++# ++# IO Schedulers ++# ++CONFIG_IOSCHED_NOOP=y ++CONFIG_IOSCHED_DEADLINE=y ++CONFIG_IOSCHED_CFQ=y ++# CONFIG_DEFAULT_DEADLINE is not set ++CONFIG_DEFAULT_CFQ=y ++# CONFIG_DEFAULT_NOOP is not set ++CONFIG_DEFAULT_IOSCHED="cfq" ++# CONFIG_INLINE_SPIN_TRYLOCK is not set ++# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set ++# CONFIG_INLINE_SPIN_LOCK is not set ++# CONFIG_INLINE_SPIN_LOCK_BH is not set ++# CONFIG_INLINE_SPIN_LOCK_IRQ is not set ++# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set ++# CONFIG_INLINE_SPIN_UNLOCK is not set ++# CONFIG_INLINE_SPIN_UNLOCK_BH is not set ++# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set ++# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set ++# CONFIG_INLINE_READ_TRYLOCK is not set ++# CONFIG_INLINE_READ_LOCK is not set ++# CONFIG_INLINE_READ_LOCK_BH is not set ++# CONFIG_INLINE_READ_LOCK_IRQ is not set ++# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set ++# CONFIG_INLINE_READ_UNLOCK is not set ++# CONFIG_INLINE_READ_UNLOCK_BH is not set ++# CONFIG_INLINE_READ_UNLOCK_IRQ is not set ++# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set ++# CONFIG_INLINE_WRITE_TRYLOCK is not set ++# CONFIG_INLINE_WRITE_LOCK is not set ++# CONFIG_INLINE_WRITE_LOCK_BH is not set ++# CONFIG_INLINE_WRITE_LOCK_IRQ is not set ++# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set ++# CONFIG_INLINE_WRITE_UNLOCK is not set ++# CONFIG_INLINE_WRITE_UNLOCK_BH is not set ++# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set ++# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set ++# CONFIG_MUTEX_SPIN_ON_OWNER is not set ++CONFIG_FREEZER=y ++ ++# ++# System Type ++# ++CONFIG_MMU=y ++# CONFIG_ARCH_AAEC2000 is not set ++# CONFIG_ARCH_INTEGRATOR is not set ++# CONFIG_ARCH_REALVIEW is not set ++# CONFIG_ARCH_VERSATILE is not set ++# CONFIG_ARCH_AT91 is not set ++# CONFIG_ARCH_CLPS711X is not set ++# CONFIG_ARCH_GEMINI is not set ++# CONFIG_ARCH_EBSA110 is not set ++# CONFIG_ARCH_EP93XX is not set ++# CONFIG_ARCH_FOOTBRIDGE is not set ++# CONFIG_ARCH_MXC is not set ++# CONFIG_ARCH_STMP3XXX is not set ++# CONFIG_ARCH_NETX is not set ++# CONFIG_ARCH_H720X is not set ++# CONFIG_ARCH_NOMADIK is not set ++# CONFIG_ARCH_IOP13XX is not set ++# CONFIG_ARCH_IOP32X is not set ++# CONFIG_ARCH_IOP33X is not set ++# CONFIG_ARCH_IXP23XX is not set ++# CONFIG_ARCH_IXP2000 is not set ++# CONFIG_ARCH_IXP4XX is not set ++# CONFIG_ARCH_L7200 is not set ++# CONFIG_ARCH_DOVE is not set ++# CONFIG_ARCH_KIRKWOOD is not set ++# CONFIG_ARCH_LOKI is not set ++# CONFIG_ARCH_MV78XX0 is not set ++# CONFIG_ARCH_ORION5X is not set ++# CONFIG_ARCH_MMP is not set ++# CONFIG_ARCH_KS8695 is not set ++# CONFIG_ARCH_NS9XXX is not set ++# CONFIG_ARCH_W90X900 is not set ++# CONFIG_ARCH_PNX4008 is not set ++# CONFIG_ARCH_PXA is not set ++# CONFIG_ARCH_MSM is not set ++# CONFIG_ARCH_RPC is not set ++# CONFIG_ARCH_SA1100 is not set ++# CONFIG_ARCH_S3C2410 is not set ++# CONFIG_ARCH_S3C64XX is not set ++# CONFIG_ARCH_S5PC1XX is not set ++# CONFIG_ARCH_SHARK is not set ++# CONFIG_ARCH_LH7A40X is not set ++# CONFIG_ARCH_U300 is not set ++# CONFIG_ARCH_DAVINCI is not set ++CONFIG_ARCH_OMAP=y ++# CONFIG_ARCH_BCMRING is not set ++# CONFIG_ARCH_U8500 is not set ++ ++# ++# TI OMAP Implementations ++# ++CONFIG_ARCH_OMAP_OTG=y ++# CONFIG_ARCH_OMAP1 is not set ++# CONFIG_ARCH_OMAP2 is not set ++CONFIG_ARCH_OMAP3=y ++# CONFIG_ARCH_OMAP4 is not set ++ ++# ++# OMAP Feature Selections ++# ++CONFIG_OMAP_SMARTREFLEX=y ++# CONFIG_OMAP_SMARTREFLEX_TESTING is not set ++CONFIG_OMAP_RESET_CLOCKS=y ++# CONFIG_OMAP_MUX is not set ++CONFIG_OMAP_MCBSP=y ++CONFIG_OMAP_MBOX_FWK=m ++CONFIG_OMAP_IOMMU=y ++# CONFIG_OMAP_MPU_TIMER is not set ++CONFIG_OMAP_32K_TIMER=y ++# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set ++# CONFIG_OMAP3_DEBOBS is not set ++CONFIG_OMAP_32K_TIMER_HZ=128 ++CONFIG_OMAP_DM_TIMER=y ++# CONFIG_OMAP_LL_DEBUG_UART1 is not set ++# CONFIG_OMAP_LL_DEBUG_UART2 is not set ++CONFIG_OMAP_LL_DEBUG_UART3=y ++# CONFIG_OMAP_LL_DEBUG_NONE is not set ++# CONFIG_OMAP_PM_NONE is not set ++# CONFIG_OMAP_PM_NOOP is not set ++CONFIG_OMAP_PM_SRF=y ++CONFIG_ARCH_OMAP34XX=y ++CONFIG_ARCH_OMAP3430=y ++CONFIG_OMAP_PACKAGE_CBB=y ++ ++# ++# OMAP Board Type ++# ++CONFIG_MACH_OMAP3_BEAGLE=y ++# CONFIG_MACH_OMAP_LDP is not set ++# CONFIG_MACH_OVERO is not set ++CONFIG_MACH_OMAP3EVM=y ++CONFIG_PMIC_TWL4030=y ++# CONFIG_MACH_OMAP3517EVM is not set ++# CONFIG_MACH_OMAP3_PANDORA is not set ++# CONFIG_MACH_OMAP3_TOUCHBOOK is not set ++# CONFIG_MACH_OMAP_3430SDP is not set ++# CONFIG_MACH_NOKIA_RX51 is not set ++# CONFIG_MACH_OMAP_ZOOM2 is not set ++# CONFIG_MACH_OMAP_ZOOM3 is not set ++# CONFIG_MACH_CM_T35 is not set ++# CONFIG_MACH_IGEP0020 is not set ++# CONFIG_MACH_OMAP_3630SDP is not set ++# CONFIG_OMAP3_EMU is not set ++# CONFIG_OMAP3_SDRC_AC_TIMING is not set ++ ++# ++# Processor Type ++# ++CONFIG_CPU_32=y ++CONFIG_CPU_32v6K=y ++CONFIG_CPU_V7=y ++CONFIG_CPU_32v7=y ++CONFIG_CPU_ABRT_EV7=y ++CONFIG_CPU_PABRT_V7=y ++CONFIG_CPU_CACHE_V7=y ++CONFIG_CPU_CACHE_VIPT=y ++CONFIG_CPU_COPY_V6=y ++CONFIG_CPU_TLB_V7=y ++CONFIG_CPU_HAS_ASID=y ++CONFIG_CPU_CP15=y ++CONFIG_CPU_CP15_MMU=y ++ ++# ++# Processor Features ++# ++CONFIG_ARM_THUMB=y ++CONFIG_ARM_THUMBEE=y ++# CONFIG_CPU_ICACHE_DISABLE is not set ++# CONFIG_CPU_DCACHE_DISABLE is not set ++# CONFIG_CPU_BPREDICT_DISABLE is not set ++CONFIG_HAS_TLS_REG=y ++CONFIG_ARM_L1_CACHE_SHIFT=6 ++CONFIG_USER_L2_PLE=y ++CONFIG_USER_PMON=y ++# CONFIG_ARM_ERRATA_430973 is not set ++# CONFIG_ARM_ERRATA_458693 is not set ++# CONFIG_ARM_ERRATA_460075 is not set ++CONFIG_COMMON_CLKDEV=y ++ ++# ++# Bus support ++# ++# CONFIG_PCI_SYSCALL is not set ++# CONFIG_ARCH_SUPPORTS_MSI is not set ++# CONFIG_PCCARD is not set ++ ++# ++# Kernel Features ++# ++CONFIG_TICK_ONESHOT=y ++CONFIG_NO_HZ=y ++CONFIG_HIGH_RES_TIMERS=y ++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y ++CONFIG_VMSPLIT_3G=y ++# CONFIG_VMSPLIT_2G is not set ++# CONFIG_VMSPLIT_1G is not set ++CONFIG_PAGE_OFFSET=0xC0000000 ++# CONFIG_PREEMPT_NONE is not set ++# CONFIG_PREEMPT_VOLUNTARY is not set ++CONFIG_PREEMPT=y ++CONFIG_HZ=128 ++# CONFIG_THUMB2_KERNEL is not set ++CONFIG_AEABI=y ++# CONFIG_OABI_COMPAT is not set ++CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y ++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set ++# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set ++# CONFIG_HIGHMEM is not set ++CONFIG_SELECT_MEMORY_MODEL=y ++CONFIG_FLATMEM_MANUAL=y ++# CONFIG_DISCONTIGMEM_MANUAL is not set ++# CONFIG_SPARSEMEM_MANUAL is not set ++CONFIG_FLATMEM=y ++CONFIG_FLAT_NODE_MEM_MAP=y ++CONFIG_PAGEFLAGS_EXTENDED=y ++CONFIG_SPLIT_PTLOCK_CPUS=4 ++# CONFIG_PHYS_ADDR_T_64BIT is not set ++CONFIG_ZONE_DMA_FLAG=0 ++CONFIG_VIRT_TO_BUS=y ++# CONFIG_KSM is not set ++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 ++CONFIG_LEDS=y ++CONFIG_ALIGNMENT_TRAP=y ++# CONFIG_UACCESS_WITH_MEMCPY is not set ++CONFIG_CPU_V7_SYSFS=y ++ ++# ++# Boot options ++# ++CONFIG_ZBOOT_ROM_TEXT=0x0 ++CONFIG_ZBOOT_ROM_BSS=0x0 ++CONFIG_CMDLINE=" debug " ++# CONFIG_XIP_KERNEL is not set ++CONFIG_KEXEC=y ++CONFIG_ATAGS_PROC=y ++ ++# ++# CPU Power Management ++# ++CONFIG_CPU_FREQ=y ++CONFIG_CPU_FREQ_TABLE=y ++CONFIG_CPU_FREQ_DEBUG=y ++CONFIG_CPU_FREQ_STAT=y ++CONFIG_CPU_FREQ_STAT_DETAILS=y ++CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y ++# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set ++# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set ++# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set ++# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set ++CONFIG_CPU_FREQ_GOV_PERFORMANCE=y ++CONFIG_CPU_FREQ_GOV_POWERSAVE=y ++CONFIG_CPU_FREQ_GOV_USERSPACE=y ++CONFIG_CPU_FREQ_GOV_ONDEMAND=y ++CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y ++# CONFIG_CPU_IDLE is not set ++ ++# ++# Floating point emulation ++# ++ ++# ++# At least one emulation must be selected ++# ++CONFIG_VFP=y ++CONFIG_VFPv3=y ++CONFIG_NEON=y ++ ++# ++# Userspace binary formats ++# ++CONFIG_BINFMT_ELF=y ++CONFIG_HAVE_AOUT=y ++CONFIG_BINFMT_AOUT=m ++CONFIG_BINFMT_MISC=y ++ ++# ++# Power management options ++# ++CONFIG_PM=y ++CONFIG_PM_DEBUG=y ++# CONFIG_PM_VERBOSE is not set ++CONFIG_CAN_PM_TRACE=y ++CONFIG_PM_SLEEP=y ++CONFIG_SUSPEND=y ++CONFIG_SUSPEND_FREEZER=y ++# CONFIG_APM_EMULATION is not set ++CONFIG_PM_RUNTIME=y ++CONFIG_ARCH_SUSPEND_POSSIBLE=y ++CONFIG_NET=y ++ ++# ++# Networking options ++# ++CONFIG_PACKET=y ++CONFIG_PACKET_MMAP=y ++CONFIG_UNIX=y ++CONFIG_XFRM=y ++# CONFIG_XFRM_USER is not set ++# CONFIG_XFRM_SUB_POLICY is not set ++# CONFIG_XFRM_MIGRATE is not set ++# CONFIG_XFRM_STATISTICS is not set ++CONFIG_XFRM_IPCOMP=m ++CONFIG_NET_KEY=y ++# CONFIG_NET_KEY_MIGRATE is not set ++CONFIG_INET=y ++# CONFIG_IP_MULTICAST is not set ++# CONFIG_IP_ADVANCED_ROUTER is not set ++CONFIG_IP_FIB_HASH=y ++CONFIG_IP_PNP=y ++CONFIG_IP_PNP_DHCP=y ++CONFIG_IP_PNP_BOOTP=y ++CONFIG_IP_PNP_RARP=y ++CONFIG_NET_IPIP=m ++CONFIG_NET_IPGRE=m ++# CONFIG_ARPD is not set ++# CONFIG_SYN_COOKIES is not set ++CONFIG_INET_AH=m ++CONFIG_INET_ESP=m ++CONFIG_INET_IPCOMP=m ++CONFIG_INET_XFRM_TUNNEL=m ++CONFIG_INET_TUNNEL=m ++CONFIG_INET_XFRM_MODE_TRANSPORT=y ++CONFIG_INET_XFRM_MODE_TUNNEL=y ++CONFIG_INET_XFRM_MODE_BEET=y ++CONFIG_INET_LRO=y ++CONFIG_INET_DIAG=m ++CONFIG_INET_TCP_DIAG=m ++CONFIG_TCP_CONG_ADVANCED=y ++CONFIG_TCP_CONG_BIC=m ++CONFIG_TCP_CONG_CUBIC=y ++CONFIG_TCP_CONG_WESTWOOD=m ++CONFIG_TCP_CONG_HTCP=m ++CONFIG_TCP_CONG_HSTCP=m ++CONFIG_TCP_CONG_HYBLA=m ++CONFIG_TCP_CONG_VEGAS=m ++CONFIG_TCP_CONG_SCALABLE=m ++CONFIG_TCP_CONG_LP=m ++CONFIG_TCP_CONG_VENO=m ++CONFIG_TCP_CONG_YEAH=m ++CONFIG_TCP_CONG_ILLINOIS=m ++# CONFIG_DEFAULT_BIC is not set ++CONFIG_DEFAULT_CUBIC=y ++# CONFIG_DEFAULT_HTCP is not set ++# CONFIG_DEFAULT_VEGAS is not set ++# CONFIG_DEFAULT_WESTWOOD is not set ++# CONFIG_DEFAULT_RENO is not set ++CONFIG_DEFAULT_TCP_CONG="cubic" ++# CONFIG_TCP_MD5SIG is not set ++CONFIG_IPV6=m ++# CONFIG_IPV6_PRIVACY is not set ++# CONFIG_IPV6_ROUTER_PREF is not set ++# CONFIG_IPV6_OPTIMISTIC_DAD is not set ++CONFIG_INET6_AH=m ++CONFIG_INET6_ESP=m ++CONFIG_INET6_IPCOMP=m ++CONFIG_IPV6_MIP6=m ++CONFIG_INET6_XFRM_TUNNEL=m ++CONFIG_INET6_TUNNEL=m ++CONFIG_INET6_XFRM_MODE_TRANSPORT=m ++CONFIG_INET6_XFRM_MODE_TUNNEL=m ++CONFIG_INET6_XFRM_MODE_BEET=m ++CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m ++CONFIG_IPV6_SIT=m ++# CONFIG_IPV6_SIT_6RD is not set ++CONFIG_IPV6_NDISC_NODETYPE=y ++CONFIG_IPV6_TUNNEL=m ++CONFIG_IPV6_MULTIPLE_TABLES=y ++CONFIG_IPV6_SUBTREES=y ++CONFIG_IPV6_MROUTE=y ++# CONFIG_IPV6_PIMSM_V2 is not set ++# CONFIG_NETWORK_SECMARK is not set ++CONFIG_NETFILTER=y ++# CONFIG_NETFILTER_DEBUG is not set ++CONFIG_NETFILTER_ADVANCED=y ++CONFIG_BRIDGE_NETFILTER=y ++ ++# ++# Core Netfilter Configuration ++# ++CONFIG_NETFILTER_NETLINK=m ++CONFIG_NETFILTER_NETLINK_QUEUE=m ++CONFIG_NETFILTER_NETLINK_LOG=m ++CONFIG_NF_CONNTRACK=m ++CONFIG_NF_CT_ACCT=y ++CONFIG_NF_CONNTRACK_MARK=y ++CONFIG_NF_CONNTRACK_EVENTS=y ++CONFIG_NF_CT_PROTO_DCCP=m ++CONFIG_NF_CT_PROTO_GRE=m ++CONFIG_NF_CT_PROTO_SCTP=m ++CONFIG_NF_CT_PROTO_UDPLITE=m ++CONFIG_NF_CONNTRACK_AMANDA=m ++CONFIG_NF_CONNTRACK_FTP=m ++CONFIG_NF_CONNTRACK_H323=m ++CONFIG_NF_CONNTRACK_IRC=m ++CONFIG_NF_CONNTRACK_NETBIOS_NS=m ++CONFIG_NF_CONNTRACK_PPTP=m ++CONFIG_NF_CONNTRACK_SANE=m ++CONFIG_NF_CONNTRACK_SIP=m ++CONFIG_NF_CONNTRACK_TFTP=m ++CONFIG_NF_CT_NETLINK=m ++# CONFIG_NETFILTER_TPROXY is not set ++CONFIG_NETFILTER_XTABLES=m ++CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m ++CONFIG_NETFILTER_XT_TARGET_CONNMARK=m ++# CONFIG_NETFILTER_XT_TARGET_DSCP is not set ++CONFIG_NETFILTER_XT_TARGET_HL=m ++# CONFIG_NETFILTER_XT_TARGET_LED is not set ++CONFIG_NETFILTER_XT_TARGET_MARK=m ++CONFIG_NETFILTER_XT_TARGET_NFLOG=m ++CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m ++# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set ++CONFIG_NETFILTER_XT_TARGET_RATEEST=m ++# CONFIG_NETFILTER_XT_TARGET_TRACE is not set ++CONFIG_NETFILTER_XT_TARGET_TCPMSS=m ++# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set ++# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set ++CONFIG_NETFILTER_XT_MATCH_COMMENT=m ++CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m ++CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m ++CONFIG_NETFILTER_XT_MATCH_CONNMARK=m ++CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m ++CONFIG_NETFILTER_XT_MATCH_DCCP=m ++CONFIG_NETFILTER_XT_MATCH_DSCP=m ++CONFIG_NETFILTER_XT_MATCH_ESP=m ++CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m ++CONFIG_NETFILTER_XT_MATCH_HELPER=m ++CONFIG_NETFILTER_XT_MATCH_HL=m ++CONFIG_NETFILTER_XT_MATCH_IPRANGE=m ++CONFIG_NETFILTER_XT_MATCH_LENGTH=m ++CONFIG_NETFILTER_XT_MATCH_LIMIT=m ++CONFIG_NETFILTER_XT_MATCH_MAC=m ++CONFIG_NETFILTER_XT_MATCH_MARK=m ++CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m ++CONFIG_NETFILTER_XT_MATCH_OWNER=m ++CONFIG_NETFILTER_XT_MATCH_POLICY=m ++# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set ++CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m ++CONFIG_NETFILTER_XT_MATCH_QUOTA=m ++CONFIG_NETFILTER_XT_MATCH_RATEEST=m ++CONFIG_NETFILTER_XT_MATCH_REALM=m ++CONFIG_NETFILTER_XT_MATCH_RECENT=m ++# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set ++CONFIG_NETFILTER_XT_MATCH_SCTP=m ++CONFIG_NETFILTER_XT_MATCH_STATE=m ++CONFIG_NETFILTER_XT_MATCH_STATISTIC=m ++CONFIG_NETFILTER_XT_MATCH_STRING=m ++CONFIG_NETFILTER_XT_MATCH_TCPMSS=m ++CONFIG_NETFILTER_XT_MATCH_TIME=m ++CONFIG_NETFILTER_XT_MATCH_U32=m ++# CONFIG_NETFILTER_XT_MATCH_OSF is not set ++CONFIG_IP_VS=m ++CONFIG_IP_VS_IPV6=y ++CONFIG_IP_VS_DEBUG=y ++CONFIG_IP_VS_TAB_BITS=12 ++ ++# ++# IPVS transport protocol load balancing support ++# ++CONFIG_IP_VS_PROTO_TCP=y ++CONFIG_IP_VS_PROTO_UDP=y ++CONFIG_IP_VS_PROTO_AH_ESP=y ++CONFIG_IP_VS_PROTO_ESP=y ++CONFIG_IP_VS_PROTO_AH=y ++ ++# ++# IPVS scheduler ++# ++CONFIG_IP_VS_RR=m ++CONFIG_IP_VS_WRR=m ++CONFIG_IP_VS_LC=m ++CONFIG_IP_VS_WLC=m ++CONFIG_IP_VS_LBLC=m ++CONFIG_IP_VS_LBLCR=m ++CONFIG_IP_VS_DH=m ++CONFIG_IP_VS_SH=m ++CONFIG_IP_VS_SED=m ++CONFIG_IP_VS_NQ=m ++ ++# ++# IPVS application helper ++# ++CONFIG_IP_VS_FTP=m ++ ++# ++# IP: Netfilter Configuration ++# ++CONFIG_NF_DEFRAG_IPV4=m ++CONFIG_NF_CONNTRACK_IPV4=m ++CONFIG_NF_CONNTRACK_PROC_COMPAT=y ++CONFIG_IP_NF_QUEUE=m ++CONFIG_IP_NF_IPTABLES=m ++CONFIG_IP_NF_MATCH_ADDRTYPE=m ++CONFIG_IP_NF_MATCH_AH=m ++CONFIG_IP_NF_MATCH_ECN=m ++CONFIG_IP_NF_MATCH_TTL=m ++CONFIG_IP_NF_FILTER=m ++CONFIG_IP_NF_TARGET_REJECT=m ++CONFIG_IP_NF_TARGET_LOG=m ++CONFIG_IP_NF_TARGET_ULOG=m ++CONFIG_NF_NAT=m ++CONFIG_NF_NAT_NEEDED=y ++CONFIG_IP_NF_TARGET_MASQUERADE=m ++CONFIG_IP_NF_TARGET_NETMAP=m ++CONFIG_IP_NF_TARGET_REDIRECT=m ++CONFIG_NF_NAT_SNMP_BASIC=m ++CONFIG_NF_NAT_PROTO_DCCP=m ++CONFIG_NF_NAT_PROTO_GRE=m ++CONFIG_NF_NAT_PROTO_UDPLITE=m ++CONFIG_NF_NAT_PROTO_SCTP=m ++CONFIG_NF_NAT_FTP=m ++CONFIG_NF_NAT_IRC=m ++CONFIG_NF_NAT_TFTP=m ++CONFIG_NF_NAT_AMANDA=m ++CONFIG_NF_NAT_PPTP=m ++CONFIG_NF_NAT_H323=m ++CONFIG_NF_NAT_SIP=m ++CONFIG_IP_NF_MANGLE=m ++CONFIG_IP_NF_TARGET_CLUSTERIP=m ++CONFIG_IP_NF_TARGET_ECN=m ++CONFIG_IP_NF_TARGET_TTL=m ++CONFIG_IP_NF_RAW=m ++CONFIG_IP_NF_ARPTABLES=m ++CONFIG_IP_NF_ARPFILTER=m ++CONFIG_IP_NF_ARP_MANGLE=m ++ ++# ++# IPv6: Netfilter Configuration ++# ++CONFIG_NF_CONNTRACK_IPV6=m ++CONFIG_IP6_NF_QUEUE=m ++CONFIG_IP6_NF_IPTABLES=m ++CONFIG_IP6_NF_MATCH_AH=m ++CONFIG_IP6_NF_MATCH_EUI64=m ++CONFIG_IP6_NF_MATCH_FRAG=m ++CONFIG_IP6_NF_MATCH_OPTS=m ++CONFIG_IP6_NF_MATCH_HL=m ++CONFIG_IP6_NF_MATCH_IPV6HEADER=m ++CONFIG_IP6_NF_MATCH_MH=m ++CONFIG_IP6_NF_MATCH_RT=m ++CONFIG_IP6_NF_TARGET_HL=m ++CONFIG_IP6_NF_TARGET_LOG=m ++CONFIG_IP6_NF_FILTER=m ++CONFIG_IP6_NF_TARGET_REJECT=m ++CONFIG_IP6_NF_MANGLE=m ++CONFIG_IP6_NF_RAW=m ++# CONFIG_BRIDGE_NF_EBTABLES is not set ++CONFIG_IP_DCCP=m ++CONFIG_INET_DCCP_DIAG=m ++ ++# ++# DCCP CCIDs Configuration (EXPERIMENTAL) ++# ++# CONFIG_IP_DCCP_CCID2_DEBUG is not set ++CONFIG_IP_DCCP_CCID3=y ++# CONFIG_IP_DCCP_CCID3_DEBUG is not set ++CONFIG_IP_DCCP_CCID3_RTO=100 ++CONFIG_IP_DCCP_TFRC_LIB=y ++ ++# ++# DCCP Kernel Hacking ++# ++# CONFIG_IP_DCCP_DEBUG is not set ++CONFIG_IP_SCTP=m ++# CONFIG_SCTP_DBG_MSG is not set ++# CONFIG_SCTP_DBG_OBJCNT is not set ++# CONFIG_SCTP_HMAC_NONE is not set ++# CONFIG_SCTP_HMAC_SHA1 is not set ++CONFIG_SCTP_HMAC_MD5=y ++# CONFIG_RDS is not set ++CONFIG_TIPC=m ++# CONFIG_TIPC_ADVANCED is not set ++# CONFIG_TIPC_DEBUG is not set ++CONFIG_ATM=m ++CONFIG_ATM_CLIP=m ++# CONFIG_ATM_CLIP_NO_ICMP is not set ++CONFIG_ATM_LANE=m ++CONFIG_ATM_MPOA=m ++CONFIG_ATM_BR2684=m ++# CONFIG_ATM_BR2684_IPFILTER is not set ++CONFIG_STP=m ++CONFIG_GARP=m ++CONFIG_BRIDGE=m ++# CONFIG_NET_DSA is not set ++CONFIG_VLAN_8021Q=m ++CONFIG_VLAN_8021Q_GVRP=y ++# CONFIG_DECNET is not set ++CONFIG_LLC=m ++# CONFIG_LLC2 is not set ++# CONFIG_IPX is not set ++# CONFIG_ATALK is not set ++# CONFIG_X25 is not set ++# CONFIG_LAPB is not set ++# CONFIG_ECONET is not set ++CONFIG_WAN_ROUTER=m ++# CONFIG_PHONET is not set ++# CONFIG_IEEE802154 is not set ++CONFIG_NET_SCHED=y ++ ++# ++# Queueing/Scheduling ++# ++CONFIG_NET_SCH_CBQ=m ++CONFIG_NET_SCH_HTB=m ++CONFIG_NET_SCH_HFSC=m ++CONFIG_NET_SCH_ATM=m ++CONFIG_NET_SCH_PRIO=m ++CONFIG_NET_SCH_MULTIQ=m ++CONFIG_NET_SCH_RED=m ++CONFIG_NET_SCH_SFQ=m ++CONFIG_NET_SCH_TEQL=m ++CONFIG_NET_SCH_TBF=m ++CONFIG_NET_SCH_GRED=m ++CONFIG_NET_SCH_DSMARK=m ++CONFIG_NET_SCH_NETEM=m ++CONFIG_NET_SCH_DRR=m ++ ++# ++# Classification ++# ++CONFIG_NET_CLS=y ++CONFIG_NET_CLS_BASIC=m ++CONFIG_NET_CLS_TCINDEX=m ++CONFIG_NET_CLS_ROUTE4=m ++CONFIG_NET_CLS_ROUTE=y ++CONFIG_NET_CLS_FW=m ++CONFIG_NET_CLS_U32=m ++CONFIG_CLS_U32_PERF=y ++CONFIG_CLS_U32_MARK=y ++CONFIG_NET_CLS_RSVP=m ++CONFIG_NET_CLS_RSVP6=m ++CONFIG_NET_CLS_FLOW=m ++# CONFIG_NET_EMATCH is not set ++# CONFIG_NET_CLS_ACT is not set ++CONFIG_NET_CLS_IND=y ++CONFIG_NET_SCH_FIFO=y ++# CONFIG_DCB is not set ++ ++# ++# Network testing ++# ++# CONFIG_NET_PKTGEN is not set ++# CONFIG_NET_DROP_MONITOR is not set ++# CONFIG_HAMRADIO is not set ++CONFIG_CAN=m ++CONFIG_CAN_RAW=m ++CONFIG_CAN_BCM=m ++ ++# ++# CAN Device Drivers ++# ++CONFIG_CAN_VCAN=m ++# CONFIG_CAN_DEV is not set ++# CONFIG_CAN_DEBUG_DEVICES is not set ++CONFIG_IRDA=m ++ ++# ++# IrDA protocols ++# ++CONFIG_IRLAN=m ++CONFIG_IRNET=m ++CONFIG_IRCOMM=m ++CONFIG_IRDA_ULTRA=y ++ ++# ++# IrDA options ++# ++CONFIG_IRDA_CACHE_LAST_LSAP=y ++CONFIG_IRDA_FAST_RR=y ++CONFIG_IRDA_DEBUG=y ++ ++# ++# Infrared-port device drivers ++# ++ ++# ++# SIR device drivers ++# ++CONFIG_IRTTY_SIR=m ++ ++# ++# Dongle support ++# ++CONFIG_DONGLE=y ++CONFIG_ESI_DONGLE=m ++CONFIG_ACTISYS_DONGLE=m ++CONFIG_TEKRAM_DONGLE=m ++CONFIG_TOIM3232_DONGLE=m ++CONFIG_LITELINK_DONGLE=m ++CONFIG_MA600_DONGLE=m ++CONFIG_GIRBIL_DONGLE=m ++CONFIG_MCP2120_DONGLE=m ++CONFIG_OLD_BELKIN_DONGLE=m ++# CONFIG_ACT200L_DONGLE is not set ++CONFIG_KINGSUN_DONGLE=m ++CONFIG_KSDAZZLE_DONGLE=m ++CONFIG_KS959_DONGLE=m ++ ++# ++# FIR device drivers ++# ++CONFIG_USB_IRDA=m ++CONFIG_SIGMATEL_FIR=m ++CONFIG_MCS_FIR=m ++CONFIG_BT=m ++CONFIG_BT_L2CAP=m ++CONFIG_BT_SCO=m ++CONFIG_BT_RFCOMM=m ++CONFIG_BT_RFCOMM_TTY=y ++CONFIG_BT_BNEP=m ++CONFIG_BT_BNEP_MC_FILTER=y ++CONFIG_BT_BNEP_PROTO_FILTER=y ++CONFIG_BT_HIDP=m ++ ++# ++# Bluetooth device drivers ++# ++CONFIG_BT_HCIBTUSB=m ++CONFIG_BT_HCIBTSDIO=m ++CONFIG_BT_HCIUART=m ++CONFIG_BT_HCIUART_H4=y ++CONFIG_BT_HCIUART_BCSP=y ++CONFIG_BT_HCIUART_LL=y ++CONFIG_BT_HCIBCM203X=m ++CONFIG_BT_HCIBPA10X=m ++CONFIG_BT_HCIBFUSB=m ++# CONFIG_BT_HCIVHCI is not set ++# CONFIG_BT_MRVL is not set ++CONFIG_AF_RXRPC=m ++# CONFIG_AF_RXRPC_DEBUG is not set ++# CONFIG_RXKAD is not set ++CONFIG_FIB_RULES=y ++CONFIG_WIRELESS=y ++CONFIG_WIRELESS_EXT=y ++CONFIG_WEXT_CORE=y ++CONFIG_WEXT_PROC=y ++CONFIG_WEXT_SPY=y ++CONFIG_WEXT_PRIV=y ++CONFIG_CFG80211=m ++# CONFIG_NL80211_TESTMODE is not set ++# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set ++# CONFIG_CFG80211_REG_DEBUG is not set ++CONFIG_CFG80211_DEFAULT_PS=y ++# CONFIG_CFG80211_DEBUGFS is not set ++CONFIG_WIRELESS_OLD_REGULATORY=y ++CONFIG_CFG80211_WEXT=y ++CONFIG_WIRELESS_EXT_SYSFS=y ++CONFIG_LIB80211=y ++CONFIG_LIB80211_CRYPT_WEP=m ++CONFIG_LIB80211_CRYPT_CCMP=m ++CONFIG_LIB80211_CRYPT_TKIP=m ++# CONFIG_LIB80211_DEBUG is not set ++CONFIG_MAC80211=m ++CONFIG_MAC80211_RC_PID=y ++# CONFIG_MAC80211_RC_MINSTREL is not set ++CONFIG_MAC80211_RC_DEFAULT_PID=y ++# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set ++CONFIG_MAC80211_RC_DEFAULT="pid" ++# CONFIG_MAC80211_MESH is not set ++CONFIG_MAC80211_LEDS=y ++# CONFIG_MAC80211_DEBUGFS is not set ++# CONFIG_MAC80211_DEBUG_MENU is not set ++CONFIG_WIMAX=m ++CONFIG_WIMAX_DEBUG_LEVEL=8 ++CONFIG_RFKILL=m ++CONFIG_RFKILL_LEDS=y ++CONFIG_RFKILL_INPUT=y ++CONFIG_NET_9P=m ++# CONFIG_NET_9P_DEBUG is not set ++ ++# ++# Device Drivers ++# ++ ++# ++# Generic Driver Options ++# ++CONFIG_UEVENT_HELPER_PATH="" ++CONFIG_DEVTMPFS=y ++CONFIG_DEVTMPFS_MOUNT=y ++CONFIG_STANDALONE=y ++CONFIG_PREVENT_FIRMWARE_BUILD=y ++CONFIG_FW_LOADER=y ++CONFIG_FIRMWARE_IN_KERNEL=y ++CONFIG_EXTRA_FIRMWARE="" ++# CONFIG_DEBUG_DRIVER is not set ++# CONFIG_DEBUG_DEVRES is not set ++# CONFIG_SYS_HYPERVISOR is not set ++# CONFIG_CONNECTOR is not set ++CONFIG_MTD=y ++# CONFIG_MTD_DEBUG is not set ++# CONFIG_MTD_TESTS is not set ++CONFIG_MTD_CONCAT=y ++CONFIG_MTD_PARTITIONS=y ++# CONFIG_MTD_REDBOOT_PARTS is not set ++# CONFIG_MTD_CMDLINE_PARTS is not set ++# CONFIG_MTD_AFS_PARTS is not set ++# CONFIG_MTD_AR7_PARTS is not set ++ ++# ++# User Modules And Translation Layers ++# ++CONFIG_MTD_CHAR=y ++CONFIG_MTD_BLKDEVS=y ++CONFIG_MTD_BLOCK=y ++# CONFIG_FTL is not set ++# CONFIG_NFTL is not set ++# CONFIG_INFTL is not set ++# CONFIG_RFD_FTL is not set ++# CONFIG_SSFDC is not set ++# CONFIG_MTD_OOPS is not set ++ ++# ++# RAM/ROM/Flash chip drivers ++# ++# CONFIG_MTD_CFI is not set ++# CONFIG_MTD_JEDECPROBE is not set ++CONFIG_MTD_MAP_BANK_WIDTH_1=y ++CONFIG_MTD_MAP_BANK_WIDTH_2=y ++CONFIG_MTD_MAP_BANK_WIDTH_4=y ++# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set ++# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set ++# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set ++CONFIG_MTD_CFI_I1=y ++CONFIG_MTD_CFI_I2=y ++# CONFIG_MTD_CFI_I4 is not set ++# CONFIG_MTD_CFI_I8 is not set ++# CONFIG_MTD_RAM is not set ++# CONFIG_MTD_ROM is not set ++# CONFIG_MTD_ABSENT is not set ++ ++# ++# Mapping drivers for chip access ++# ++# CONFIG_MTD_COMPLEX_MAPPINGS is not set ++# CONFIG_MTD_PLATRAM is not set ++ ++# ++# Self-contained MTD device drivers ++# ++# CONFIG_MTD_DATAFLASH is not set ++# CONFIG_MTD_M25P80 is not set ++# CONFIG_MTD_SST25L is not set ++# CONFIG_MTD_SLRAM is not set ++# CONFIG_MTD_PHRAM is not set ++# CONFIG_MTD_MTDRAM is not set ++# CONFIG_MTD_BLOCK2MTD is not set ++ ++# ++# Disk-On-Chip Device Drivers ++# ++# CONFIG_MTD_DOC2000 is not set ++# CONFIG_MTD_DOC2001 is not set ++# CONFIG_MTD_DOC2001PLUS is not set ++CONFIG_MTD_NAND=y ++# CONFIG_MTD_NAND_VERIFY_WRITE is not set ++# CONFIG_MTD_NAND_ECC_SMC is not set ++# CONFIG_MTD_NAND_MUSEUM_IDS is not set ++# CONFIG_MTD_NAND_GPIO is not set ++CONFIG_MTD_NAND_OMAP2=y ++CONFIG_MTD_NAND_OMAP_PREFETCH=y ++# CONFIG_MTD_NAND_OMAP_PREFETCH_DMA is not set ++CONFIG_MTD_NAND_IDS=y ++# CONFIG_MTD_NAND_DISKONCHIP is not set ++# CONFIG_MTD_NAND_NANDSIM is not set ++CONFIG_MTD_NAND_PLATFORM=y ++# CONFIG_MTD_ALAUDA is not set ++# CONFIG_MTD_ONENAND is not set ++ ++# ++# LPDDR flash memory drivers ++# ++# CONFIG_MTD_LPDDR is not set ++ ++# ++# UBI - Unsorted block images ++# ++CONFIG_MTD_UBI=y ++CONFIG_MTD_UBI_WL_THRESHOLD=4096 ++CONFIG_MTD_UBI_BEB_RESERVE=1 ++# CONFIG_MTD_UBI_GLUEBI is not set ++ ++# ++# UBI debugging options ++# ++# CONFIG_MTD_UBI_DEBUG is not set ++# CONFIG_PARPORT is not set ++CONFIG_BLK_DEV=y ++# CONFIG_BLK_DEV_COW_COMMON is not set ++CONFIG_BLK_DEV_LOOP=y ++CONFIG_BLK_DEV_CRYPTOLOOP=m ++ ++# ++# DRBD disabled because PROC_FS, INET or CONNECTOR not selected ++# ++# CONFIG_BLK_DEV_NBD is not set ++# CONFIG_BLK_DEV_UB is not set ++CONFIG_BLK_DEV_RAM=y ++CONFIG_BLK_DEV_RAM_COUNT=16 ++CONFIG_BLK_DEV_RAM_SIZE=16384 ++# CONFIG_BLK_DEV_XIP is not set ++CONFIG_CDROM_PKTCDVD=m ++CONFIG_CDROM_PKTCDVD_BUFFERS=8 ++# CONFIG_CDROM_PKTCDVD_WCACHE is not set ++# CONFIG_ATA_OVER_ETH is not set ++# CONFIG_MG_DISK is not set ++CONFIG_MISC_DEVICES=y ++# CONFIG_AD525X_DPOT is not set ++# CONFIG_ICS932S401 is not set ++# CONFIG_ENCLOSURE_SERVICES is not set ++CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7 ++# CONFIG_ISL29003 is not set ++# CONFIG_DS1682 is not set ++# CONFIG_TI_DAC7512 is not set ++# CONFIG_C2PORT is not set ++ ++# ++# EEPROM support ++# ++# CONFIG_EEPROM_AT24 is not set ++# CONFIG_EEPROM_AT25 is not set ++# CONFIG_EEPROM_LEGACY is not set ++# CONFIG_EEPROM_MAX6875 is not set ++CONFIG_EEPROM_93CX6=y ++CONFIG_IWMC3200TOP=m ++# CONFIG_IWMC3200TOP_DEBUG is not set ++# CONFIG_IWMC3200TOP_DEBUGFS is not set ++CONFIG_HAVE_IDE=y ++# CONFIG_IDE is not set ++ ++# ++# SCSI device support ++# ++CONFIG_RAID_ATTRS=m ++CONFIG_SCSI=y ++CONFIG_SCSI_DMA=y ++# CONFIG_SCSI_TGT is not set ++# CONFIG_SCSI_NETLINK is not set ++CONFIG_SCSI_PROC_FS=y ++ ++# ++# SCSI support type (disk, tape, CD-ROM) ++# ++CONFIG_BLK_DEV_SD=y ++# CONFIG_CHR_DEV_ST is not set ++# CONFIG_CHR_DEV_OSST is not set ++CONFIG_BLK_DEV_SR=y ++CONFIG_BLK_DEV_SR_VENDOR=y ++CONFIG_CHR_DEV_SG=y ++CONFIG_CHR_DEV_SCH=m ++CONFIG_SCSI_MULTI_LUN=y ++# CONFIG_SCSI_CONSTANTS is not set ++# CONFIG_SCSI_LOGGING is not set ++# CONFIG_SCSI_SCAN_ASYNC is not set ++CONFIG_SCSI_WAIT_SCAN=m ++ ++# ++# SCSI Transports ++# ++# CONFIG_SCSI_SPI_ATTRS is not set ++# CONFIG_SCSI_FC_ATTRS is not set ++CONFIG_SCSI_ISCSI_ATTRS=m ++# CONFIG_SCSI_SAS_ATTRS is not set ++# CONFIG_SCSI_SAS_LIBSAS is not set ++# CONFIG_SCSI_SRP_ATTRS is not set ++CONFIG_SCSI_LOWLEVEL=y ++CONFIG_ISCSI_TCP=m ++# CONFIG_LIBFC is not set ++# CONFIG_LIBFCOE is not set ++# CONFIG_SCSI_DEBUG is not set ++# CONFIG_SCSI_DH is not set ++# CONFIG_SCSI_OSD_INITIATOR is not set ++# CONFIG_ATA is not set ++CONFIG_MD=y ++CONFIG_BLK_DEV_MD=m ++CONFIG_MD_LINEAR=m ++CONFIG_MD_RAID0=m ++CONFIG_MD_RAID1=m ++CONFIG_MD_RAID10=m ++CONFIG_MD_RAID456=m ++CONFIG_MD_RAID6_PQ=m ++# CONFIG_ASYNC_RAID6_TEST is not set ++CONFIG_MD_MULTIPATH=m ++CONFIG_MD_FAULTY=m ++CONFIG_BLK_DEV_DM=m ++# CONFIG_DM_DEBUG is not set ++CONFIG_DM_CRYPT=m ++CONFIG_DM_SNAPSHOT=m ++CONFIG_DM_MIRROR=m ++# CONFIG_DM_LOG_USERSPACE is not set ++CONFIG_DM_ZERO=m ++CONFIG_DM_MULTIPATH=m ++# CONFIG_DM_MULTIPATH_QL is not set ++# CONFIG_DM_MULTIPATH_ST is not set ++CONFIG_DM_DELAY=m ++# CONFIG_DM_UEVENT is not set ++CONFIG_NETDEVICES=y ++CONFIG_DUMMY=m ++CONFIG_BONDING=m ++CONFIG_MACVLAN=m ++CONFIG_EQUALIZER=m ++CONFIG_TUN=m ++CONFIG_VETH=m ++CONFIG_PHYLIB=y ++ ++# ++# MII PHY device drivers ++# ++# CONFIG_MARVELL_PHY is not set ++# CONFIG_DAVICOM_PHY is not set ++# CONFIG_QSEMI_PHY is not set ++# CONFIG_LXT_PHY is not set ++# CONFIG_CICADA_PHY is not set ++# CONFIG_VITESSE_PHY is not set ++# CONFIG_SMSC_PHY is not set ++# CONFIG_BROADCOM_PHY is not set ++# CONFIG_ICPLUS_PHY is not set ++# CONFIG_REALTEK_PHY is not set ++# CONFIG_NATIONAL_PHY is not set ++# CONFIG_STE10XP is not set ++# CONFIG_LSI_ET1011C_PHY is not set ++# CONFIG_FIXED_PHY is not set ++# CONFIG_MDIO_BITBANG is not set ++CONFIG_NET_ETHERNET=y ++CONFIG_MII=y ++# CONFIG_AX88796 is not set ++# CONFIG_SMC91X is not set ++# CONFIG_TI_DAVINCI_EMAC is not set ++# CONFIG_DM9000 is not set ++CONFIG_ENC28J60=y ++# CONFIG_ENC28J60_WRITEVERIFY is not set ++# CONFIG_ETHOC is not set ++CONFIG_SMC911X=y ++CONFIG_SMSC911X=y ++# CONFIG_DNET is not set ++# CONFIG_IBM_NEW_EMAC_ZMII is not set ++# CONFIG_IBM_NEW_EMAC_RGMII is not set ++# CONFIG_IBM_NEW_EMAC_TAH is not set ++# CONFIG_IBM_NEW_EMAC_EMAC4 is not set ++# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set ++# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set ++# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set ++# CONFIG_B44 is not set ++# CONFIG_KS8842 is not set ++CONFIG_KS8851=y ++# CONFIG_KS8851_MLL is not set ++# CONFIG_NETDEV_1000 is not set ++# CONFIG_NETDEV_10000 is not set ++CONFIG_WLAN=y ++# CONFIG_LIBERTAS_THINFIRM is not set ++CONFIG_AT76C50X_USB=m ++CONFIG_USB_ZD1201=m ++CONFIG_USB_NET_RNDIS_WLAN=m ++CONFIG_RTL8187=m ++CONFIG_RTL8187_LEDS=y ++# CONFIG_MAC80211_HWSIM is not set ++# CONFIG_ATH_COMMON is not set ++CONFIG_B43=m ++# CONFIG_B43_SDIO is not set ++CONFIG_B43_PHY_LP=y ++CONFIG_B43_LEDS=y ++CONFIG_B43_HWRNG=y ++# CONFIG_B43_DEBUG is not set ++# CONFIG_B43LEGACY is not set ++CONFIG_HOSTAP=m ++CONFIG_HOSTAP_FIRMWARE=y ++CONFIG_HOSTAP_FIRMWARE_NVRAM=y ++# CONFIG_IWM is not set ++CONFIG_LIBERTAS=m ++CONFIG_LIBERTAS_USB=m ++# CONFIG_LIBERTAS_SDIO is not set ++# CONFIG_LIBERTAS_SPI is not set ++# CONFIG_LIBERTAS_DEBUG is not set ++CONFIG_P54_COMMON=m ++CONFIG_P54_USB=m ++# CONFIG_P54_SPI is not set ++CONFIG_P54_LEDS=y ++CONFIG_RT2X00=m ++CONFIG_RT2500USB=m ++CONFIG_RT73USB=m ++# CONFIG_RT2800USB is not set ++CONFIG_RT2X00_LIB_USB=m ++CONFIG_RT2X00_LIB=m ++CONFIG_RT2X00_LIB_FIRMWARE=y ++CONFIG_RT2X00_LIB_CRYPTO=y ++CONFIG_RT2X00_LIB_LEDS=y ++# CONFIG_RT2X00_DEBUG is not set ++CONFIG_WL12XX=m ++CONFIG_WL1251=m ++CONFIG_WL1251_SPI=m ++CONFIG_WL1251_SDIO=m ++CONFIG_WL1271=m ++CONFIG_ZD1211RW=m ++# CONFIG_ZD1211RW_DEBUG is not set ++ ++# ++# WiMAX Wireless Broadband devices ++# ++CONFIG_WIMAX_I2400M=m ++CONFIG_WIMAX_I2400M_USB=m ++CONFIG_WIMAX_I2400M_SDIO=m ++CONFIG_WIMAX_IWMC3200_SDIO=y ++CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8 ++ ++# ++# USB Network Adapters ++# ++CONFIG_USB_CATC=y ++CONFIG_USB_KAWETH=y ++CONFIG_USB_PEGASUS=y ++CONFIG_USB_RTL8150=y ++CONFIG_USB_USBNET=y ++CONFIG_USB_NET_AX8817X=y ++CONFIG_USB_NET_CDCETHER=y ++CONFIG_USB_NET_CDC_EEM=y ++CONFIG_USB_NET_DM9601=y ++CONFIG_USB_NET_SMSC95XX=y ++CONFIG_USB_NET_GL620A=y ++CONFIG_USB_NET_NET1080=y ++CONFIG_USB_NET_PLUSB=y ++CONFIG_USB_NET_MCS7830=y ++CONFIG_USB_NET_RNDIS_HOST=y ++CONFIG_USB_NET_CDC_SUBSET=y ++CONFIG_USB_ALI_M5632=y ++CONFIG_USB_AN2720=y ++CONFIG_USB_BELKIN=y ++CONFIG_USB_ARMLINUX=y ++CONFIG_USB_EPSON2888=y ++CONFIG_USB_KC2190=y ++CONFIG_USB_NET_ZAURUS=y ++CONFIG_USB_HSO=m ++CONFIG_USB_NET_INT51X1=m ++# CONFIG_WAN is not set ++CONFIG_ATM_DRIVERS=y ++# CONFIG_ATM_DUMMY is not set ++# CONFIG_ATM_TCP is not set ++CONFIG_PPP=m ++CONFIG_PPP_MULTILINK=y ++CONFIG_PPP_FILTER=y ++CONFIG_PPP_ASYNC=m ++CONFIG_PPP_SYNC_TTY=m ++CONFIG_PPP_DEFLATE=m ++CONFIG_PPP_BSDCOMP=m ++CONFIG_PPP_MPPE=m ++CONFIG_PPPOE=m ++# CONFIG_PPPOATM is not set ++CONFIG_PPPOL2TP=m ++# CONFIG_SLIP is not set ++CONFIG_SLHC=m ++CONFIG_NETCONSOLE=m ++CONFIG_NETCONSOLE_DYNAMIC=y ++CONFIG_NETPOLL=y ++CONFIG_NETPOLL_TRAP=y ++CONFIG_NET_POLL_CONTROLLER=y ++# CONFIG_ISDN is not set ++# CONFIG_PHONE is not set ++ ++# ++# Input device support ++# ++CONFIG_INPUT=y ++CONFIG_INPUT_FF_MEMLESS=y ++CONFIG_INPUT_POLLDEV=y ++# CONFIG_INPUT_SPARSEKMAP is not set ++ ++# ++# Userland interfaces ++# ++CONFIG_INPUT_MOUSEDEV=y ++CONFIG_INPUT_MOUSEDEV_PSAUX=y ++CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 ++CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 ++# CONFIG_INPUT_JOYDEV is not set ++CONFIG_INPUT_EVDEV=y ++# CONFIG_INPUT_EVBUG is not set ++ ++# ++# Input Device Drivers ++# ++CONFIG_INPUT_KEYBOARD=y ++# CONFIG_KEYBOARD_ADP5588 is not set ++# CONFIG_KEYBOARD_ATKBD is not set ++# CONFIG_QT2160 is not set ++# CONFIG_KEYBOARD_LKKBD is not set ++CONFIG_KEYBOARD_GPIO=y ++# CONFIG_KEYBOARD_TCA6416 is not set ++# CONFIG_KEYBOARD_MATRIX is not set ++# CONFIG_KEYBOARD_LM8323 is not set ++# CONFIG_KEYBOARD_MAX7359 is not set ++# CONFIG_KEYBOARD_NEWTON is not set ++# CONFIG_KEYBOARD_OPENCORES is not set ++# CONFIG_KEYBOARD_STOWAWAY is not set ++# CONFIG_KEYBOARD_SUNKBD is not set ++# CONFIG_KEYBOARD_TWL4030 is not set ++# CONFIG_KEYBOARD_XTKBD is not set ++CONFIG_INPUT_MOUSE=y ++CONFIG_MOUSE_PS2=y ++CONFIG_MOUSE_PS2_ALPS=y ++CONFIG_MOUSE_PS2_LOGIPS2PP=y ++CONFIG_MOUSE_PS2_SYNAPTICS=y ++CONFIG_MOUSE_PS2_TRACKPOINT=y ++# CONFIG_MOUSE_PS2_ELANTECH is not set ++# CONFIG_MOUSE_PS2_SENTELIC is not set ++# CONFIG_MOUSE_PS2_TOUCHKIT is not set ++# CONFIG_MOUSE_SERIAL is not set ++# CONFIG_MOUSE_APPLETOUCH is not set ++# CONFIG_MOUSE_BCM5974 is not set ++# CONFIG_MOUSE_VSXXXAA is not set ++# CONFIG_MOUSE_GPIO is not set ++# CONFIG_MOUSE_SYNAPTICS_I2C is not set ++# CONFIG_INPUT_JOYSTICK is not set ++# CONFIG_INPUT_TABLET is not set ++# CONFIG_INPUT_TOUCHSCREEN is not set ++CONFIG_INPUT_MISC=y ++# CONFIG_INPUT_ATI_REMOTE is not set ++# CONFIG_INPUT_ATI_REMOTE2 is not set ++# CONFIG_INPUT_KEYSPAN_REMOTE is not set ++# CONFIG_INPUT_POWERMATE is not set ++# CONFIG_INPUT_YEALINK is not set ++# CONFIG_INPUT_CM109 is not set ++CONFIG_INPUT_TWL4030_PWRBUTTON=y ++CONFIG_INPUT_UINPUT=y ++# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set ++ ++# ++# Hardware I/O ports ++# ++CONFIG_SERIO=y ++CONFIG_SERIO_SERPORT=y ++CONFIG_SERIO_LIBPS2=y ++# CONFIG_SERIO_RAW is not set ++# CONFIG_SERIO_ALTERA_PS2 is not set ++# CONFIG_GAMEPORT is not set ++ ++# ++# Character devices ++# ++CONFIG_VT=y ++CONFIG_CONSOLE_TRANSLATIONS=y ++CONFIG_VT_CONSOLE=y ++CONFIG_HW_CONSOLE=y ++CONFIG_VT_HW_CONSOLE_BINDING=y ++CONFIG_DEVKMEM=y ++# CONFIG_SERIAL_NONSTANDARD is not set ++ ++# ++# Serial drivers ++# ++CONFIG_SERIAL_8250=y ++CONFIG_SERIAL_8250_CONSOLE=y ++CONFIG_SERIAL_8250_NR_UARTS=32 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=4 ++CONFIG_SERIAL_8250_EXTENDED=y ++CONFIG_SERIAL_8250_MANY_PORTS=y ++CONFIG_SERIAL_8250_SHARE_IRQ=y ++CONFIG_SERIAL_8250_DETECT_IRQ=y ++CONFIG_SERIAL_8250_RSA=y ++ ++# ++# Non-8250 serial port support ++# ++# CONFIG_SERIAL_MAX3100 is not set ++CONFIG_SERIAL_CORE=y ++CONFIG_SERIAL_CORE_CONSOLE=y ++CONFIG_UNIX98_PTYS=y ++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set ++# CONFIG_LEGACY_PTYS is not set ++# CONFIG_IPMI_HANDLER is not set ++CONFIG_HW_RANDOM=y ++# CONFIG_HW_RANDOM_TIMERIOMEM is not set ++# CONFIG_R3964 is not set ++# CONFIG_RAW_DRIVER is not set ++# CONFIG_TCG_TPM is not set ++CONFIG_I2C=y ++CONFIG_I2C_BOARDINFO=y ++CONFIG_I2C_COMPAT=y ++CONFIG_I2C_CHARDEV=y ++CONFIG_I2C_HELPER_AUTO=y ++ ++# ++# I2C Hardware Bus support ++# ++ ++# ++# I2C system bus drivers (mostly embedded / system-on-chip) ++# ++# CONFIG_I2C_DESIGNWARE is not set ++# CONFIG_I2C_GPIO is not set ++# CONFIG_I2C_OCORES is not set ++CONFIG_I2C_OMAP=y ++# CONFIG_I2C_SIMTEC is not set ++ ++# ++# External I2C/SMBus adapter drivers ++# ++# CONFIG_I2C_PARPORT_LIGHT is not set ++# CONFIG_I2C_TAOS_EVM is not set ++# CONFIG_I2C_TINY_USB is not set ++ ++# ++# Other I2C/SMBus bus drivers ++# ++# CONFIG_I2C_PCA_PLATFORM is not set ++# CONFIG_I2C_STUB is not set ++ ++# ++# Miscellaneous I2C Chip support ++# ++# CONFIG_SENSORS_TSL2550 is not set ++# CONFIG_I2C_DEBUG_CORE is not set ++# CONFIG_I2C_DEBUG_ALGO is not set ++# CONFIG_I2C_DEBUG_BUS is not set ++# CONFIG_I2C_DEBUG_CHIP is not set ++CONFIG_SPI=y ++# CONFIG_SPI_DEBUG is not set ++CONFIG_SPI_MASTER=y ++ ++# ++# SPI Master Controller Drivers ++# ++# CONFIG_SPI_BITBANG is not set ++# CONFIG_SPI_GPIO is not set ++CONFIG_SPI_OMAP24XX=y ++# CONFIG_SPI_XILINX is not set ++ ++# ++# SPI Protocol Masters ++# ++CONFIG_SPI_SPIDEV=y ++# CONFIG_SPI_TLE62X0 is not set ++ ++# ++# PPS support ++# ++# CONFIG_PPS is not set ++CONFIG_ARCH_REQUIRE_GPIOLIB=y ++CONFIG_GPIOLIB=y ++# CONFIG_DEBUG_GPIO is not set ++CONFIG_GPIO_SYSFS=y ++ ++# ++# Memory mapped GPIO expanders: ++# ++ ++# ++# I2C GPIO expanders: ++# ++# CONFIG_GPIO_MAX732X is not set ++# CONFIG_GPIO_PCA953X is not set ++# CONFIG_GPIO_PCF857X is not set ++CONFIG_GPIO_TWL4030=y ++ ++# ++# PCI GPIO expanders: ++# ++ ++# ++# SPI GPIO expanders: ++# ++# CONFIG_GPIO_MAX7301 is not set ++# CONFIG_GPIO_MCP23S08 is not set ++# CONFIG_GPIO_MC33880 is not set ++ ++# ++# AC97 GPIO expanders: ++# ++# CONFIG_W1 is not set ++CONFIG_POWER_SUPPLY=m ++# CONFIG_POWER_SUPPLY_DEBUG is not set ++# CONFIG_PDA_POWER is not set ++# CONFIG_BATTERY_DS2760 is not set ++# CONFIG_BATTERY_DS2782 is not set ++# CONFIG_BATTERY_BQ27x00 is not set ++# CONFIG_BATTERY_MAX17040 is not set ++CONFIG_HWMON=y ++# CONFIG_HWMON_VID is not set ++# CONFIG_HWMON_DEBUG_CHIP is not set ++ ++# ++# Native drivers ++# ++# CONFIG_SENSORS_AD7414 is not set ++# CONFIG_SENSORS_AD7418 is not set ++# CONFIG_SENSORS_ADCXX is not set ++# CONFIG_SENSORS_ADM1021 is not set ++# CONFIG_SENSORS_ADM1025 is not set ++# CONFIG_SENSORS_ADM1026 is not set ++# CONFIG_SENSORS_ADM1029 is not set ++# CONFIG_SENSORS_ADM1031 is not set ++# CONFIG_SENSORS_ADM9240 is not set ++# CONFIG_SENSORS_ADT7462 is not set ++# CONFIG_SENSORS_ADT7470 is not set ++# CONFIG_SENSORS_ADT7473 is not set ++# CONFIG_SENSORS_ADT7475 is not set ++# CONFIG_SENSORS_ATXP1 is not set ++# CONFIG_SENSORS_DS1621 is not set ++# CONFIG_SENSORS_F71805F is not set ++# CONFIG_SENSORS_F71882FG is not set ++# CONFIG_SENSORS_F75375S is not set ++# CONFIG_SENSORS_G760A is not set ++# CONFIG_SENSORS_GL518SM is not set ++# CONFIG_SENSORS_GL520SM is not set ++# CONFIG_SENSORS_IT87 is not set ++# CONFIG_SENSORS_LM63 is not set ++# CONFIG_SENSORS_LM70 is not set ++# CONFIG_SENSORS_LM73 is not set ++# CONFIG_SENSORS_LM75 is not set ++# CONFIG_SENSORS_LM77 is not set ++# CONFIG_SENSORS_LM78 is not set ++# CONFIG_SENSORS_LM80 is not set ++# CONFIG_SENSORS_LM83 is not set ++# CONFIG_SENSORS_LM85 is not set ++# CONFIG_SENSORS_LM87 is not set ++# CONFIG_SENSORS_LM90 is not set ++# CONFIG_SENSORS_LM92 is not set ++# CONFIG_SENSORS_LM93 is not set ++# CONFIG_SENSORS_LTC4215 is not set ++# CONFIG_SENSORS_LTC4245 is not set ++# CONFIG_SENSORS_LM95241 is not set ++# CONFIG_SENSORS_MAX1111 is not set ++# CONFIG_SENSORS_MAX1619 is not set ++# CONFIG_SENSORS_MAX6650 is not set ++# CONFIG_SENSORS_PC87360 is not set ++# CONFIG_SENSORS_PC87427 is not set ++# CONFIG_SENSORS_PCF8591 is not set ++# CONFIG_SENSORS_SHT15 is not set ++# CONFIG_SENSORS_DME1737 is not set ++# CONFIG_SENSORS_SMSC47M1 is not set ++# CONFIG_SENSORS_SMSC47M192 is not set ++# CONFIG_SENSORS_SMSC47B397 is not set ++# CONFIG_SENSORS_ADS7828 is not set ++# CONFIG_SENSORS_THMC50 is not set ++# CONFIG_SENSORS_TMP401 is not set ++# CONFIG_SENSORS_TMP421 is not set ++# CONFIG_SENSORS_VT1211 is not set ++# CONFIG_SENSORS_W83781D is not set ++# CONFIG_SENSORS_W83791D is not set ++# CONFIG_SENSORS_W83792D is not set ++# CONFIG_SENSORS_W83793 is not set ++# CONFIG_SENSORS_W83L785TS is not set ++# CONFIG_SENSORS_W83L786NG is not set ++# CONFIG_SENSORS_W83627HF is not set ++# CONFIG_SENSORS_W83627EHF is not set ++# CONFIG_SENSORS_LIS3_SPI is not set ++CONFIG_THERMAL=y ++CONFIG_THERMAL_HWMON=y ++CONFIG_WATCHDOG=y ++CONFIG_WATCHDOG_NOWAYOUT=y ++ ++# ++# Watchdog Device Drivers ++# ++# CONFIG_SOFT_WATCHDOG is not set ++CONFIG_OMAP_WATCHDOG=y ++# CONFIG_TWL4030_WATCHDOG is not set ++ ++# ++# USB-based Watchdog Cards ++# ++# CONFIG_USBPCWATCHDOG is not set ++CONFIG_SSB_POSSIBLE=y ++ ++# ++# Sonics Silicon Backplane ++# ++CONFIG_SSB=y ++CONFIG_SSB_SDIOHOST_POSSIBLE=y ++# CONFIG_SSB_SDIOHOST is not set ++# CONFIG_SSB_SILENT is not set ++# CONFIG_SSB_DEBUG is not set ++ ++# ++# Multifunction device drivers ++# ++CONFIG_MFD_CORE=y ++# CONFIG_MFD_SM501 is not set ++# CONFIG_MFD_ASIC3 is not set ++# CONFIG_HTC_EGPIO is not set ++# CONFIG_HTC_PASIC3 is not set ++# CONFIG_TPS65010 is not set ++CONFIG_TWL4030_CORE=y ++CONFIG_TWL4030_POWER=y ++CONFIG_TWL4030_CODEC=y ++# CONFIG_TWL4030_MADC is not set ++# CONFIG_MFD_TMIO is not set ++# CONFIG_MFD_T7L66XB is not set ++# CONFIG_MFD_TC6387XB is not set ++# CONFIG_MFD_TC6393XB is not set ++# CONFIG_PMIC_DA903X is not set ++# CONFIG_PMIC_ADP5520 is not set ++# CONFIG_MFD_WM8400 is not set ++# CONFIG_MFD_WM831X is not set ++# CONFIG_MFD_WM8350_I2C is not set ++# CONFIG_MFD_PCF50633 is not set ++# CONFIG_MFD_MC13783 is not set ++# CONFIG_AB3100_CORE is not set ++# CONFIG_EZX_PCAP is not set ++# CONFIG_MFD_88PM8607 is not set ++# CONFIG_AB4500_CORE is not set ++CONFIG_REGULATOR=y ++# CONFIG_REGULATOR_DEBUG is not set ++# CONFIG_REGULATOR_FIXED_VOLTAGE is not set ++# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set ++# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set ++# CONFIG_REGULATOR_BQ24022 is not set ++# CONFIG_REGULATOR_MAX1586 is not set ++CONFIG_REGULATOR_TWL4030=y ++# CONFIG_REGULATOR_LP3971 is not set ++# CONFIG_REGULATOR_TPS65023 is not set ++# CONFIG_REGULATOR_TPS6507X is not set ++CONFIG_MEDIA_SUPPORT=y ++ ++# ++# Multimedia core support ++# ++CONFIG_VIDEO_DEV=y ++CONFIG_VIDEO_V4L2_COMMON=y ++CONFIG_VIDEO_ALLOW_V4L1=y ++CONFIG_VIDEO_V4L1_COMPAT=y ++CONFIG_DVB_CORE=m ++CONFIG_VIDEO_MEDIA=m ++ ++# ++# Multimedia drivers ++# ++CONFIG_MEDIA_ATTACH=y ++CONFIG_MEDIA_TUNER=m ++CONFIG_MEDIA_TUNER_CUSTOMISE=y ++CONFIG_MEDIA_TUNER_SIMPLE=m ++CONFIG_MEDIA_TUNER_TDA8290=m ++CONFIG_MEDIA_TUNER_TDA827X=m ++CONFIG_MEDIA_TUNER_TDA18271=m ++CONFIG_MEDIA_TUNER_TDA9887=m ++CONFIG_MEDIA_TUNER_TEA5761=m ++CONFIG_MEDIA_TUNER_TEA5767=m ++CONFIG_MEDIA_TUNER_MT20XX=m ++CONFIG_MEDIA_TUNER_MT2060=m ++CONFIG_MEDIA_TUNER_MT2266=m ++CONFIG_MEDIA_TUNER_MT2131=m ++CONFIG_MEDIA_TUNER_QT1010=m ++CONFIG_MEDIA_TUNER_XC2028=m ++CONFIG_MEDIA_TUNER_XC5000=m ++CONFIG_MEDIA_TUNER_MXL5005S=m ++CONFIG_MEDIA_TUNER_MXL5007T=m ++CONFIG_MEDIA_TUNER_MC44S803=m ++CONFIG_MEDIA_TUNER_MAX2165=m ++CONFIG_VIDEO_V4L2=y ++CONFIG_VIDEO_V4L1=y ++CONFIG_VIDEOBUF_GEN=y ++CONFIG_VIDEOBUF_DMA_SG=y ++CONFIG_VIDEOBUF_VMALLOC=m ++CONFIG_VIDEOBUF_DMA_CONTIG=y ++CONFIG_VIDEOBUF_DVB=m ++CONFIG_VIDEO_IR=m ++CONFIG_VIDEO_TVEEPROM=m ++CONFIG_VIDEO_TUNER=m ++CONFIG_VIDEO_CAPTURE_DRIVERS=y ++# CONFIG_VIDEO_ADV_DEBUG is not set ++# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set ++# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set ++CONFIG_VIDEO_IR_I2C=m ++ ++# ++# Encoders/decoders and other helper chips ++# ++ ++# ++# Audio decoders ++# ++# CONFIG_VIDEO_TVAUDIO is not set ++# CONFIG_VIDEO_TDA7432 is not set ++# CONFIG_VIDEO_TDA9840 is not set ++# CONFIG_VIDEO_TDA9875 is not set ++# CONFIG_VIDEO_TEA6415C is not set ++# CONFIG_VIDEO_TEA6420 is not set ++CONFIG_VIDEO_MSP3400=m ++# CONFIG_VIDEO_CS5345 is not set ++CONFIG_VIDEO_CS53L32A=m ++# CONFIG_VIDEO_M52790 is not set ++# CONFIG_VIDEO_TLV320AIC23B is not set ++CONFIG_VIDEO_WM8775=m ++# CONFIG_VIDEO_WM8739 is not set ++# CONFIG_VIDEO_VP27SMPX is not set ++ ++# ++# RDS decoders ++# ++# CONFIG_VIDEO_SAA6588 is not set ++ ++# ++# Video decoders ++# ++# CONFIG_VIDEO_ADV7180 is not set ++# CONFIG_VIDEO_BT819 is not set ++# CONFIG_VIDEO_BT856 is not set ++# CONFIG_VIDEO_BT866 is not set ++# CONFIG_VIDEO_KS0127 is not set ++# CONFIG_VIDEO_OV7670 is not set ++CONFIG_VIDEO_MT9V011=m ++# CONFIG_VIDEO_TCM825X is not set ++CONFIG_VIDEO_MT9P012=m ++CONFIG_VIDEO_MT9T111=y ++# CONFIG_VIDEO_DW9710 is not set ++# CONFIG_VIDEO_OV3640 is not set ++# CONFIG_VIDEO_IMX046 is not set ++# CONFIG_VIDEO_LV8093 is not set ++# CONFIG_VIDEO_SAA7110 is not set ++CONFIG_VIDEO_SAA711X=m ++# CONFIG_VIDEO_SAA717X is not set ++# CONFIG_VIDEO_SAA7191 is not set ++# CONFIG_VIDEO_TVP514X is not set ++# CONFIG_VIDEO_TVP5150 is not set ++# CONFIG_VIDEO_VPX3220 is not set ++ ++# ++# Video and audio decoders ++# ++CONFIG_VIDEO_CX25840=m ++ ++# ++# MPEG video encoders ++# ++CONFIG_VIDEO_CX2341X=m ++ ++# ++# Video encoders ++# ++# CONFIG_VIDEO_SAA7127 is not set ++# CONFIG_VIDEO_SAA7185 is not set ++# CONFIG_VIDEO_ADV7170 is not set ++# CONFIG_VIDEO_ADV7175 is not set ++# CONFIG_VIDEO_THS7303 is not set ++# CONFIG_VIDEO_ADV7343 is not set ++ ++# ++# Video improvement chips ++# ++# CONFIG_VIDEO_UPD64031A is not set ++# CONFIG_VIDEO_UPD64083 is not set ++CONFIG_VIDEO_VIVI=m ++# CONFIG_VIDEO_CPIA is not set ++# CONFIG_VIDEO_CPIA2 is not set ++# CONFIG_VIDEO_SAA5246A is not set ++# CONFIG_VIDEO_SAA5249 is not set ++# CONFIG_VIDEO_AU0828 is not set ++CONFIG_TI_MEDIA=y ++CONFIG_VIDEO_VPSS_SYSTEM=y ++CONFIG_VIDEO_VPFE_CAPTURE=y ++# CONFIG_VIDEO_DM6446_CCDC is not set ++# CONFIG_VIDEO_DM355_CCDC is not set ++CONFIG_VIDEO_OMAP2_VOUT=y ++CONFIG_VIDEO_OMAP3=y ++CONFIG_VIDEO_OMAP3_ISP=y ++CONFIG_VIDEO_OMAP34XX_ISP_PREVIEWER=y ++CONFIG_VIDEO_OMAP34XX_ISP_RESIZER=y ++# CONFIG_SOC_CAMERA is not set ++CONFIG_V4L_USB_DRIVERS=y ++CONFIG_USB_VIDEO_CLASS=m ++CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y ++CONFIG_USB_GSPCA=m ++CONFIG_USB_M5602=m ++CONFIG_USB_STV06XX=m ++# CONFIG_USB_GL860 is not set ++CONFIG_USB_GSPCA_CONEX=m ++CONFIG_USB_GSPCA_ETOMS=m ++CONFIG_USB_GSPCA_FINEPIX=m ++# CONFIG_USB_GSPCA_JEILINJ is not set ++CONFIG_USB_GSPCA_MARS=m ++# CONFIG_USB_GSPCA_MR97310A is not set ++CONFIG_USB_GSPCA_OV519=m ++CONFIG_USB_GSPCA_OV534=m ++CONFIG_USB_GSPCA_PAC207=m ++# CONFIG_USB_GSPCA_PAC7302 is not set ++CONFIG_USB_GSPCA_PAC7311=m ++# CONFIG_USB_GSPCA_SN9C20X is not set ++CONFIG_USB_GSPCA_SONIXB=m ++CONFIG_USB_GSPCA_SONIXJ=m ++CONFIG_USB_GSPCA_SPCA500=m ++CONFIG_USB_GSPCA_SPCA501=m ++CONFIG_USB_GSPCA_SPCA505=m ++CONFIG_USB_GSPCA_SPCA506=m ++CONFIG_USB_GSPCA_SPCA508=m ++CONFIG_USB_GSPCA_SPCA561=m ++# CONFIG_USB_GSPCA_SQ905 is not set ++# CONFIG_USB_GSPCA_SQ905C is not set ++CONFIG_USB_GSPCA_STK014=m ++# CONFIG_USB_GSPCA_STV0680 is not set ++CONFIG_USB_GSPCA_SUNPLUS=m ++CONFIG_USB_GSPCA_T613=m ++CONFIG_USB_GSPCA_TV8532=m ++CONFIG_USB_GSPCA_VC032X=m ++CONFIG_USB_GSPCA_ZC3XX=m ++CONFIG_VIDEO_PVRUSB2=m ++CONFIG_VIDEO_PVRUSB2_SYSFS=y ++CONFIG_VIDEO_PVRUSB2_DVB=y ++# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set ++CONFIG_VIDEO_HDPVR=m ++CONFIG_VIDEO_EM28XX=m ++CONFIG_VIDEO_EM28XX_ALSA=m ++CONFIG_VIDEO_EM28XX_DVB=m ++CONFIG_VIDEO_CX231XX=m ++# CONFIG_VIDEO_CX231XX_ALSA is not set ++CONFIG_VIDEO_CX231XX_DVB=m ++CONFIG_VIDEO_USBVISION=m ++CONFIG_VIDEO_USBVIDEO=m ++CONFIG_USB_VICAM=m ++CONFIG_USB_IBMCAM=m ++CONFIG_USB_KONICAWC=m ++CONFIG_USB_QUICKCAM_MESSENGER=m ++CONFIG_USB_ET61X251=m ++CONFIG_VIDEO_OVCAMCHIP=m ++CONFIG_USB_W9968CF=m ++CONFIG_USB_OV511=m ++CONFIG_USB_SE401=m ++CONFIG_USB_SN9C102=m ++CONFIG_USB_STV680=m ++CONFIG_USB_ZC0301=m ++CONFIG_USB_PWC=m ++# CONFIG_USB_PWC_DEBUG is not set ++CONFIG_USB_PWC_INPUT_EVDEV=y ++CONFIG_USB_ZR364XX=m ++CONFIG_USB_STKWEBCAM=m ++CONFIG_USB_S2255=m ++CONFIG_RADIO_ADAPTERS=y ++# CONFIG_I2C_SI4713 is not set ++# CONFIG_RADIO_SI4713 is not set ++# CONFIG_USB_DSBR is not set ++# CONFIG_RADIO_SI470X is not set ++# CONFIG_USB_MR800 is not set ++# CONFIG_RADIO_TEA5764 is not set ++# CONFIG_RADIO_TEF6862 is not set ++CONFIG_DVB_MAX_ADAPTERS=8 ++CONFIG_DVB_DYNAMIC_MINORS=y ++CONFIG_DVB_CAPTURE_DRIVERS=y ++# CONFIG_TTPCI_EEPROM is not set ++ ++# ++# Supported USB Adapters ++# ++CONFIG_DVB_USB=m ++# CONFIG_DVB_USB_DEBUG is not set ++CONFIG_DVB_USB_A800=m ++CONFIG_DVB_USB_DIBUSB_MB=m ++# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set ++CONFIG_DVB_USB_DIBUSB_MC=m ++CONFIG_DVB_USB_DIB0700=m ++CONFIG_DVB_USB_UMT_010=m ++CONFIG_DVB_USB_CXUSB=m ++CONFIG_DVB_USB_M920X=m ++CONFIG_DVB_USB_GL861=m ++CONFIG_DVB_USB_AU6610=m ++CONFIG_DVB_USB_DIGITV=m ++CONFIG_DVB_USB_VP7045=m ++CONFIG_DVB_USB_VP702X=m ++CONFIG_DVB_USB_GP8PSK=m ++CONFIG_DVB_USB_NOVA_T_USB2=m ++CONFIG_DVB_USB_TTUSB2=m ++CONFIG_DVB_USB_DTT200U=m ++CONFIG_DVB_USB_OPERA1=m ++CONFIG_DVB_USB_AF9005=m ++CONFIG_DVB_USB_AF9005_REMOTE=m ++CONFIG_DVB_USB_DW2102=m ++CONFIG_DVB_USB_CINERGY_T2=m ++CONFIG_DVB_USB_ANYSEE=m ++CONFIG_DVB_USB_DTV5100=m ++CONFIG_DVB_USB_AF9015=m ++# CONFIG_DVB_USB_CE6230 is not set ++# CONFIG_DVB_USB_FRIIO is not set ++# CONFIG_DVB_USB_EC168 is not set ++# CONFIG_SMS_SIANO_MDTV is not set ++ ++# ++# Supported FlexCopII (B2C2) Adapters ++# ++CONFIG_DVB_B2C2_FLEXCOP=m ++CONFIG_DVB_B2C2_FLEXCOP_USB=m ++# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set ++ ++# ++# Supported DVB Frontends ++# ++# CONFIG_DVB_FE_CUSTOMISE is not set ++CONFIG_DVB_CX24123=m ++CONFIG_DVB_MT312=m ++CONFIG_DVB_ZL10039=m ++CONFIG_DVB_S5H1420=m ++CONFIG_DVB_STV0288=m ++CONFIG_DVB_STB6000=m ++CONFIG_DVB_STV0299=m ++CONFIG_DVB_TDA10086=m ++CONFIG_DVB_TUNER_ITD1000=m ++CONFIG_DVB_TUNER_CX24113=m ++CONFIG_DVB_TDA826X=m ++CONFIG_DVB_CX24116=m ++CONFIG_DVB_SI21XX=m ++CONFIG_DVB_CX22702=m ++CONFIG_DVB_TDA1004X=m ++CONFIG_DVB_NXT6000=m ++CONFIG_DVB_MT352=m ++CONFIG_DVB_ZL10353=m ++CONFIG_DVB_DIB3000MB=m ++CONFIG_DVB_DIB3000MC=m ++CONFIG_DVB_DIB7000M=m ++CONFIG_DVB_DIB7000P=m ++CONFIG_DVB_TDA10048=m ++CONFIG_DVB_AF9013=m ++CONFIG_DVB_TDA10021=m ++CONFIG_DVB_TDA10023=m ++CONFIG_DVB_STV0297=m ++CONFIG_DVB_NXT200X=m ++CONFIG_DVB_BCM3510=m ++CONFIG_DVB_LGDT330X=m ++CONFIG_DVB_LGDT3305=m ++CONFIG_DVB_S5H1409=m ++CONFIG_DVB_S5H1411=m ++CONFIG_DVB_DIB8000=m ++CONFIG_DVB_PLL=m ++CONFIG_DVB_TUNER_DIB0070=m ++CONFIG_DVB_LNBP21=m ++CONFIG_DVB_ISL6421=m ++CONFIG_DVB_LGS8GL5=m ++# CONFIG_DAB is not set ++ ++# ++# Graphics support ++# ++# CONFIG_VGASTATE is not set ++# CONFIG_VIDEO_OUTPUT_CONTROL is not set ++CONFIG_FB=y ++# CONFIG_FIRMWARE_EDID is not set ++# CONFIG_FB_DDC is not set ++# CONFIG_FB_BOOT_VESA_SUPPORT is not set ++CONFIG_FB_CFB_FILLRECT=y ++CONFIG_FB_CFB_COPYAREA=y ++CONFIG_FB_CFB_IMAGEBLIT=y ++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set ++# CONFIG_FB_SYS_FILLRECT is not set ++# CONFIG_FB_SYS_COPYAREA is not set ++# CONFIG_FB_SYS_IMAGEBLIT is not set ++# CONFIG_FB_FOREIGN_ENDIAN is not set ++# CONFIG_FB_SYS_FOPS is not set ++# CONFIG_FB_SVGALIB is not set ++# CONFIG_FB_MACMODES is not set ++# CONFIG_FB_BACKLIGHT is not set ++CONFIG_FB_MODE_HELPERS=y ++# CONFIG_FB_TILEBLITTING is not set ++ ++# ++# Frame buffer hardware drivers ++# ++# CONFIG_FB_S1D13XXX is not set ++# CONFIG_FB_TMIO is not set ++# CONFIG_FB_VIRTUAL is not set ++# CONFIG_FB_METRONOME is not set ++# CONFIG_FB_MB862XX is not set ++# CONFIG_FB_BROADSHEET is not set ++# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set ++CONFIG_OMAP2_VRAM=y ++CONFIG_OMAP2_VRFB=y ++CONFIG_OMAP2_DSS=y ++CONFIG_OMAP2_VRAM_SIZE=14 ++CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y ++# CONFIG_OMAP2_DSS_RFBI is not set ++CONFIG_OMAP2_DSS_VENC=y ++CONFIG_OMAP2_VENC_OUT_TYPE_SVIDEO=y ++# CONFIG_OMAP2_VENC_OUT_TYPE_COMPOSITE is not set ++# CONFIG_OMAP2_DSS_SDI is not set ++CONFIG_OMAP2_DSS_DSI=y ++CONFIG_OMAP2_DSS_USE_DSI_PLL=y ++# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set ++CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0 ++CONFIG_FB_OMAP2=y ++CONFIG_FB_OMAP2_DEBUG_SUPPORT=y ++# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set ++CONFIG_FB_OMAP2_NUM_FBS=3 ++ ++# ++# OMAP2/3 Display Device Drivers ++# ++CONFIG_PANEL_GENERIC=y ++# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set ++# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set ++CONFIG_PANEL_SHARP_LS037V7DW01=y ++# CONFIG_PANEL_SHARP_LQ043T1DG01 is not set ++# CONFIG_PANEL_TAAL is not set ++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set ++ ++# ++# Display device support ++# ++CONFIG_DISPLAY_SUPPORT=y ++ ++# ++# Display hardware drivers ++# ++ ++# ++# Console display driver support ++# ++# CONFIG_VGA_CONSOLE is not set ++CONFIG_DUMMY_CONSOLE=y ++CONFIG_FRAMEBUFFER_CONSOLE=y ++# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set ++CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y ++# CONFIG_FONTS is not set ++CONFIG_FONT_8x8=y ++CONFIG_FONT_8x16=y ++CONFIG_LOGO=y ++# CONFIG_LOGO_LINUX_MONO is not set ++# CONFIG_LOGO_LINUX_VGA16 is not set ++CONFIG_LOGO_LINUX_CLUT224=y ++CONFIG_SOUND=y ++CONFIG_SOUND_OSS_CORE=y ++CONFIG_SOUND_OSS_CORE_PRECLAIM=y ++CONFIG_SND=y ++CONFIG_SND_TIMER=y ++CONFIG_SND_PCM=y ++CONFIG_SND_HWDEP=y ++CONFIG_SND_RAWMIDI=y ++CONFIG_SND_JACK=y ++CONFIG_SND_SEQUENCER=m ++# CONFIG_SND_SEQ_DUMMY is not set ++CONFIG_SND_OSSEMUL=y ++CONFIG_SND_MIXER_OSS=y ++CONFIG_SND_PCM_OSS=y ++CONFIG_SND_PCM_OSS_PLUGINS=y ++CONFIG_SND_SEQUENCER_OSS=y ++CONFIG_SND_HRTIMER=m ++CONFIG_SND_SEQ_HRTIMER_DEFAULT=y ++# CONFIG_SND_DYNAMIC_MINORS is not set ++CONFIG_SND_SUPPORT_OLD_API=y ++CONFIG_SND_VERBOSE_PROCFS=y ++# CONFIG_SND_VERBOSE_PRINTK is not set ++# CONFIG_SND_DEBUG is not set ++CONFIG_SND_RAWMIDI_SEQ=m ++# CONFIG_SND_OPL3_LIB_SEQ is not set ++# CONFIG_SND_OPL4_LIB_SEQ is not set ++# CONFIG_SND_SBAWE_SEQ is not set ++# CONFIG_SND_EMU10K1_SEQ is not set ++CONFIG_SND_DRIVERS=y ++# CONFIG_SND_DUMMY is not set ++# CONFIG_SND_VIRMIDI is not set ++# CONFIG_SND_MTPAV is not set ++# CONFIG_SND_SERIAL_U16550 is not set ++# CONFIG_SND_MPU401 is not set ++# CONFIG_SND_ARM is not set ++CONFIG_SND_SPI=y ++CONFIG_SND_USB=y ++CONFIG_SND_USB_AUDIO=y ++CONFIG_SND_USB_CAIAQ=m ++CONFIG_SND_USB_CAIAQ_INPUT=y ++CONFIG_SND_SOC=y ++CONFIG_SND_OMAP_SOC=y ++CONFIG_SND_OMAP_SOC_MCBSP=y ++# CONFIG_SND_OMAP_SOC_OMAP3EVM is not set ++CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y ++CONFIG_SND_SOC_I2C_AND_SPI=y ++# CONFIG_SND_SOC_ALL_CODECS is not set ++CONFIG_SND_SOC_TWL4030=y ++# CONFIG_SOUND_PRIME is not set ++CONFIG_HID_SUPPORT=y ++CONFIG_HID=y ++# CONFIG_HIDRAW is not set ++ ++# ++# USB Input Devices ++# ++CONFIG_USB_HID=y ++# CONFIG_HID_PID is not set ++# CONFIG_USB_HIDDEV is not set ++ ++# ++# Special HID drivers ++# ++CONFIG_HID_A4TECH=y ++CONFIG_HID_APPLE=y ++CONFIG_HID_BELKIN=y ++CONFIG_HID_CHERRY=y ++CONFIG_HID_CHICONY=y ++CONFIG_HID_CYPRESS=y ++# CONFIG_HID_DRAGONRISE is not set ++CONFIG_HID_EZKEY=y ++# CONFIG_HID_KYE is not set ++CONFIG_HID_GYRATION=y ++# CONFIG_HID_TWINHAN is not set ++# CONFIG_HID_KENSINGTON is not set ++CONFIG_HID_LOGITECH=y ++# CONFIG_LOGITECH_FF is not set ++# CONFIG_LOGIRUMBLEPAD2_FF is not set ++CONFIG_HID_MICROSOFT=y ++CONFIG_HID_MONTEREY=y ++CONFIG_HID_NTRIG=y ++CONFIG_HID_PANTHERLORD=y ++# CONFIG_PANTHERLORD_FF is not set ++CONFIG_HID_PETALYNX=y ++CONFIG_HID_SAMSUNG=y ++CONFIG_HID_SONY=y ++CONFIG_HID_SUNPLUS=y ++# CONFIG_HID_GREENASIA is not set ++# CONFIG_HID_SMARTJOYPLUS is not set ++CONFIG_HID_TOPSEED=y ++# CONFIG_HID_THRUSTMASTER is not set ++# CONFIG_HID_WACOM is not set ++# CONFIG_HID_ZEROPLUS is not set ++CONFIG_USB_SUPPORT=y ++CONFIG_USB_ARCH_HAS_HCD=y ++CONFIG_USB_ARCH_HAS_OHCI=y ++CONFIG_USB_ARCH_HAS_EHCI=y ++CONFIG_USB=y ++# CONFIG_USB_DEBUG is not set ++CONFIG_USB_ANNOUNCE_NEW_DEVICES=y ++ ++# ++# Miscellaneous USB options ++# ++CONFIG_USB_DEVICEFS=y ++CONFIG_USB_DEVICE_CLASS=y ++# CONFIG_USB_DYNAMIC_MINORS is not set ++CONFIG_USB_SUSPEND=y ++CONFIG_USB_OTG=y ++# CONFIG_USB_OTG_WHITELIST is not set ++# CONFIG_USB_OTG_BLACKLIST_HUB is not set ++CONFIG_USB_MON=y ++# CONFIG_USB_WUSB is not set ++# CONFIG_USB_WUSB_CBAF is not set ++ ++# ++# USB Host Controller Drivers ++# ++# CONFIG_USB_C67X00_HCD is not set ++CONFIG_USB_EHCI_HCD=y ++# CONFIG_USB_EHCI_ROOT_HUB_TT is not set ++CONFIG_USB_EHCI_TT_NEWSCHED=y ++# CONFIG_USB_OXU210HP_HCD is not set ++# CONFIG_USB_ISP116X_HCD is not set ++# CONFIG_USB_ISP1760_HCD is not set ++# CONFIG_USB_ISP1362_HCD is not set ++# CONFIG_USB_OHCI_HCD is not set ++# CONFIG_USB_U132_HCD is not set ++# CONFIG_USB_SL811_HCD is not set ++# CONFIG_USB_R8A66597_HCD is not set ++# CONFIG_USB_HWA_HCD is not set ++CONFIG_USB_MUSB_HDRC=y ++CONFIG_USB_MUSB_SOC=y ++ ++# ++# OMAP 343x high speed USB support ++# ++# CONFIG_USB_MUSB_HOST is not set ++# CONFIG_USB_MUSB_PERIPHERAL is not set ++CONFIG_USB_MUSB_OTG=y ++CONFIG_USB_GADGET_MUSB_HDRC=y ++CONFIG_USB_MUSB_HDRC_HCD=y ++# CONFIG_MUSB_PIO_ONLY is not set ++CONFIG_USB_INVENTRA_DMA=y ++CONFIG_MUSB_USE_SYSTEM_DMA_RX=y ++# CONFIG_USB_TI_CPPI_DMA is not set ++# CONFIG_USB_TI_CPPI41_DMA is not set ++# CONFIG_USB_MUSB_DEBUG is not set ++ ++# ++# USB Device Class drivers ++# ++CONFIG_USB_ACM=m ++CONFIG_USB_PRINTER=m ++CONFIG_USB_WDM=m ++CONFIG_USB_TMC=m ++ ++# ++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may ++# ++ ++# ++# also be needed; see USB_STORAGE Help for more info ++# ++CONFIG_USB_STORAGE=y ++# CONFIG_USB_STORAGE_DEBUG is not set ++# CONFIG_USB_STORAGE_DATAFAB is not set ++# CONFIG_USB_STORAGE_FREECOM is not set ++# CONFIG_USB_STORAGE_ISD200 is not set ++# CONFIG_USB_STORAGE_USBAT is not set ++# CONFIG_USB_STORAGE_SDDR09 is not set ++# CONFIG_USB_STORAGE_SDDR55 is not set ++# CONFIG_USB_STORAGE_JUMPSHOT is not set ++# CONFIG_USB_STORAGE_ALAUDA is not set ++# CONFIG_USB_STORAGE_ONETOUCH is not set ++# CONFIG_USB_STORAGE_KARMA is not set ++# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set ++# CONFIG_USB_LIBUSUAL is not set ++ ++# ++# USB Imaging devices ++# ++# CONFIG_USB_MDC800 is not set ++# CONFIG_USB_MICROTEK is not set ++ ++# ++# USB port drivers ++# ++CONFIG_USB_SERIAL=m ++CONFIG_USB_EZUSB=y ++CONFIG_USB_SERIAL_GENERIC=y ++CONFIG_USB_SERIAL_AIRCABLE=m ++CONFIG_USB_SERIAL_ARK3116=m ++CONFIG_USB_SERIAL_BELKIN=m ++CONFIG_USB_SERIAL_CH341=m ++CONFIG_USB_SERIAL_WHITEHEAT=m ++CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m ++# CONFIG_USB_SERIAL_CP210X is not set ++CONFIG_USB_SERIAL_CYPRESS_M8=m ++CONFIG_USB_SERIAL_EMPEG=m ++CONFIG_USB_SERIAL_FTDI_SIO=m ++CONFIG_USB_SERIAL_FUNSOFT=m ++CONFIG_USB_SERIAL_VISOR=m ++CONFIG_USB_SERIAL_IPAQ=m ++CONFIG_USB_SERIAL_IR=m ++CONFIG_USB_SERIAL_EDGEPORT=m ++CONFIG_USB_SERIAL_EDGEPORT_TI=m ++CONFIG_USB_SERIAL_GARMIN=m ++CONFIG_USB_SERIAL_IPW=m ++CONFIG_USB_SERIAL_IUU=m ++CONFIG_USB_SERIAL_KEYSPAN_PDA=m ++CONFIG_USB_SERIAL_KEYSPAN=m ++CONFIG_USB_SERIAL_KEYSPAN_MPR=y ++CONFIG_USB_SERIAL_KEYSPAN_USA28=y ++CONFIG_USB_SERIAL_KEYSPAN_USA28X=y ++CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y ++CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y ++CONFIG_USB_SERIAL_KEYSPAN_USA19=y ++CONFIG_USB_SERIAL_KEYSPAN_USA18X=y ++CONFIG_USB_SERIAL_KEYSPAN_USA19W=y ++CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y ++CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y ++CONFIG_USB_SERIAL_KEYSPAN_USA49W=y ++CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y ++CONFIG_USB_SERIAL_KLSI=m ++CONFIG_USB_SERIAL_KOBIL_SCT=m ++CONFIG_USB_SERIAL_MCT_U232=m ++CONFIG_USB_SERIAL_MOS7720=m ++CONFIG_USB_SERIAL_MOS7840=m ++CONFIG_USB_SERIAL_MOTOROLA=m ++CONFIG_USB_SERIAL_NAVMAN=m ++CONFIG_USB_SERIAL_PL2303=m ++CONFIG_USB_SERIAL_OTI6858=m ++# CONFIG_USB_SERIAL_QUALCOMM is not set ++CONFIG_USB_SERIAL_SPCP8X5=m ++CONFIG_USB_SERIAL_HP4X=m ++CONFIG_USB_SERIAL_SAFE=m ++# CONFIG_USB_SERIAL_SAFE_PADDED is not set ++CONFIG_USB_SERIAL_SIEMENS_MPI=m ++CONFIG_USB_SERIAL_SIERRAWIRELESS=m ++# CONFIG_USB_SERIAL_SYMBOL is not set ++CONFIG_USB_SERIAL_TI=m ++CONFIG_USB_SERIAL_CYBERJACK=m ++CONFIG_USB_SERIAL_XIRCOM=m ++CONFIG_USB_SERIAL_OPTION=m ++CONFIG_USB_SERIAL_OMNINET=m ++CONFIG_USB_SERIAL_OPTICON=m ++CONFIG_USB_SERIAL_DEBUG=m ++ ++# ++# USB Miscellaneous drivers ++# ++CONFIG_USB_EMI62=m ++CONFIG_USB_EMI26=m ++# CONFIG_USB_ADUTUX is not set ++# CONFIG_USB_SEVSEG is not set ++# CONFIG_USB_RIO500 is not set ++CONFIG_USB_LEGOTOWER=m ++CONFIG_USB_LCD=m ++CONFIG_USB_BERRY_CHARGE=m ++CONFIG_USB_LED=m ++CONFIG_USB_CYPRESS_CY7C63=m ++CONFIG_USB_CYTHERM=m ++CONFIG_USB_IDMOUSE=m ++CONFIG_USB_FTDI_ELAN=m ++# CONFIG_USB_APPLEDISPLAY is not set ++CONFIG_USB_SISUSBVGA=m ++CONFIG_USB_SISUSBVGA_CON=y ++CONFIG_USB_LD=m ++CONFIG_USB_TRANCEVIBRATOR=m ++# CONFIG_USB_IOWARRIOR is not set ++CONFIG_USB_TEST=m ++# CONFIG_USB_ISIGHTFW is not set ++CONFIG_USB_VST=m ++CONFIG_USB_ATM=m ++CONFIG_USB_SPEEDTOUCH=m ++CONFIG_USB_CXACRU=m ++CONFIG_USB_UEAGLEATM=m ++CONFIG_USB_XUSBATM=m ++CONFIG_USB_GADGET=y ++# CONFIG_USB_GADGET_DEBUG is not set ++# CONFIG_USB_GADGET_DEBUG_FILES is not set ++CONFIG_USB_GADGET_DEBUG_FS=y ++CONFIG_USB_GADGET_VBUS_DRAW=2 ++CONFIG_USB_GADGET_SELECTED=y ++# CONFIG_USB_GADGET_AT91 is not set ++# CONFIG_USB_GADGET_ATMEL_USBA is not set ++# CONFIG_USB_GADGET_FSL_USB2 is not set ++# CONFIG_USB_GADGET_LH7A40X is not set ++# CONFIG_USB_GADGET_OMAP is not set ++# CONFIG_USB_GADGET_PXA25X is not set ++# CONFIG_USB_GADGET_R8A66597 is not set ++# CONFIG_USB_GADGET_PXA27X is not set ++# CONFIG_USB_GADGET_S3C_HSOTG is not set ++# CONFIG_USB_GADGET_IMX is not set ++# CONFIG_USB_GADGET_S3C2410 is not set ++# CONFIG_USB_GADGET_M66592 is not set ++# CONFIG_USB_GADGET_AMD5536UDC is not set ++# CONFIG_USB_GADGET_FSL_QE is not set ++# CONFIG_USB_GADGET_CI13XXX is not set ++# CONFIG_USB_GADGET_NET2280 is not set ++# CONFIG_USB_GADGET_GOKU is not set ++# CONFIG_USB_GADGET_LANGWELL is not set ++# CONFIG_USB_GADGET_DUMMY_HCD is not set ++CONFIG_USB_GADGET_DUALSPEED=y ++CONFIG_USB_ZERO=m ++CONFIG_USB_ZERO_HNPTEST=y ++# CONFIG_USB_AUDIO is not set ++CONFIG_USB_ETH=m ++CONFIG_USB_ETH_RNDIS=y ++# CONFIG_USB_ETH_EEM is not set ++CONFIG_USB_GADGETFS=m ++CONFIG_USB_FILE_STORAGE=m ++# CONFIG_USB_FILE_STORAGE_TEST is not set ++# CONFIG_USB_MASS_STORAGE is not set ++CONFIG_USB_G_SERIAL=m ++CONFIG_USB_MIDI_GADGET=m ++CONFIG_USB_G_PRINTER=m ++CONFIG_USB_CDC_COMPOSITE=m ++# CONFIG_USB_G_MULTI is not set ++ ++# ++# OTG and related infrastructure ++# ++CONFIG_USB_OTG_UTILS=y ++CONFIG_USB_GPIO_VBUS=y ++# CONFIG_ISP1301_OMAP is not set ++# CONFIG_USB_ULPI is not set ++CONFIG_TWL4030_USB=y ++CONFIG_NOP_USB_XCEIV=y ++CONFIG_MMC=y ++# CONFIG_MMC_DEBUG is not set ++CONFIG_MMC_UNSAFE_RESUME=y ++ ++# ++# MMC/SD/SDIO Card Drivers ++# ++CONFIG_MMC_BLOCK=y ++CONFIG_MMC_BLOCK_BOUNCE=y ++CONFIG_SDIO_UART=y ++# CONFIG_MMC_TEST is not set ++ ++# ++# MMC/SD/SDIO Host Controller Drivers ++# ++# CONFIG_MMC_SDHCI is not set ++# CONFIG_MMC_OMAP is not set ++CONFIG_MMC_OMAP_HS=y ++# CONFIG_MMC_AT91 is not set ++# CONFIG_MMC_ATMELMCI is not set ++CONFIG_MMC_SPI=m ++# CONFIG_MEMSTICK is not set ++CONFIG_NEW_LEDS=y ++CONFIG_LEDS_CLASS=y ++ ++# ++# LED drivers ++# ++# CONFIG_LEDS_PCA9532 is not set ++CONFIG_LEDS_GPIO=y ++CONFIG_LEDS_GPIO_PLATFORM=y ++# CONFIG_LEDS_LP3944 is not set ++# CONFIG_LEDS_PCA955X is not set ++# CONFIG_LEDS_DAC124S085 is not set ++# CONFIG_LEDS_BD2802 is not set ++ ++# ++# LED Triggers ++# ++CONFIG_LEDS_TRIGGERS=y ++CONFIG_LEDS_TRIGGER_TIMER=m ++CONFIG_LEDS_TRIGGER_HEARTBEAT=y ++CONFIG_LEDS_TRIGGER_BACKLIGHT=m ++# CONFIG_LEDS_TRIGGER_GPIO is not set ++CONFIG_LEDS_TRIGGER_DEFAULT_ON=m ++ ++# ++# iptables trigger is under Netfilter config (LED target) ++# ++# CONFIG_ACCESSIBILITY is not set ++CONFIG_RTC_LIB=y ++CONFIG_RTC_CLASS=m ++ ++# ++# RTC interfaces ++# ++CONFIG_RTC_INTF_SYSFS=y ++CONFIG_RTC_INTF_PROC=y ++CONFIG_RTC_INTF_DEV=y ++# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set ++# CONFIG_RTC_DRV_TEST is not set ++ ++# ++# I2C RTC drivers ++# ++# CONFIG_RTC_DRV_DS1307 is not set ++# CONFIG_RTC_DRV_DS1374 is not set ++# CONFIG_RTC_DRV_DS1672 is not set ++# CONFIG_RTC_DRV_MAX6900 is not set ++# CONFIG_RTC_DRV_RS5C372 is not set ++# CONFIG_RTC_DRV_ISL1208 is not set ++# CONFIG_RTC_DRV_X1205 is not set ++# CONFIG_RTC_DRV_PCF8563 is not set ++# CONFIG_RTC_DRV_PCF8583 is not set ++# CONFIG_RTC_DRV_M41T80 is not set ++CONFIG_RTC_DRV_TWL4030=m ++# CONFIG_RTC_DRV_S35390A is not set ++# CONFIG_RTC_DRV_FM3130 is not set ++# CONFIG_RTC_DRV_RX8581 is not set ++# CONFIG_RTC_DRV_RX8025 is not set ++ ++# ++# SPI RTC drivers ++# ++# CONFIG_RTC_DRV_M41T94 is not set ++# CONFIG_RTC_DRV_DS1305 is not set ++# CONFIG_RTC_DRV_DS1390 is not set ++# CONFIG_RTC_DRV_MAX6902 is not set ++# CONFIG_RTC_DRV_R9701 is not set ++# CONFIG_RTC_DRV_RS5C348 is not set ++# CONFIG_RTC_DRV_DS3234 is not set ++# CONFIG_RTC_DRV_PCF2123 is not set ++ ++# ++# Platform RTC drivers ++# ++# CONFIG_RTC_DRV_CMOS is not set ++# CONFIG_RTC_DRV_DS1286 is not set ++# CONFIG_RTC_DRV_DS1511 is not set ++# CONFIG_RTC_DRV_DS1553 is not set ++# CONFIG_RTC_DRV_DS1742 is not set ++# CONFIG_RTC_DRV_STK17TA8 is not set ++# CONFIG_RTC_DRV_M48T86 is not set ++# CONFIG_RTC_DRV_M48T35 is not set ++# CONFIG_RTC_DRV_M48T59 is not set ++# CONFIG_RTC_DRV_MSM6242 is not set ++# CONFIG_RTC_DRV_BQ4802 is not set ++# CONFIG_RTC_DRV_RP5C01 is not set ++# CONFIG_RTC_DRV_V3020 is not set ++ ++# ++# on-CPU RTC drivers ++# ++# CONFIG_DMADEVICES is not set ++# CONFIG_AUXDISPLAY is not set ++CONFIG_UIO=m ++CONFIG_UIO_PDRV=m ++CONFIG_UIO_PDRV_GENIRQ=m ++# CONFIG_UIO_SMX is not set ++# CONFIG_UIO_SERCOS3 is not set ++ ++# ++# TI VLYNQ ++# ++CONFIG_STAGING=y ++# CONFIG_STAGING_EXCLUDE_BUILD is not set ++# CONFIG_USB_IP_COMMON is not set ++CONFIG_W35UND=m ++# CONFIG_PRISM2_USB is not set ++CONFIG_ECHO=m ++CONFIG_OTUS=m ++# CONFIG_COMEDI is not set ++# CONFIG_ASUS_OLED is not set ++# CONFIG_INPUT_MIMIO is not set ++# CONFIG_TRANZPORT is not set ++ ++# ++# Qualcomm MSM Camera And Video ++# ++ ++# ++# Camera Sensor Selection ++# ++# CONFIG_INPUT_GPIO is not set ++# CONFIG_DST is not set ++# CONFIG_POHMELFS is not set ++# CONFIG_PLAN9AUTH is not set ++# CONFIG_LINE6_USB is not set ++# CONFIG_USB_SERIAL_QUATECH2 is not set ++# CONFIG_USB_SERIAL_QUATECH_USB2 is not set ++# CONFIG_VT6656 is not set ++# CONFIG_FB_UDL is not set ++ ++# ++# RAR Register Driver ++# ++# CONFIG_RAR_REGISTER is not set ++# CONFIG_IIO is not set ++# CONFIG_RAMZSWAP is not set ++# CONFIG_BATMAN_ADV is not set ++# CONFIG_STRIP is not set ++ ++# ++# CBUS support ++# ++# CONFIG_CBUS is not set ++ ++# ++# File systems ++# ++CONFIG_FS_JOURNAL_INFO=y ++CONFIG_EXT2_FS=y ++# CONFIG_EXT2_FS_XATTR is not set ++# CONFIG_EXT2_FS_XIP is not set ++CONFIG_EXT3_FS=y ++# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set ++# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT4_FS=y ++CONFIG_EXT4_FS_XATTR=y ++# CONFIG_EXT4_FS_POSIX_ACL is not set ++# CONFIG_EXT4_FS_SECURITY is not set ++# CONFIG_EXT4_DEBUG is not set ++CONFIG_JBD=y ++# CONFIG_JBD_DEBUG is not set ++CONFIG_JBD2=y ++# CONFIG_JBD2_DEBUG is not set ++CONFIG_FS_MBCACHE=y ++CONFIG_REISERFS_FS=m ++# CONFIG_REISERFS_CHECK is not set ++CONFIG_REISERFS_PROC_INFO=y ++CONFIG_REISERFS_FS_XATTR=y ++# CONFIG_REISERFS_FS_POSIX_ACL is not set ++# CONFIG_REISERFS_FS_SECURITY is not set ++CONFIG_JFS_FS=m ++# CONFIG_JFS_POSIX_ACL is not set ++# CONFIG_JFS_SECURITY is not set ++# CONFIG_JFS_DEBUG is not set ++# CONFIG_JFS_STATISTICS is not set ++CONFIG_FS_POSIX_ACL=y ++CONFIG_XFS_FS=m ++# CONFIG_XFS_QUOTA is not set ++# CONFIG_XFS_POSIX_ACL is not set ++# CONFIG_XFS_RT is not set ++# CONFIG_XFS_DEBUG is not set ++CONFIG_GFS2_FS=m ++# CONFIG_GFS2_FS_LOCKING_DLM is not set ++CONFIG_OCFS2_FS=m ++CONFIG_OCFS2_FS_O2CB=m ++CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m ++CONFIG_OCFS2_FS_STATS=y ++CONFIG_OCFS2_DEBUG_MASKLOG=y ++# CONFIG_OCFS2_DEBUG_FS is not set ++# CONFIG_OCFS2_FS_POSIX_ACL is not set ++CONFIG_BTRFS_FS=m ++# CONFIG_BTRFS_FS_POSIX_ACL is not set ++# CONFIG_NILFS2_FS is not set ++CONFIG_FILE_LOCKING=y ++CONFIG_FSNOTIFY=y ++CONFIG_DNOTIFY=y ++CONFIG_INOTIFY=y ++CONFIG_INOTIFY_USER=y ++CONFIG_QUOTA=y ++# CONFIG_QUOTA_NETLINK_INTERFACE is not set ++CONFIG_PRINT_QUOTA_WARNING=y ++CONFIG_QUOTA_TREE=y ++# CONFIG_QFMT_V1 is not set ++CONFIG_QFMT_V2=y ++CONFIG_QUOTACTL=y ++# CONFIG_AUTOFS_FS is not set ++CONFIG_AUTOFS4_FS=m ++CONFIG_FUSE_FS=m ++# CONFIG_CUSE is not set ++CONFIG_GENERIC_ACL=y ++ ++# ++# Caches ++# ++# CONFIG_FSCACHE is not set ++ ++# ++# CD-ROM/DVD Filesystems ++# ++CONFIG_ISO9660_FS=m ++CONFIG_JOLIET=y ++CONFIG_ZISOFS=y ++CONFIG_UDF_FS=m ++CONFIG_UDF_NLS=y ++ ++# ++# DOS/FAT/NT Filesystems ++# ++CONFIG_FAT_FS=y ++CONFIG_MSDOS_FS=y ++CONFIG_VFAT_FS=y ++CONFIG_FAT_DEFAULT_CODEPAGE=437 ++CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" ++CONFIG_NTFS_FS=m ++# CONFIG_NTFS_DEBUG is not set ++CONFIG_NTFS_RW=y ++ ++# ++# Pseudo filesystems ++# ++CONFIG_PROC_FS=y ++CONFIG_PROC_SYSCTL=y ++CONFIG_PROC_PAGE_MONITOR=y ++CONFIG_SYSFS=y ++CONFIG_TMPFS=y ++CONFIG_TMPFS_POSIX_ACL=y ++# CONFIG_HUGETLB_PAGE is not set ++CONFIG_CONFIGFS_FS=m ++CONFIG_MISC_FILESYSTEMS=y ++CONFIG_ADFS_FS=m ++# CONFIG_ADFS_FS_RW is not set ++CONFIG_AFFS_FS=m ++# CONFIG_ECRYPT_FS is not set ++CONFIG_HFS_FS=m ++CONFIG_HFSPLUS_FS=m ++CONFIG_BEFS_FS=m ++# CONFIG_BEFS_DEBUG is not set ++CONFIG_BFS_FS=m ++CONFIG_EFS_FS=m ++CONFIG_JFFS2_FS=y ++CONFIG_JFFS2_FS_DEBUG=0 ++CONFIG_JFFS2_FS_WRITEBUFFER=y ++# CONFIG_JFFS2_FS_WBUF_VERIFY is not set ++CONFIG_JFFS2_SUMMARY=y ++CONFIG_JFFS2_FS_XATTR=y ++CONFIG_JFFS2_FS_POSIX_ACL=y ++CONFIG_JFFS2_FS_SECURITY=y ++CONFIG_JFFS2_COMPRESSION_OPTIONS=y ++CONFIG_JFFS2_ZLIB=y ++CONFIG_JFFS2_LZO=y ++CONFIG_JFFS2_RTIME=y ++CONFIG_JFFS2_RUBIN=y ++# CONFIG_JFFS2_CMODE_NONE is not set ++# CONFIG_JFFS2_CMODE_PRIORITY is not set ++# CONFIG_JFFS2_CMODE_SIZE is not set ++CONFIG_JFFS2_CMODE_FAVOURLZO=y ++CONFIG_UBIFS_FS=y ++CONFIG_UBIFS_FS_XATTR=y ++CONFIG_UBIFS_FS_ADVANCED_COMPR=y ++CONFIG_UBIFS_FS_LZO=y ++CONFIG_UBIFS_FS_ZLIB=y ++# CONFIG_UBIFS_FS_DEBUG is not set ++CONFIG_CRAMFS=m ++CONFIG_SQUASHFS=y ++# CONFIG_SQUASHFS_EMBEDDED is not set ++CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 ++CONFIG_VXFS_FS=m ++CONFIG_MINIX_FS=m ++CONFIG_OMFS_FS=m ++CONFIG_HPFS_FS=m ++CONFIG_QNX4FS_FS=m ++CONFIG_ROMFS_FS=m ++CONFIG_ROMFS_BACKED_BY_BLOCK=y ++# CONFIG_ROMFS_BACKED_BY_MTD is not set ++# CONFIG_ROMFS_BACKED_BY_BOTH is not set ++CONFIG_ROMFS_ON_BLOCK=y ++CONFIG_SYSV_FS=m ++CONFIG_UFS_FS=m ++# CONFIG_UFS_FS_WRITE is not set ++# CONFIG_UFS_DEBUG is not set ++CONFIG_NETWORK_FILESYSTEMS=y ++CONFIG_NFS_FS=y ++CONFIG_NFS_V3=y ++# CONFIG_NFS_V3_ACL is not set ++CONFIG_NFS_V4=y ++# CONFIG_NFS_V4_1 is not set ++CONFIG_ROOT_NFS=y ++CONFIG_NFSD=m ++CONFIG_NFSD_V2_ACL=y ++CONFIG_NFSD_V3=y ++CONFIG_NFSD_V3_ACL=y ++CONFIG_NFSD_V4=y ++CONFIG_LOCKD=y ++CONFIG_LOCKD_V4=y ++CONFIG_EXPORTFS=m ++CONFIG_NFS_ACL_SUPPORT=m ++CONFIG_NFS_COMMON=y ++CONFIG_SUNRPC=y ++CONFIG_SUNRPC_GSS=y ++CONFIG_RPCSEC_GSS_KRB5=y ++# CONFIG_RPCSEC_GSS_SPKM3 is not set ++CONFIG_SMB_FS=m ++# CONFIG_SMB_NLS_DEFAULT is not set ++CONFIG_CIFS=m ++CONFIG_CIFS_STATS=y ++CONFIG_CIFS_STATS2=y ++# CONFIG_CIFS_WEAK_PW_HASH is not set ++# CONFIG_CIFS_UPCALL is not set ++# CONFIG_CIFS_XATTR is not set ++# CONFIG_CIFS_DEBUG2 is not set ++# CONFIG_CIFS_DFS_UPCALL is not set ++CONFIG_CIFS_EXPERIMENTAL=y ++CONFIG_NCP_FS=m ++# CONFIG_NCPFS_PACKET_SIGNING is not set ++# CONFIG_NCPFS_IOCTL_LOCKING is not set ++# CONFIG_NCPFS_STRONG is not set ++# CONFIG_NCPFS_NFS_NS is not set ++# CONFIG_NCPFS_OS2_NS is not set ++# CONFIG_NCPFS_SMALLDOS is not set ++# CONFIG_NCPFS_NLS is not set ++# CONFIG_NCPFS_EXTRAS is not set ++CONFIG_CODA_FS=m ++CONFIG_AFS_FS=m ++# CONFIG_AFS_DEBUG is not set ++CONFIG_9P_FS=m ++ ++# ++# Partition Types ++# ++CONFIG_PARTITION_ADVANCED=y ++# CONFIG_ACORN_PARTITION is not set ++# CONFIG_OSF_PARTITION is not set ++# CONFIG_AMIGA_PARTITION is not set ++# CONFIG_ATARI_PARTITION is not set ++CONFIG_MAC_PARTITION=y ++CONFIG_MSDOS_PARTITION=y ++CONFIG_BSD_DISKLABEL=y ++CONFIG_MINIX_SUBPARTITION=y ++CONFIG_SOLARIS_X86_PARTITION=y ++# CONFIG_UNIXWARE_DISKLABEL is not set ++CONFIG_LDM_PARTITION=y ++CONFIG_LDM_DEBUG=y ++# CONFIG_SGI_PARTITION is not set ++# CONFIG_ULTRIX_PARTITION is not set ++# CONFIG_SUN_PARTITION is not set ++# CONFIG_KARMA_PARTITION is not set ++CONFIG_EFI_PARTITION=y ++# CONFIG_SYSV68_PARTITION is not set ++CONFIG_NLS=y ++CONFIG_NLS_DEFAULT="iso8859-1" ++CONFIG_NLS_CODEPAGE_437=y ++CONFIG_NLS_CODEPAGE_737=m ++CONFIG_NLS_CODEPAGE_775=m ++CONFIG_NLS_CODEPAGE_850=m ++CONFIG_NLS_CODEPAGE_852=m ++CONFIG_NLS_CODEPAGE_855=m ++CONFIG_NLS_CODEPAGE_857=m ++CONFIG_NLS_CODEPAGE_860=m ++CONFIG_NLS_CODEPAGE_861=m ++CONFIG_NLS_CODEPAGE_862=m ++CONFIG_NLS_CODEPAGE_863=m ++CONFIG_NLS_CODEPAGE_864=m ++CONFIG_NLS_CODEPAGE_865=m ++CONFIG_NLS_CODEPAGE_866=m ++CONFIG_NLS_CODEPAGE_869=m ++CONFIG_NLS_CODEPAGE_936=m ++CONFIG_NLS_CODEPAGE_950=m ++CONFIG_NLS_CODEPAGE_932=m ++CONFIG_NLS_CODEPAGE_949=m ++CONFIG_NLS_CODEPAGE_874=m ++CONFIG_NLS_ISO8859_8=m ++CONFIG_NLS_CODEPAGE_1250=m ++CONFIG_NLS_CODEPAGE_1251=m ++CONFIG_NLS_ASCII=m ++CONFIG_NLS_ISO8859_1=y ++CONFIG_NLS_ISO8859_2=m ++CONFIG_NLS_ISO8859_3=m ++CONFIG_NLS_ISO8859_4=m ++CONFIG_NLS_ISO8859_5=m ++CONFIG_NLS_ISO8859_6=m ++CONFIG_NLS_ISO8859_7=m ++CONFIG_NLS_ISO8859_9=m ++CONFIG_NLS_ISO8859_13=m ++CONFIG_NLS_ISO8859_14=m ++CONFIG_NLS_ISO8859_15=m ++CONFIG_NLS_KOI8_R=m ++CONFIG_NLS_KOI8_U=m ++CONFIG_NLS_UTF8=y ++CONFIG_DLM=m ++# CONFIG_DLM_DEBUG is not set ++ ++# ++# Kernel hacking ++# ++CONFIG_PRINTK_TIME=y ++CONFIG_ENABLE_WARN_DEPRECATED=y ++CONFIG_ENABLE_MUST_CHECK=y ++CONFIG_FRAME_WARN=1024 ++CONFIG_MAGIC_SYSRQ=y ++# CONFIG_STRIP_ASM_SYMS is not set ++# CONFIG_UNUSED_SYMBOLS is not set ++CONFIG_DEBUG_FS=y ++# CONFIG_HEADERS_CHECK is not set ++CONFIG_DEBUG_KERNEL=y ++# CONFIG_DEBUG_SHIRQ is not set ++CONFIG_DETECT_SOFTLOCKUP=y ++# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set ++CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 ++CONFIG_DETECT_HUNG_TASK=y ++# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set ++CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 ++CONFIG_SCHED_DEBUG=y ++CONFIG_SCHEDSTATS=y ++CONFIG_TIMER_STATS=y ++# CONFIG_DEBUG_OBJECTS is not set ++# CONFIG_DEBUG_SLAB is not set ++# CONFIG_DEBUG_KMEMLEAK is not set ++CONFIG_DEBUG_PREEMPT=y ++# CONFIG_DEBUG_RT_MUTEXES is not set ++# CONFIG_RT_MUTEX_TESTER is not set ++# CONFIG_DEBUG_SPINLOCK is not set ++CONFIG_DEBUG_MUTEXES=y ++# CONFIG_DEBUG_LOCK_ALLOC is not set ++# CONFIG_PROVE_LOCKING is not set ++# CONFIG_LOCK_STAT is not set ++# CONFIG_DEBUG_SPINLOCK_SLEEP is not set ++# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set ++CONFIG_STACKTRACE=y ++# CONFIG_DEBUG_KOBJECT is not set ++# CONFIG_DEBUG_BUGVERBOSE is not set ++# CONFIG_DEBUG_INFO is not set ++# CONFIG_DEBUG_VM is not set ++# CONFIG_DEBUG_WRITECOUNT is not set ++# CONFIG_DEBUG_MEMORY_INIT is not set ++# CONFIG_DEBUG_LIST is not set ++# CONFIG_DEBUG_SG is not set ++# CONFIG_DEBUG_NOTIFIERS is not set ++# CONFIG_DEBUG_CREDENTIALS is not set ++# CONFIG_BOOT_PRINTK_DELAY is not set ++# CONFIG_RCU_TORTURE_TEST is not set ++# CONFIG_RCU_CPU_STALL_DETECTOR is not set ++# CONFIG_BACKTRACE_SELF_TEST is not set ++# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set ++# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set ++# CONFIG_FAULT_INJECTION is not set ++# CONFIG_LATENCYTOP is not set ++# CONFIG_SYSCTL_SYSCALL_CHECK is not set ++# CONFIG_PAGE_POISONING is not set ++CONFIG_NOP_TRACER=y ++CONFIG_HAVE_FUNCTION_TRACER=y ++CONFIG_RING_BUFFER=y ++CONFIG_EVENT_TRACING=y ++CONFIG_CONTEXT_SWITCH_TRACER=y ++CONFIG_RING_BUFFER_ALLOW_SWAP=y ++CONFIG_TRACING=y ++CONFIG_TRACING_SUPPORT=y ++CONFIG_FTRACE=y ++# CONFIG_FUNCTION_TRACER is not set ++# CONFIG_IRQSOFF_TRACER is not set ++# CONFIG_PREEMPT_TRACER is not set ++# CONFIG_SCHED_TRACER is not set ++# CONFIG_ENABLE_DEFAULT_TRACERS is not set ++# CONFIG_BOOT_TRACER is not set ++CONFIG_BRANCH_PROFILE_NONE=y ++# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set ++# CONFIG_PROFILE_ALL_BRANCHES is not set ++# CONFIG_STACK_TRACER is not set ++# CONFIG_KMEMTRACE is not set ++# CONFIG_WORKQUEUE_TRACER is not set ++# CONFIG_BLK_DEV_IO_TRACE is not set ++# CONFIG_RING_BUFFER_BENCHMARK is not set ++# CONFIG_DYNAMIC_DEBUG is not set ++# CONFIG_SAMPLES is not set ++CONFIG_HAVE_ARCH_KGDB=y ++# CONFIG_KGDB is not set ++CONFIG_ARM_UNWIND=y ++# CONFIG_DEBUG_USER is not set ++# CONFIG_DEBUG_ERRORS is not set ++# CONFIG_DEBUG_STACK_USAGE is not set ++# CONFIG_DEBUG_LL is not set ++# CONFIG_OC_ETM is not set ++ ++# ++# Security options ++# ++CONFIG_KEYS=y ++# CONFIG_KEYS_DEBUG_PROC_KEYS is not set ++# CONFIG_SECURITY is not set ++# CONFIG_SECURITYFS is not set ++# CONFIG_DEFAULT_SECURITY_SELINUX is not set ++# CONFIG_DEFAULT_SECURITY_SMACK is not set ++# CONFIG_DEFAULT_SECURITY_TOMOYO is not set ++CONFIG_DEFAULT_SECURITY_DAC=y ++CONFIG_DEFAULT_SECURITY="" ++CONFIG_XOR_BLOCKS=m ++CONFIG_ASYNC_CORE=m ++CONFIG_ASYNC_MEMCPY=m ++CONFIG_ASYNC_XOR=m ++CONFIG_ASYNC_PQ=m ++CONFIG_ASYNC_RAID6_RECOV=m ++CONFIG_CRYPTO=y ++ ++# ++# Crypto core or helper ++# ++CONFIG_CRYPTO_FIPS=y ++CONFIG_CRYPTO_ALGAPI=y ++CONFIG_CRYPTO_ALGAPI2=y ++CONFIG_CRYPTO_AEAD=m ++CONFIG_CRYPTO_AEAD2=y ++CONFIG_CRYPTO_BLKCIPHER=y ++CONFIG_CRYPTO_BLKCIPHER2=y ++CONFIG_CRYPTO_HASH=y ++CONFIG_CRYPTO_HASH2=y ++CONFIG_CRYPTO_RNG=m ++CONFIG_CRYPTO_RNG2=y ++CONFIG_CRYPTO_PCOMP=y ++CONFIG_CRYPTO_MANAGER=y ++CONFIG_CRYPTO_MANAGER2=y ++CONFIG_CRYPTO_GF128MUL=m ++CONFIG_CRYPTO_NULL=m ++CONFIG_CRYPTO_WORKQUEUE=y ++CONFIG_CRYPTO_CRYPTD=m ++CONFIG_CRYPTO_AUTHENC=m ++CONFIG_CRYPTO_TEST=m ++ ++# ++# Authenticated Encryption with Associated Data ++# ++CONFIG_CRYPTO_CCM=m ++CONFIG_CRYPTO_GCM=m ++CONFIG_CRYPTO_SEQIV=m ++ ++# ++# Block modes ++# ++CONFIG_CRYPTO_CBC=y ++CONFIG_CRYPTO_CTR=m ++CONFIG_CRYPTO_CTS=m ++CONFIG_CRYPTO_ECB=y ++CONFIG_CRYPTO_LRW=m ++CONFIG_CRYPTO_PCBC=m ++CONFIG_CRYPTO_XTS=m ++ ++# ++# Hash modes ++# ++CONFIG_CRYPTO_HMAC=m ++CONFIG_CRYPTO_XCBC=m ++# CONFIG_CRYPTO_VMAC is not set ++ ++# ++# Digest ++# ++CONFIG_CRYPTO_CRC32C=y ++CONFIG_CRYPTO_GHASH=m ++CONFIG_CRYPTO_MD4=m ++CONFIG_CRYPTO_MD5=y ++CONFIG_CRYPTO_MICHAEL_MIC=y ++CONFIG_CRYPTO_RMD128=m ++CONFIG_CRYPTO_RMD160=m ++CONFIG_CRYPTO_RMD256=m ++CONFIG_CRYPTO_RMD320=m ++CONFIG_CRYPTO_SHA1=m ++CONFIG_CRYPTO_SHA256=m ++CONFIG_CRYPTO_SHA512=m ++CONFIG_CRYPTO_TGR192=m ++CONFIG_CRYPTO_WP512=m ++ ++# ++# Ciphers ++# ++CONFIG_CRYPTO_AES=y ++CONFIG_CRYPTO_ANUBIS=m ++CONFIG_CRYPTO_ARC4=y ++CONFIG_CRYPTO_BLOWFISH=m ++CONFIG_CRYPTO_CAMELLIA=m ++CONFIG_CRYPTO_CAST5=m ++CONFIG_CRYPTO_CAST6=m ++CONFIG_CRYPTO_DES=y ++CONFIG_CRYPTO_FCRYPT=m ++CONFIG_CRYPTO_KHAZAD=m ++CONFIG_CRYPTO_SALSA20=m ++CONFIG_CRYPTO_SEED=m ++CONFIG_CRYPTO_SERPENT=m ++CONFIG_CRYPTO_TEA=m ++CONFIG_CRYPTO_TWOFISH=m ++CONFIG_CRYPTO_TWOFISH_COMMON=m ++ ++# ++# Compression ++# ++CONFIG_CRYPTO_DEFLATE=y ++# CONFIG_CRYPTO_ZLIB is not set ++CONFIG_CRYPTO_LZO=y ++ ++# ++# Random Number Generation ++# ++CONFIG_CRYPTO_ANSI_CPRNG=m ++CONFIG_CRYPTO_HW=y ++CONFIG_BINARY_PRINTF=y ++ ++# ++# Library routines ++# ++CONFIG_BITREVERSE=y ++CONFIG_GENERIC_FIND_LAST_BIT=y ++CONFIG_CRC_CCITT=y ++CONFIG_CRC16=y ++CONFIG_CRC_T10DIF=y ++CONFIG_CRC_ITU_T=y ++CONFIG_CRC32=y ++CONFIG_CRC7=y ++CONFIG_LIBCRC32C=y ++CONFIG_ZLIB_INFLATE=y ++CONFIG_ZLIB_DEFLATE=y ++CONFIG_LZO_COMPRESS=y ++CONFIG_LZO_DECOMPRESS=y ++CONFIG_DECOMPRESS_GZIP=y ++CONFIG_TEXTSEARCH=y ++CONFIG_TEXTSEARCH_KMP=m ++CONFIG_TEXTSEARCH_BM=m ++CONFIG_TEXTSEARCH_FSM=m ++CONFIG_HAS_IOMEM=y ++CONFIG_HAS_IOPORT=y ++CONFIG_HAS_DMA=y ++CONFIG_NLATTR=y +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0006-omap3beagle-camera-Add-support-for-regulators.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0006-omap3beagle-camera-Add-support-for-regulators.patch new file mode 100644 index 00000000..1af46198 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0006-omap3beagle-camera-Add-support-for-regulators.patch @@ -0,0 +1,238 @@ +From a8bad5bfa652d2e35575f864da6192d41c85c818 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 11 Jun 2010 16:50:39 -0500 +Subject: [PATCH 06/75] omap3beagle: camera: Add support for regulators + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 92 +++++++++++++++++++++--- + arch/arm/mach-omap2/board-omap3beagle.c | 53 ++++++++++++++ + 2 files changed, 135 insertions(+), 10 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index e93437f..af8581a 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -28,8 +28,9 @@ + #include <linux/gpio.h> + #include <linux/mm.h> + #include <linux/videodev2.h> +-#include <linux/i2c/twl.h> ++#include <linux/regulator/consumer.h> + #include <linux/delay.h> ++#include <linux/platform_device.h> + + #include <plat/mux.h> + #include <plat/board.h> +@@ -50,6 +51,11 @@ + + #define CAM_USE_XCLKA 1 + ++static struct regulator *beagle_mt9t111_reg1; ++static struct regulator *beagle_mt9t111_reg2; ++ ++static struct device *beaglecam_dev; ++ + #if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) + static struct isp_interface_config mt9t111_if_config = { + .ccdc_par_ser = ISP_PARLL, +@@ -157,10 +163,13 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + + switch (power) { + case V4L2_POWER_OFF: ++ case V4L2_POWER_STANDBY: + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); +- break; + +- case V4L2_POWER_STANDBY: ++ if (regulator_is_enabled(beagle_mt9t111_reg1)) ++ regulator_disable(beagle_mt9t111_reg1); ++ if (regulator_is_enabled(beagle_mt9t111_reg2)) ++ regulator_disable(beagle_mt9t111_reg2); + break; + + case V4L2_POWER_ON: +@@ -169,6 +178,12 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + isp_configure_interface(vdev->cam->isp, &mt9t111_if_config); + #endif ++ ++ /* turn on analog power */ ++ regulator_enable(beagle_mt9t111_reg1); ++ regulator_enable(beagle_mt9t111_reg2); ++ udelay(100); ++ + break; + + default: +@@ -196,16 +211,22 @@ static struct i2c_board_info __initdata mt9t111_i2c_board_info = { + + #endif /* #ifdef CONFIG_VIDEO_MT9T111 */ + +-/** +- * @brief omap3beaglelmb_init - module init function. Should be called before any +- * client driver init call +- * +- * @return result of operation - 0 is success +- */ +-int __init omap3beaglelmb_init(void) ++ ++static int beagle_cam_probe(struct platform_device *pdev) + { + int err; + ++ beagle_mt9t111_reg1 = regulator_get(beaglecam_dev, "vaux3_1"); ++ if (IS_ERR(beagle_mt9t111_reg1)) { ++ dev_err(beaglecam_dev, "vaux3_1 regulator missing\n"); ++ return PTR_ERR(beagle_mt9t111_reg1); ++ } ++ beagle_mt9t111_reg2 = regulator_get(beaglecam_dev, "vaux4_1"); ++ if (IS_ERR(beagle_mt9t111_reg2)) { ++ dev_err(beaglecam_dev, "vaux4_1 regulator missing\n"); ++ regulator_put(beagle_mt9t111_reg1); ++ return PTR_ERR(beagle_mt9t111_reg2); ++ } + /* + * Register the I2C devices present in the board to the I2C + * framework. +@@ -221,8 +242,59 @@ int __init omap3beaglelmb_init(void) + return err; + } + #endif ++ ++ beaglecam_dev = &pdev->dev; ++ + printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); + + return 0; + } ++ ++static int beagle_cam_remove(struct platform_device *pdev) ++{ ++ if (regulator_is_enabled(beagle_mt9t111_reg1)) ++ regulator_disable(beagle_mt9t111_reg1); ++ regulator_put(beagle_mt9t111_reg1); ++ if (regulator_is_enabled(beagle_mt9t111_reg2)) ++ regulator_disable(beagle_mt9t111_reg2); ++ regulator_put(beagle_mt9t111_reg2); ++ ++ return 0; ++} ++ ++static int beagle_cam_suspend(struct device *dev) ++{ ++ return 0; ++} ++ ++static int beagle_cam_resume(struct device *dev) ++{ ++ return 0; ++} ++ ++static struct dev_pm_ops beagle_cam_pm_ops = { ++ .suspend = beagle_cam_suspend, ++ .resume = beagle_cam_resume, ++}; ++ ++static struct platform_driver beagle_cam_driver = { ++ .probe = beagle_cam_probe, ++ .remove = beagle_cam_remove, ++ .driver = { ++ .name = "beagle_cam", ++ .pm = &beagle_cam_pm_ops, ++ }, ++}; ++ ++/** ++ * @brief omap3beaglelmb_init - module init function. Should be called before any ++ * client driver init call ++ * ++ * @return result of operation - 0 is success ++ */ ++int __init omap3beaglelmb_init(void) ++{ ++ platform_driver_register(&beagle_cam_driver); ++ return 0; ++} + arch_initcall(omap3beaglelmb_init); +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index d6b69a6..aa16acd 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -403,6 +403,56 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = { + .setup = beagle_twl_gpio_setup, + }; + ++ ++static struct platform_device beagle_cam_device = { ++ .name = "beagle_cam", ++ .id = -1, ++}; ++ ++static struct regulator_consumer_supply beagle_vaux3_supplies[] = { ++ { ++ .supply = "vaux3_1", ++ .dev = &beagle_cam_device.dev, ++ }, ++}; ++ ++static struct regulator_consumer_supply beagle_vaux4_supplies[] = { ++ { ++ .supply = "vaux4_1", ++ .dev = &beagle_cam_device.dev, ++ }, ++}; ++ ++/* VAUX3 for CAM_1V8 */ ++static struct regulator_init_data beagle_vaux3 = { ++ .constraints = { ++ .min_uV = 1800000, ++ .max_uV = 1800000, ++ .apply_uV = true, ++ .valid_modes_mask = REGULATOR_MODE_NORMAL ++ | REGULATOR_MODE_STANDBY, ++ .valid_ops_mask = REGULATOR_CHANGE_MODE ++ | REGULATOR_CHANGE_STATUS, ++ }, ++ .num_consumer_supplies = ARRAY_SIZE(beagle_vaux3_supplies), ++ .consumer_supplies = beagle_vaux3_supplies, ++}; ++ ++/* VAUX4 for CAM_2V8 */ ++static struct regulator_init_data beagle_vaux4 = { ++ .constraints = { ++ .min_uV = 2800000, ++ .max_uV = 2800000, ++ .apply_uV = true, ++ .valid_modes_mask = REGULATOR_MODE_NORMAL ++ | REGULATOR_MODE_STANDBY, ++ .valid_ops_mask = REGULATOR_CHANGE_MODE ++ | REGULATOR_CHANGE_STATUS, ++ }, ++ .num_consumer_supplies = ARRAY_SIZE(beagle_vaux4_supplies), ++ .consumer_supplies = beagle_vaux4_supplies, ++}; ++ + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ + static struct regulator_init_data beagle_vmmc1 = { + .constraints = { +@@ -492,6 +542,8 @@ static struct twl4030_platform_data beagle_twldata = { + .vsim = &beagle_vsim, + .vdac = &beagle_vdac, + .vpll2 = &beagle_vpll2, ++ .vaux3 = &beagle_vaux3, ++ .vaux4 = &beagle_vaux4, + }; + + static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = { +@@ -658,6 +710,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = { + &leds_gpio, + &keys_gpio, + &beagle_dss_device, ++ &beagle_cam_device, + }; + + static void __init omap3beagle_flash_init(void) +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0007-TEMP-omap3beagle-cam-Enable-OMAP_MUX.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0007-TEMP-omap3beagle-cam-Enable-OMAP_MUX.patch new file mode 100644 index 00000000..76140eb8 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0007-TEMP-omap3beagle-cam-Enable-OMAP_MUX.patch @@ -0,0 +1,37 @@ +From 297b25089d0a06c89101e4f6a3189419be19369f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 11 Jun 2010 16:52:25 -0500 +Subject: [PATCH 07/75] TEMP: omap3beagle: cam: Enable OMAP_MUX + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/configs/omap3_beagle_cam_defconfig | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/configs/omap3_beagle_cam_defconfig b/arch/arm/configs/omap3_beagle_cam_defconfig +index 0ea8300..bcd9418 100644 +--- a/arch/arm/configs/omap3_beagle_cam_defconfig ++++ b/arch/arm/configs/omap3_beagle_cam_defconfig +@@ -1,7 +1,7 @@ + # + # Automatically generated make config: don't edit + # Linux kernel version: 2.6.32 +-# Fri Jun 11 14:25:23 2010 ++# Fri Jun 11 16:51:42 2010 + # + CONFIG_ARM=y + CONFIG_SYS_SUPPORTS_APM_EMULATION=y +@@ -240,7 +240,9 @@ CONFIG_ARCH_OMAP3=y + CONFIG_OMAP_SMARTREFLEX=y + # CONFIG_OMAP_SMARTREFLEX_TESTING is not set + CONFIG_OMAP_RESET_CLOCKS=y +-# CONFIG_OMAP_MUX is not set ++CONFIG_OMAP_MUX=y ++# CONFIG_OMAP_MUX_DEBUG is not set ++CONFIG_OMAP_MUX_WARNINGS=y + CONFIG_OMAP_MCBSP=y + CONFIG_OMAP_MBOX_FWK=m + CONFIG_OMAP_IOMMU=y +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0008-omap3beagle-camera-Fix-null-pointer-dereference.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0008-omap3beagle-camera-Fix-null-pointer-dereference.patch new file mode 100644 index 00000000..ecc83965 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0008-omap3beagle-camera-Fix-null-pointer-dereference.patch @@ -0,0 +1,54 @@ +From c46eeb468f9bb69ca4c82abd1ff07e0f35aaa50f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 11 Jun 2010 17:53:50 -0500 +Subject: [PATCH 08/75] omap3beagle: camera: Fix null pointer dereference + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 12 ++++-------- + 1 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index af8581a..20174a7 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -54,8 +54,6 @@ + static struct regulator *beagle_mt9t111_reg1; + static struct regulator *beagle_mt9t111_reg2; + +-static struct device *beaglecam_dev; +- + #if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) + static struct isp_interface_config mt9t111_if_config = { + .ccdc_par_ser = ISP_PARLL, +@@ -216,14 +214,14 @@ static int beagle_cam_probe(struct platform_device *pdev) + { + int err; + +- beagle_mt9t111_reg1 = regulator_get(beaglecam_dev, "vaux3_1"); ++ beagle_mt9t111_reg1 = regulator_get(&pdev->dev, "vaux3_1"); + if (IS_ERR(beagle_mt9t111_reg1)) { +- dev_err(beaglecam_dev, "vaux3_1 regulator missing\n"); ++ dev_err(&pdev->dev, "vaux3_1 regulator missing\n"); + return PTR_ERR(beagle_mt9t111_reg1); + } +- beagle_mt9t111_reg2 = regulator_get(beaglecam_dev, "vaux4_1"); ++ beagle_mt9t111_reg2 = regulator_get(&pdev->dev, "vaux4_1"); + if (IS_ERR(beagle_mt9t111_reg2)) { +- dev_err(beaglecam_dev, "vaux4_1 regulator missing\n"); ++ dev_err(&pdev->dev, "vaux4_1 regulator missing\n"); + regulator_put(beagle_mt9t111_reg1); + return PTR_ERR(beagle_mt9t111_reg2); + } +@@ -243,8 +241,6 @@ static int beagle_cam_probe(struct platform_device *pdev) + } + #endif + +- beaglecam_dev = &pdev->dev; +- + printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); + + return 0; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0009-Revert-TEMP-omap3beagle-cam-Enable-OMAP_MUX.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0009-Revert-TEMP-omap3beagle-cam-Enable-OMAP_MUX.patch new file mode 100644 index 00000000..cfcd2360 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0009-Revert-TEMP-omap3beagle-cam-Enable-OMAP_MUX.patch @@ -0,0 +1,42 @@ +From 4dc4c88bdb1f4be3de42f1cf5e8d5d62b6a2a04e Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Wed, 16 Jun 2010 03:23:57 +0300 +Subject: [PATCH 09/75] Revert "TEMP: omap3beagle: cam: Enable OMAP_MUX" + +This reverts commit 7d5f49845f06feadb9bc97d458d1ce03814ff5f4. + +Reason? + +Kernel panic on MMC partition mount, so probably muxing is broken +somewhere. +--- + arch/arm/configs/omap3_beagle_cam_defconfig | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/configs/omap3_beagle_cam_defconfig b/arch/arm/configs/omap3_beagle_cam_defconfig +index bcd9418..0ea8300 100644 +--- a/arch/arm/configs/omap3_beagle_cam_defconfig ++++ b/arch/arm/configs/omap3_beagle_cam_defconfig +@@ -1,7 +1,7 @@ + # + # Automatically generated make config: don't edit + # Linux kernel version: 2.6.32 +-# Fri Jun 11 16:51:42 2010 ++# Fri Jun 11 14:25:23 2010 + # + CONFIG_ARM=y + CONFIG_SYS_SUPPORTS_APM_EMULATION=y +@@ -240,9 +240,7 @@ CONFIG_ARCH_OMAP3=y + CONFIG_OMAP_SMARTREFLEX=y + # CONFIG_OMAP_SMARTREFLEX_TESTING is not set + CONFIG_OMAP_RESET_CLOCKS=y +-CONFIG_OMAP_MUX=y +-# CONFIG_OMAP_MUX_DEBUG is not set +-CONFIG_OMAP_MUX_WARNINGS=y ++# CONFIG_OMAP_MUX is not set + CONFIG_OMAP_MCBSP=y + CONFIG_OMAP_MBOX_FWK=m + CONFIG_OMAP_IOMMU=y +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0010-omap3beagle-camera-Change-arch-late_initcall.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0010-omap3beagle-camera-Change-arch-late_initcall.patch new file mode 100644 index 00000000..c9f2340a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0010-omap3beagle-camera-Change-arch-late_initcall.patch @@ -0,0 +1,25 @@ +From e998edf3c99b4f8a16519a2dc968b1841a274b7f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Wed, 16 Jun 2010 04:28:06 +0300 +Subject: [PATCH 10/75] omap3beagle: camera: Change arch -> late_initcall + +This is for ensuring that the regulators are initialized already. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 20174a7..55a113c 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -293,4 +293,4 @@ int __init omap3beaglelmb_init(void) + platform_driver_register(&beagle_cam_driver); + return 0; + } +-arch_initcall(omap3beaglelmb_init); ++late_initcall(omap3beaglelmb_init); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0011-omap3beagle-camera-Move-i2c-registration-to-the-main.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0011-omap3beagle-camera-Move-i2c-registration-to-the-main.patch new file mode 100644 index 00000000..15e647e5 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0011-omap3beagle-camera-Move-i2c-registration-to-the-main.patch @@ -0,0 +1,107 @@ +From 17c85e1bf42b03f4e764280b8a626853506517e6 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Wed, 16 Jun 2010 04:58:46 +0300 +Subject: [PATCH 11/75] omap3beagle: camera: Move i2c registration to the main board + +This is because the board-omap3beagle-camera.c file now is +late_initcall, and the i2c bus registration needed to be before +i2c host init. + +So, in order to have the i2c init, meanwhile having late_initcall, +this is so far the best solution. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 24 +----------------------- + arch/arm/mach-omap2/board-omap3beagle.c | 12 +++++++++++- + 2 files changed, 12 insertions(+), 24 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 55a113c..1652f15 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -47,8 +47,6 @@ + + #define MODULE_NAME "omap3beaglelmb" + +-#define MT9T111_I2C_BUSNUM (2) +- + #define CAM_USE_XCLKA 1 + + static struct regulator *beagle_mt9t111_reg1; +@@ -191,7 +189,7 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + return 0; + } + +-static struct mt9t111_platform_data mt9t111_pdata = { ++struct mt9t111_platform_data mt9t111_pdata = { + .master = "omap34xxcam", + .power_set = mt9t111_power_set, + .priv_data_set = mt9t111_set_prv_data, +@@ -202,11 +200,6 @@ static struct mt9t111_platform_data mt9t111_pdata = { + .vs_polarity = 1, /* 0 - Active low, 1- Active high */ + }; + +-static struct i2c_board_info __initdata mt9t111_i2c_board_info = { +- I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR), +- .platform_data = &mt9t111_pdata, +-}; +- + #endif /* #ifdef CONFIG_VIDEO_MT9T111 */ + + +@@ -225,21 +218,6 @@ static int beagle_cam_probe(struct platform_device *pdev) + regulator_put(beagle_mt9t111_reg1); + return PTR_ERR(beagle_mt9t111_reg2); + } +- /* +- * Register the I2C devices present in the board to the I2C +- * framework. +- * If more I2C devices are added, then each device information should +- * be registered with I2C using i2c_register_board_info(). +- */ +-#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) +- err = i2c_register_board_info(MT9T111_I2C_BUSNUM, +- &mt9t111_i2c_board_info, 1); +- if (err) { +- printk(KERN_ERR MODULE_NAME \ +- ": MT9T111 I2C Board Registration failed \n"); +- return err; +- } +-#endif + + printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index aa16acd..757d430 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -71,6 +71,11 @@ static struct omap_opp * _omap35x_l3_rate_table = NULL; + static struct omap_opp * _omap37x_l3_rate_table = NULL; + #endif /* CONFIG_PM */ + ++#ifdef CONFIG_VIDEO_MT9T111 ++#include <media/v4l2-int-device.h> ++#include <media/mt9t111.h> ++extern struct mt9t111_platform_data mt9t111_pdata; ++#endif + + #define GPMC_CS0_BASE 0x60 + #define GPMC_CS_SIZE 0x30 +@@ -588,7 +593,12 @@ static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = { + static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {}; + #endif + +-static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {}; ++static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { ++ { ++ I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR), ++ .platform_data = &mt9t111_pdata, ++ }, ++}; + + static int __init omap3_beagle_i2c_init(void) + { +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0012-ARM-OMAP3-make-camera-code-build-if-MT9T111-is-built.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0012-ARM-OMAP3-make-camera-code-build-if-MT9T111-is-built.patch new file mode 100644 index 00000000..7edb1563 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0012-ARM-OMAP3-make-camera-code-build-if-MT9T111-is-built.patch @@ -0,0 +1,38 @@ +From a36ff286ba2355488bd093f001a722d888cf9a8b Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 16 Jun 2010 09:45:46 +0200 +Subject: [PATCH 12/75] ARM: OMAP3: make camera code build if MT9T111 is built as module or disabled + +--- + arch/arm/mach-omap2/board-omap3beagle.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 757d430..1e9a868 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -71,7 +71,7 @@ static struct omap_opp * _omap35x_l3_rate_table = NULL; + static struct omap_opp * _omap37x_l3_rate_table = NULL; + #endif /* CONFIG_PM */ + +-#ifdef CONFIG_VIDEO_MT9T111 ++#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) + #include <media/v4l2-int-device.h> + #include <media/mt9t111.h> + extern struct mt9t111_platform_data mt9t111_pdata; +@@ -594,10 +594,12 @@ static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {}; + #endif + + static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { ++#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) + { + I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR), + .platform_data = &mt9t111_pdata, + }, ++#endif + }; + + static int __init omap3_beagle_i2c_init(void) +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0013-DEBUG-omap3beagle-camera-Force-mode0-in-cam_xclka.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0013-DEBUG-omap3beagle-camera-Force-mode0-in-cam_xclka.patch new file mode 100644 index 00000000..fceb5ed4 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0013-DEBUG-omap3beagle-camera-Force-mode0-in-cam_xclka.patch @@ -0,0 +1,41 @@ +From 7c09434499a8daa650b934a62d3f651f868e0e70 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Wed, 23 Jun 2010 15:03:24 -0500 +Subject: [PATCH 13/75] DEBUG: omap3beagle: camera: Force mode0 in cam_xclka + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 1652f15..77f9469 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -34,6 +34,7 @@ + + #include <plat/mux.h> + #include <plat/board.h> ++#include <plat/control.h> + + #include <media/v4l2-int-device.h> + #include <media/mt9t111.h> +@@ -160,6 +161,7 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + switch (power) { + case V4L2_POWER_OFF: + case V4L2_POWER_STANDBY: ++ omap_ctrl_writew(0x0, 0x110); /* Control XCLKA output mux */ + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); + + if (regulator_is_enabled(beagle_mt9t111_reg1)) +@@ -169,6 +171,7 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + break; + + case V4L2_POWER_ON: ++ omap_ctrl_writew(0x0, 0x110); /* Control XCLKA output mux */ + isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); + + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0014-OMAP3-CLOCK-Add-capability-to-change-rate-of-dpll4_m.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0014-OMAP3-CLOCK-Add-capability-to-change-rate-of-dpll4_m.patch new file mode 100644 index 00000000..0b4df884 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0014-OMAP3-CLOCK-Add-capability-to-change-rate-of-dpll4_m.patch @@ -0,0 +1,33 @@ +From 2841aa647058815680fe3ef969e7fda5e821016f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 4 Feb 2010 18:12:37 -0600 +Subject: [PATCH 14/75] OMAP3: CLOCK: Add capability to change rate of dpll4_m5_ck_3630 + +Add necessary clk_sel definitions to clock framework to allow changing +dpll4_m5_ck_3630 rate. + +Based on patch by Tuukka Toivonen <tuukka.o.toivonen@nokia.com> with subject: + + OMAP3: CLOCK: Add capability to change rate of dpll4_m5_ck + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/clock34xx_data.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/clock34xx_data.c b/arch/arm/mach-omap2/clock34xx_data.c +index 89e2f61..8d101ef 100644 +--- a/arch/arm/mach-omap2/clock34xx_data.c ++++ b/arch/arm/mach-omap2/clock34xx_data.c +@@ -934,6 +934,8 @@ static struct clk dpll4_m5_ck_3630 __initdata = { + .clksel = div32_dpll4_clksel, + .clkdm_name = "dpll4_clkdm", + .recalc = &omap2_clksel_recalc, ++ .set_rate = &omap2_clksel_set_rate, ++ .round_rate = &omap2_clksel_round_rate, + }; + + /* The PWRDN bit is apparently only available on 3430ES2 and above */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0015-Revert-DEBUG-omap3beagle-camera-Force-mode0-in-cam_x.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0015-Revert-DEBUG-omap3beagle-camera-Force-mode0-in-cam_x.patch new file mode 100644 index 00000000..090043b9 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0015-Revert-DEBUG-omap3beagle-camera-Force-mode0-in-cam_x.patch @@ -0,0 +1,41 @@ +From 1ae58f6d2ec41a1b7d0cdeca4de4b9d9760195bf Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 24 Jun 2010 14:27:39 -0500 +Subject: [PATCH 15/75] Revert "DEBUG: omap3beagle: camera: Force mode0 in cam_xclka" + +This reverts commit 158e14b3d449dde2c6aa9f8cddb86fbbee2d2cd7. +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 77f9469..1652f15 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -34,7 +34,6 @@ + + #include <plat/mux.h> + #include <plat/board.h> +-#include <plat/control.h> + + #include <media/v4l2-int-device.h> + #include <media/mt9t111.h> +@@ -161,7 +160,6 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + switch (power) { + case V4L2_POWER_OFF: + case V4L2_POWER_STANDBY: +- omap_ctrl_writew(0x0, 0x110); /* Control XCLKA output mux */ + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); + + if (regulator_is_enabled(beagle_mt9t111_reg1)) +@@ -171,7 +169,6 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + break; + + case V4L2_POWER_ON: +- omap_ctrl_writew(0x0, 0x110); /* Control XCLKA output mux */ + isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); + + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0016-omap3beagle-camera-Fix-wrong-XCLKA-selection.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0016-omap3beagle-camera-Fix-wrong-XCLKA-selection.patch new file mode 100644 index 00000000..68dd1b50 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0016-omap3beagle-camera-Fix-wrong-XCLKA-selection.patch @@ -0,0 +1,30 @@ +From 00bfc925651aa2c35a1726f15c028ef106f350ab Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 24 Jun 2010 17:31:49 -0500 +Subject: [PATCH 16/75] omap3beagle: camera: Fix wrong XCLKA selection + +The CAM_USE_XCLKA should have been 0 instead of 1. + +Otherwise it was activating XCLKB instead! + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 1652f15..75c8345 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -47,7 +47,7 @@ + + #define MODULE_NAME "omap3beaglelmb" + +-#define CAM_USE_XCLKA 1 ++#define CAM_USE_XCLKA 0 + + static struct regulator *beagle_mt9t111_reg1; + static struct regulator *beagle_mt9t111_reg2; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0017-omap3isp-set-CAM_MCLK-to-172.8-MHz-allows-exact-9.6-.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0017-omap3isp-set-CAM_MCLK-to-172.8-MHz-allows-exact-9.6-.patch new file mode 100644 index 00000000..78f7296a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0017-omap3isp-set-CAM_MCLK-to-172.8-MHz-allows-exact-9.6-.patch @@ -0,0 +1,91 @@ +From fc6044176be3518fee98430ebe36cc144d6feed2 Mon Sep 17 00:00:00 2001 +From: Tuukka Toivonen <tuukka.o.toivonen@nokia.com> +Date: Thu, 2 Jul 2009 16:17:55 +0200 +Subject: [PATCH 17/75] omap3isp: set CAM_MCLK to 172.8 MHz, allows exact 9.6 MHz for camera xclka/b + +Camera cam_xclka and cam_xclkb clocks are generated by dividing +CAM_MCLK with an integer. We want to use 9.6 MHz for cameras, +so CAM_MCLK should be multiple of it. Otherwise the generated +frequency is slightly off due to rounding. + +Signed-off-by: Tuukka Toivonen <tuukka.o.toivonen@nokia.com> +--- + drivers/media/video/isp/isp.c | 14 ++++++++++++++ + drivers/media/video/isp/isp.h | 1 + + drivers/media/video/isp/ispreg.h | 2 +- + 3 files changed, 16 insertions(+), 1 deletions(-) + +diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c +index ceed870..9d46c01 100644 +--- a/drivers/media/video/isp/isp.c ++++ b/drivers/media/video/isp/isp.c +@@ -2333,6 +2333,11 @@ static int isp_enable_clocks(struct device *dev) + dev_err(dev, "clk_enable cam_ick failed\n"); + goto out_clk_enable_ick; + } ++ r = clk_set_rate(isp->dpll4_m5_ck, CM_CAM_MCLK_HZ/2); ++ if (r) { ++ dev_err(dev, "clk_set_rate for dpll4_m5_ck failed\n"); ++ goto out_clk_enable_mclk; ++ } + r = clk_enable(isp->cam_mclk); + if (r) { + dev_err(dev, "clk_enable cam_mclk failed\n"); +@@ -2499,6 +2504,7 @@ static int isp_remove(struct platform_device *pdev) + + clk_put(isp->cam_ick); + clk_put(isp->cam_mclk); ++ clk_put(isp->dpll4_m5_ck); + clk_put(isp->csi2_fck); + clk_put(isp->l3_ick); + +@@ -2674,6 +2680,12 @@ static int isp_probe(struct platform_device *pdev) + ret_err = PTR_ERR(isp->cam_mclk); + goto out_clk_get_mclk; + } ++ isp->dpll4_m5_ck = clk_get(&camera_dev, "dpll4_m5_ck"); ++ if (IS_ERR(isp->dpll4_m5_ck)) { ++ dev_err(isp->dev, "clk_get dpll4_m5_ck failed\n"); ++ ret_err = PTR_ERR(isp->dpll4_m5_ck); ++ goto out_clk_get_dpll4_m5_ck; ++ } + isp->csi2_fck = clk_get(&camera_dev, "csi2_96m_fck"); + if (IS_ERR(isp->csi2_fck)) { + dev_err(isp->dev, "clk_get csi2_96m_fck failed\n"); +@@ -2734,6 +2746,8 @@ out_request_irq: + out_clk_get_l3_ick: + clk_put(isp->csi2_fck); + out_clk_get_csi2_fclk: ++ clk_put(isp->dpll4_m5_ck); ++out_clk_get_dpll4_m5_ck: + clk_put(isp->cam_mclk); + out_clk_get_mclk: + clk_put(isp->cam_ick); +diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h +index dc85d61..6b100b6 100644 +--- a/drivers/media/video/isp/isp.h ++++ b/drivers/media/video/isp/isp.h +@@ -414,6 +414,7 @@ struct isp_device { + int ref_count; + struct clk *cam_ick; + struct clk *cam_mclk; ++ struct clk *dpll4_m5_ck; + struct clk *csi2_fck; + struct clk *l3_ick; + struct isp_interface_config *config; +diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h +index 676a33d..1240e0e 100644 +--- a/drivers/media/video/isp/ispreg.h ++++ b/drivers/media/video/isp/ispreg.h +@@ -116,7 +116,7 @@ + #define ISP_32B_BOUNDARY_BUF 0xFFFFFFE0 + #define ISP_32B_BOUNDARY_OFFSET 0x0000FFE0 + +-#define CM_CAM_MCLK_HZ 216000000 ++#define CM_CAM_MCLK_HZ 172800000 /* Hz */ + + /* ISP Submodules offset */ + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0018-Fix-Moved-MCLK-setting-to-the-board-file.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0018-Fix-Moved-MCLK-setting-to-the-board-file.patch new file mode 100644 index 00000000..a47ee196 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0018-Fix-Moved-MCLK-setting-to-the-board-file.patch @@ -0,0 +1,209 @@ +From 6e9a8ed420020b5692b511b3e8a7c2c1325e1ca2 Mon Sep 17 00:00:00 2001 +From: Penda, Naveen <pnaveen@ti.com> +Date: Thu, 22 Oct 2009 06:07:01 +0530 +Subject: [PATCH 18/75] Fix: Moved MCLK setting to the board file + +This patch provides the flexibility to set the MCLK frequency + from the board file + +Signed-off-by: Naveen Penda <pnaveen@ti.com> +Signed-off-by: Curran, Dominic <dcurran@ti.com> +--- + arch/arm/mach-omap2/board-zoom2-camera.c | 10 ++++++ + drivers/media/video/isp/isp.c | 51 +++++++++++++++++++---------- + drivers/media/video/isp/isp.h | 6 +++ + 3 files changed, 49 insertions(+), 18 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-zoom2-camera.c b/arch/arm/mach-omap2/board-zoom2-camera.c +index 1ba2982..8c035c4 100644 +--- a/arch/arm/mach-omap2/board-zoom2-camera.c ++++ b/arch/arm/mach-omap2/board-zoom2-camera.c +@@ -41,6 +41,8 @@ static struct device *zoom2cam_dev; + + #define CAMZOOM2_USE_XCLKB 1 + ++#define ISP_IMX046_MCLK 216000000 ++ + /* Sensor specific GPIO signals */ + #define IMX046_RESET_GPIO 98 + #define IMX046_STANDBY_GPIO 58 +@@ -148,6 +150,7 @@ static struct isp_interface_config imx046_if_config = { + .shutter = 0x0, + .wenlog = ISPCCDC_CFG_WENLOG_AND, + .wait_hs_vs = 2, ++ .cam_mclk = ISP_IMX046_MCLK, + .u.csi.crc = 0x0, + .u.csi.mode = 0x0, + .u.csi.edge = 0x0, +@@ -264,6 +267,8 @@ static int imx046_sensor_power_set(struct v4l2_int_device *s, enum v4l2_power po + #ifdef CONFIG_OMAP_PM_SRF + omap_pm_set_min_bus_tput(vdev->cam->isp, OCP_INITIATOR_AGENT, 0); + #endif ++ if (previous_power != V4L2_POWER_OFF) ++ isp_disable_mclk(isp); + break; + case V4L2_POWER_STANDBY: + printk(KERN_DEBUG "imx046_sensor_power_set(STANDBY)\n"); +@@ -272,9 +277,14 @@ static int imx046_sensor_power_set(struct v4l2_int_device *s, enum v4l2_power po + #ifdef CONFIG_OMAP_PM_SRF + omap_pm_set_min_bus_tput(vdev->cam->isp, OCP_INITIATOR_AGENT, 0); + #endif ++ ++ ++ isp_disable_mclk(isp); ++ + break; + } + ++ + /* Save powerstate to know what was before calling POWER_ON. */ + previous_power = power; + return err; +diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c +index 9d46c01..cf68720 100644 +--- a/drivers/media/video/isp/isp.c ++++ b/drivers/media/video/isp/isp.c +@@ -552,7 +552,7 @@ EXPORT_SYMBOL(isp_unset_callback); + * Configures the specified MCLK divisor in the ISP timing control register + * (TCTRL_CTRL) to generate the desired xclk clock value. + * +- * Divisor = CM_CAM_MCLK_HZ / xclk ++ * Divisor = mclk / xclk + * + * Returns the final frequency that is actually being generated + **/ +@@ -560,15 +560,16 @@ u32 isp_set_xclk(struct device *dev, u32 xclk, u8 xclksel) + { + u32 divisor; + u32 currentxclk; ++ struct isp_device *isp = dev_get_drvdata(dev); + +- if (xclk >= CM_CAM_MCLK_HZ) { ++ if (xclk >= isp->mclk) { + divisor = ISPTCTRL_CTRL_DIV_BYPASS; +- currentxclk = CM_CAM_MCLK_HZ; ++ currentxclk = isp->mclk; + } else if (xclk >= 2) { +- divisor = CM_CAM_MCLK_HZ / xclk; ++ divisor = isp->mclk / xclk; + if (divisor >= ISPTCTRL_CTRL_DIV_BYPASS) + divisor = ISPTCTRL_CTRL_DIV_BYPASS - 1; +- currentxclk = CM_CAM_MCLK_HZ / divisor; ++ currentxclk = isp->mclk / divisor; + } else { + divisor = xclk; + currentxclk = 0; +@@ -874,6 +875,8 @@ int isp_configure_interface(struct device *dev, + /* Set sensor specific fields in CCDC and Previewer module. */ + ispccdc_set_wenlog(&isp->isp_ccdc, config->wenlog); + ++ isp->mclk = config->cam_mclk; ++ isp_enable_mclk(dev); + /* FIXME: this should be set in ispccdc_config_vp() */ + fmtcfg = isp_reg_readl(dev, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG); + fmtcfg &= ISPCCDC_FMTCFG_VPIF_FRQ_MASK; +@@ -2333,16 +2336,6 @@ static int isp_enable_clocks(struct device *dev) + dev_err(dev, "clk_enable cam_ick failed\n"); + goto out_clk_enable_ick; + } +- r = clk_set_rate(isp->dpll4_m5_ck, CM_CAM_MCLK_HZ/2); +- if (r) { +- dev_err(dev, "clk_set_rate for dpll4_m5_ck failed\n"); +- goto out_clk_enable_mclk; +- } +- r = clk_enable(isp->cam_mclk); +- if (r) { +- dev_err(dev, "clk_enable cam_mclk failed\n"); +- goto out_clk_enable_mclk; +- } + r = clk_enable(isp->csi2_fck); + if (r) { + dev_err(dev, "clk_enable csi2_fck failed\n"); +@@ -2351,13 +2344,34 @@ static int isp_enable_clocks(struct device *dev) + return 0; + + out_clk_enable_csi2_fclk: +- clk_disable(isp->cam_mclk); +-out_clk_enable_mclk: + clk_disable(isp->cam_ick); + out_clk_enable_ick: + return r; + } + ++int isp_enable_mclk(struct device *dev) ++{ ++ struct isp_device *isp = dev_get_drvdata(dev); ++ int r; ++ ++ r = clk_set_rate(isp->dpll4_m5_ck, isp->mclk); ++ if (r) { ++ dev_err(dev, "clk_set_rate for dpll4_m5_ck failed\n"); ++ return r; ++ } ++ r = clk_enable(isp->cam_mclk); ++ if (r) { ++ dev_err(dev, "clk_enable cam_mclk failed\n"); ++ return r; ++ } ++ return 0; ++} ++ ++void isp_disable_mclk(struct isp_device *isp) ++{ ++ clk_disable(isp->cam_mclk); ++} ++ + /** + * isp_disable_clocks - Disable ISP clocks + * @dev: Device pointer specific to the OMAP3 ISP. +@@ -2367,7 +2381,6 @@ static void isp_disable_clocks(struct device *dev) + struct isp_device *isp = dev_get_drvdata(dev); + + clk_disable(isp->cam_ick); +- clk_disable(isp->cam_mclk); + clk_disable(isp->csi2_fck); + } + +@@ -2668,6 +2681,8 @@ static int isp_probe(struct platform_device *pdev) + goto out_free_mmio; + } + ++ isp->mclk = CM_CAM_MCLK_HZ / 2; ++ + isp->cam_ick = clk_get(&camera_dev, "cam_ick"); + if (IS_ERR(isp->cam_ick)) { + dev_err(isp->dev, "clk_get cam_ick failed\n"); +diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h +index 6b100b6..85c3fa9 100644 +--- a/drivers/media/video/isp/isp.h ++++ b/drivers/media/video/isp/isp.h +@@ -199,6 +199,7 @@ struct isp_interface_config { + u32 prev_slv; + u32 wenlog; + int wait_hs_vs; ++ u32 cam_mclk; + unsigned int pixelclk; + union { + struct par { +@@ -425,6 +426,7 @@ struct isp_device { + struct isp_irq irq; + struct isp_pipeline pipeline; + u32 interrupts; ++ u32 mclk; + enum isp_running running; + int current_field; + int bt656ifen; +@@ -489,6 +491,10 @@ struct device *isp_get(void); + + int isp_put(void); + ++int isp_enable_mclk(struct device *dev); ++ ++void isp_disable_mclk(struct isp_device *dev); ++ + int isp_queryctrl(struct v4l2_queryctrl *a); + + int isp_querymenu(struct v4l2_querymenu *a); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0019-omap3isp-core-Do-smarter-MCLK-setting.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0019-omap3isp-core-Do-smarter-MCLK-setting.patch new file mode 100644 index 00000000..53fe6219 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0019-omap3isp-core-Do-smarter-MCLK-setting.patch @@ -0,0 +1,47 @@ +From 97761e2bdf286662e3c96f5a24fe568cac98fc9b Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Wed, 25 Nov 2009 12:30:46 -0600 +Subject: [PATCH 19/75] omap3isp: core: Do smarter MCLK setting + +Since the ratio between MCLK and DPLL4_M5 could not be 1:1 +(i.e. on 3430 its 2:1), it's necessary to check ratio +between those 2 first. + +This should make MCLK setting more adequate to different +chipsets. + +Tested on Zoom2 (3430 ES3.1) + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/isp/isp.c | 13 ++++++++++++- + 1 files changed, 12 insertions(+), 1 deletions(-) + +diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c +index cf68720..29dd005 100644 +--- a/drivers/media/video/isp/isp.c ++++ b/drivers/media/video/isp/isp.c +@@ -2353,8 +2353,19 @@ int isp_enable_mclk(struct device *dev) + { + struct isp_device *isp = dev_get_drvdata(dev); + int r; ++ unsigned long curr_mclk, curr_dpll4_m5, ratio; + +- r = clk_set_rate(isp->dpll4_m5_ck, isp->mclk); ++ /* Check ratio between DPLL4_M5 and CAM_MCLK */ ++ curr_mclk = clk_get_rate(isp->cam_mclk); ++ curr_dpll4_m5 = clk_get_rate(isp->dpll4_m5_ck); ++ ++ /* Protection for potential Zero division, or zero-ratio result */ ++ if (!curr_mclk || !curr_dpll4_m5) ++ BUG(); ++ ++ ratio = curr_mclk / curr_dpll4_m5; ++ ++ r = clk_set_rate(isp->dpll4_m5_ck, isp->mclk / ratio); + if (r) { + dev_err(dev, "clk_set_rate for dpll4_m5_ck failed\n"); + return r; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0020-omap3beagle-camera-set-mclk-for-mt9t111.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0020-omap3beagle-camera-set-mclk-for-mt9t111.patch new file mode 100644 index 00000000..97423f94 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0020-omap3beagle-camera-set-mclk-for-mt9t111.patch @@ -0,0 +1,36 @@ +From b744cbb89e3dd00a3f12d349ec0be604dffb5776 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 24 Jun 2010 16:34:13 -0500 +Subject: [PATCH 20/75] omap3beagle: camera: set mclk for mt9t111 + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 75c8345..529a6be 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -49,6 +49,8 @@ + + #define CAM_USE_XCLKA 0 + ++#define ISP_MT9T111_MCLK 216000000 ++ + static struct regulator *beagle_mt9t111_reg1; + static struct regulator *beagle_mt9t111_reg2; + +@@ -60,6 +62,9 @@ static struct isp_interface_config mt9t111_if_config = { + .strobe = 0x0, + .prestrobe = 0x0, + .shutter = 0x0, ++ .cam_mclk = ISP_MT9T111_MCLK, ++ .wenlog = ISPCCDC_CFG_WENLOG_AND, ++ .wait_hs_vs = 2, + .u.par.par_bridge = 0x1, + .u.par.par_clk_pol = 0x0, + }; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0021-mt9t111-Fix-max-supported-xclk.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0021-mt9t111-Fix-max-supported-xclk.patch new file mode 100644 index 00000000..731f20e7 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0021-mt9t111-Fix-max-supported-xclk.patch @@ -0,0 +1,28 @@ +From 3bca76ae1008ba2b2788214a59fd7813c69f9254 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 24 Jun 2010 17:43:23 -0500 +Subject: [PATCH 21/75] mt9t111: Fix max supported xclk + +According to Aptina documentation, the max should be 54 MHz, not 75 MHz. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + include/media/mt9t111.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h +index aae3f99..cd34885 100644 +--- a/include/media/mt9t111.h ++++ b/include/media/mt9t111.h +@@ -42,7 +42,7 @@ + /*i2c adress for MT9T111*/ + #define MT9T111_I2C_ADDR (0x78 >> 1) + +-#define MT9T111_CLK_MAX (75000000) /* 75MHz */ ++#define MT9T111_CLK_MAX (54000000) /* 54MHz */ + #define MT9T111_CLK_MIN (6000000) /* 6Mhz */ + + #define MT9T111_I2C_CONFIG (1) +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0022-omap3beagle-camera-Clarify-regulators-names.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0022-omap3beagle-camera-Clarify-regulators-names.patch new file mode 100644 index 00000000..8dcb76bb --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0022-omap3beagle-camera-Clarify-regulators-names.patch @@ -0,0 +1,103 @@ +From db7e3a7af04196e80fe15e2a651440575f9313af Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 24 Jun 2010 17:53:55 -0500 +Subject: [PATCH 22/75] omap3beagle: camera: Clarify regulators names + +Changed: + - beagle_mt9t111_reg1 -> beagle_mt9t111_1_8v + - beagle_mt9t111_reg2 -> beagle_mt9t111_2_8v + +To help clarify sequence. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 42 ++++++++++++------------ + 1 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 529a6be..6babaf3 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -51,8 +51,8 @@ + + #define ISP_MT9T111_MCLK 216000000 + +-static struct regulator *beagle_mt9t111_reg1; +-static struct regulator *beagle_mt9t111_reg2; ++static struct regulator *beagle_mt9t111_1_8v; ++static struct regulator *beagle_mt9t111_2_8v; + + #if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) + static struct isp_interface_config mt9t111_if_config = { +@@ -167,10 +167,10 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + case V4L2_POWER_STANDBY: + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); + +- if (regulator_is_enabled(beagle_mt9t111_reg1)) +- regulator_disable(beagle_mt9t111_reg1); +- if (regulator_is_enabled(beagle_mt9t111_reg2)) +- regulator_disable(beagle_mt9t111_reg2); ++ if (regulator_is_enabled(beagle_mt9t111_1_8v)) ++ regulator_disable(beagle_mt9t111_1_8v); ++ if (regulator_is_enabled(beagle_mt9t111_2_8v)) ++ regulator_disable(beagle_mt9t111_2_8v); + break; + + case V4L2_POWER_ON: +@@ -181,8 +181,8 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + #endif + + /* turn on analog power */ +- regulator_enable(beagle_mt9t111_reg1); +- regulator_enable(beagle_mt9t111_reg2); ++ regulator_enable(beagle_mt9t111_1_8v); ++ regulator_enable(beagle_mt9t111_2_8v); + udelay(100); + + break; +@@ -212,16 +212,16 @@ static int beagle_cam_probe(struct platform_device *pdev) + { + int err; + +- beagle_mt9t111_reg1 = regulator_get(&pdev->dev, "vaux3_1"); +- if (IS_ERR(beagle_mt9t111_reg1)) { ++ beagle_mt9t111_1_8v = regulator_get(&pdev->dev, "vaux3_1"); ++ if (IS_ERR(beagle_mt9t111_1_8v)) { + dev_err(&pdev->dev, "vaux3_1 regulator missing\n"); +- return PTR_ERR(beagle_mt9t111_reg1); ++ return PTR_ERR(beagle_mt9t111_1_8v); + } +- beagle_mt9t111_reg2 = regulator_get(&pdev->dev, "vaux4_1"); +- if (IS_ERR(beagle_mt9t111_reg2)) { ++ beagle_mt9t111_2_8v = regulator_get(&pdev->dev, "vaux4_1"); ++ if (IS_ERR(beagle_mt9t111_2_8v)) { + dev_err(&pdev->dev, "vaux4_1 regulator missing\n"); +- regulator_put(beagle_mt9t111_reg1); +- return PTR_ERR(beagle_mt9t111_reg2); ++ regulator_put(beagle_mt9t111_1_8v); ++ return PTR_ERR(beagle_mt9t111_2_8v); + } + + printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); +@@ -231,12 +231,12 @@ static int beagle_cam_probe(struct platform_device *pdev) + + static int beagle_cam_remove(struct platform_device *pdev) + { +- if (regulator_is_enabled(beagle_mt9t111_reg1)) +- regulator_disable(beagle_mt9t111_reg1); +- regulator_put(beagle_mt9t111_reg1); +- if (regulator_is_enabled(beagle_mt9t111_reg2)) +- regulator_disable(beagle_mt9t111_reg2); +- regulator_put(beagle_mt9t111_reg2); ++ if (regulator_is_enabled(beagle_mt9t111_1_8v)) ++ regulator_disable(beagle_mt9t111_1_8v); ++ regulator_put(beagle_mt9t111_1_8v); ++ if (regulator_is_enabled(beagle_mt9t111_2_8v)) ++ regulator_disable(beagle_mt9t111_2_8v); ++ regulator_put(beagle_mt9t111_2_8v); + + return 0; + } +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch new file mode 100644 index 00000000..052b9152 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch @@ -0,0 +1,103 @@ +From e4f2c3641ccae2cb1614c8fda5ce307170b20921 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 24 Jun 2010 18:21:52 -0500 +Subject: [PATCH 23/75] omap3beagle: camera: Fix powerup sequence + +The powerup sequence was very incomplete. After revisiting the +Aptina developer's guide, the resulting powerup sequence is followed. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 49 ++++++++++++++++++++++-- + 1 files changed, 45 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 6babaf3..792c48d 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -51,6 +51,8 @@ + + #define ISP_MT9T111_MCLK 216000000 + ++#define LEOPARD_RESET_GPIO 98 ++ + static struct regulator *beagle_mt9t111_1_8v; + static struct regulator *beagle_mt9t111_2_8v; + +@@ -174,16 +176,42 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + break; + + case V4L2_POWER_ON: +- isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); +- + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + isp_configure_interface(vdev->cam->isp, &mt9t111_if_config); + #endif + +- /* turn on analog power */ ++ /* Set RESET_BAR to 0 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 0); ++ ++ /* turn on VDD */ + regulator_enable(beagle_mt9t111_1_8v); ++ ++ mdelay(1); ++ ++ /* turn on VDD_IO */ + regulator_enable(beagle_mt9t111_2_8v); +- udelay(100); ++ ++ mdelay(50); ++ ++ /* Enable EXTCLK */ ++ isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); ++ ++ /* ++ * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): ++ * ((1000000 * 70) / 6000000) = aprox 12 us. ++ */ ++ ++ udelay(12); ++ ++ /* Set RESET_BAR to 1 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 1); ++ ++ /* ++ * Wait at least 100 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): ++ * ((1000000 * 100) / 6000000) = aprox 17 us. ++ */ ++ ++ udelay(17); + + break; + +@@ -224,6 +252,17 @@ static int beagle_cam_probe(struct platform_device *pdev) + return PTR_ERR(beagle_mt9t111_2_8v); + } + ++ if (gpio_request(LEOPARD_RESET_GPIO, "cam_rst") != 0) { ++ dev_err(&pdev->dev, "Could not request GPIO %d", ++ LEOPARD_RESET_GPIO); ++ regulator_put(beagle_mt9t111_2_8v); ++ regulator_put(beagle_mt9t111_1_8v); ++ return -ENODEV; ++ } ++ ++ /* set to output mode, default value 0 */ ++ gpio_direction_output(LEOPARD_RESET_GPIO, 0); ++ + printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); + + return 0; +@@ -238,6 +277,8 @@ static int beagle_cam_remove(struct platform_device *pdev) + regulator_disable(beagle_mt9t111_2_8v); + regulator_put(beagle_mt9t111_2_8v); + ++ gpio_free(LEOPARD_RESET_GPIO); ++ + return 0; + } + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0024-omap3beagle-camera-Change-vaux4-to-1.8v.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0024-omap3beagle-camera-Change-vaux4-to-1.8v.patch new file mode 100644 index 00000000..a0a2e91b --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0024-omap3beagle-camera-Change-vaux4-to-1.8v.patch @@ -0,0 +1,32 @@ +From 9f31f599f847c7eab995d22a683c8b32aaa5be7f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 25 Jun 2010 11:24:07 -0500 +Subject: [PATCH 24/75] omap3beagle: camera: Change vaux4 to 1.8v + +Both voltage sources seem to need 1.8v. + +After this, sensor is detected :) + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 1e9a868..af9b818 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -446,8 +446,8 @@ static struct regulator_init_data beagle_vaux3 = { + /* VAUX4 for CAM_2V8 */ + static struct regulator_init_data beagle_vaux4 = { + .constraints = { +- .min_uV = 2800000, +- .max_uV = 2800000, ++ .min_uV = 1800000, ++ .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0025-omap3beagle-camera-Rename-regulators-to-match-actual.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0025-omap3beagle-camera-Rename-regulators-to-match-actual.patch new file mode 100644 index 00000000..c32c4405 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0025-omap3beagle-camera-Rename-regulators-to-match-actual.patch @@ -0,0 +1,110 @@ +From 784407ada9241d907cf08145885410351a7eafc4 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 25 Jun 2010 12:03:59 -0500 +Subject: [PATCH 25/75] omap3beagle: camera: Rename regulators to match actual voltage levels + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 46 ++++++++++++------------ + 1 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 792c48d..8a4b7bc 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -53,8 +53,8 @@ + + #define LEOPARD_RESET_GPIO 98 + +-static struct regulator *beagle_mt9t111_1_8v; +-static struct regulator *beagle_mt9t111_2_8v; ++static struct regulator *beagle_mt9t111_1_8v1; ++static struct regulator *beagle_mt9t111_1_8v2; + + #if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) + static struct isp_interface_config mt9t111_if_config = { +@@ -169,10 +169,10 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + case V4L2_POWER_STANDBY: + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); + +- if (regulator_is_enabled(beagle_mt9t111_1_8v)) +- regulator_disable(beagle_mt9t111_1_8v); +- if (regulator_is_enabled(beagle_mt9t111_2_8v)) +- regulator_disable(beagle_mt9t111_2_8v); ++ if (regulator_is_enabled(beagle_mt9t111_1_8v1)) ++ regulator_disable(beagle_mt9t111_1_8v1); ++ if (regulator_is_enabled(beagle_mt9t111_1_8v2)) ++ regulator_disable(beagle_mt9t111_1_8v2); + break; + + case V4L2_POWER_ON: +@@ -184,12 +184,12 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + gpio_set_value(LEOPARD_RESET_GPIO, 0); + + /* turn on VDD */ +- regulator_enable(beagle_mt9t111_1_8v); ++ regulator_enable(beagle_mt9t111_1_8v1); + + mdelay(1); + + /* turn on VDD_IO */ +- regulator_enable(beagle_mt9t111_2_8v); ++ regulator_enable(beagle_mt9t111_1_8v2); + + mdelay(50); + +@@ -240,23 +240,23 @@ static int beagle_cam_probe(struct platform_device *pdev) + { + int err; + +- beagle_mt9t111_1_8v = regulator_get(&pdev->dev, "vaux3_1"); +- if (IS_ERR(beagle_mt9t111_1_8v)) { ++ beagle_mt9t111_1_8v1 = regulator_get(&pdev->dev, "vaux3_1"); ++ if (IS_ERR(beagle_mt9t111_1_8v1)) { + dev_err(&pdev->dev, "vaux3_1 regulator missing\n"); +- return PTR_ERR(beagle_mt9t111_1_8v); ++ return PTR_ERR(beagle_mt9t111_1_8v1); + } +- beagle_mt9t111_2_8v = regulator_get(&pdev->dev, "vaux4_1"); +- if (IS_ERR(beagle_mt9t111_2_8v)) { ++ beagle_mt9t111_1_8v2 = regulator_get(&pdev->dev, "vaux4_1"); ++ if (IS_ERR(beagle_mt9t111_1_8v2)) { + dev_err(&pdev->dev, "vaux4_1 regulator missing\n"); +- regulator_put(beagle_mt9t111_1_8v); +- return PTR_ERR(beagle_mt9t111_2_8v); ++ regulator_put(beagle_mt9t111_1_8v1); ++ return PTR_ERR(beagle_mt9t111_1_8v2); + } + + if (gpio_request(LEOPARD_RESET_GPIO, "cam_rst") != 0) { + dev_err(&pdev->dev, "Could not request GPIO %d", + LEOPARD_RESET_GPIO); +- regulator_put(beagle_mt9t111_2_8v); +- regulator_put(beagle_mt9t111_1_8v); ++ regulator_put(beagle_mt9t111_1_8v2); ++ regulator_put(beagle_mt9t111_1_8v1); + return -ENODEV; + } + +@@ -270,12 +270,12 @@ static int beagle_cam_probe(struct platform_device *pdev) + + static int beagle_cam_remove(struct platform_device *pdev) + { +- if (regulator_is_enabled(beagle_mt9t111_1_8v)) +- regulator_disable(beagle_mt9t111_1_8v); +- regulator_put(beagle_mt9t111_1_8v); +- if (regulator_is_enabled(beagle_mt9t111_2_8v)) +- regulator_disable(beagle_mt9t111_2_8v); +- regulator_put(beagle_mt9t111_2_8v); ++ if (regulator_is_enabled(beagle_mt9t111_1_8v1)) ++ regulator_disable(beagle_mt9t111_1_8v1); ++ regulator_put(beagle_mt9t111_1_8v1); ++ if (regulator_is_enabled(beagle_mt9t111_1_8v2)) ++ regulator_disable(beagle_mt9t111_1_8v2); ++ regulator_put(beagle_mt9t111_1_8v2); + + gpio_free(LEOPARD_RESET_GPIO); + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0026-omap3beagle-camera-Complement-remainig-sensor-hw-con.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0026-omap3beagle-camera-Complement-remainig-sensor-hw-con.patch new file mode 100644 index 00000000..854d1979 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0026-omap3beagle-camera-Complement-remainig-sensor-hw-con.patch @@ -0,0 +1,37 @@ +From e14b36353ea3f3d55192cf986310c275ed8cfcc9 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 25 Jun 2010 12:04:48 -0500 +Subject: [PATCH 26/75] omap3beagle: camera: Complement remainig sensor hw config settings + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 8a4b7bc..b0148d6 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -57,6 +57,10 @@ static struct regulator *beagle_mt9t111_1_8v1; + static struct regulator *beagle_mt9t111_1_8v2; + + #if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++ ++/* Arbitrary memory handling limit */ ++#define MT9T111_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN(2048 * 1536 * 4) ++ + static struct isp_interface_config mt9t111_if_config = { + .ccdc_par_ser = ISP_PARLL, + .dataline_shift = 0x0, +@@ -125,6 +129,8 @@ static struct omap34xxcam_hw_config mt9t111_hwc = { + .dev_minor = 0, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, + .u.sensor.sensor_isp = 1, ++ .u.sensor.capture_mem = MT9T111_BIGGEST_FRAME_BYTE_SIZE * 2, ++ .u.sensor.ival_default = { 1, 10 }, + }; + #endif + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0027-mt9t111-Fix-detect-function-retval-and-cleanup-print.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0027-mt9t111-Fix-detect-function-retval-and-cleanup-print.patch new file mode 100644 index 00000000..4ca56e1d --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0027-mt9t111-Fix-detect-function-retval-and-cleanup-print.patch @@ -0,0 +1,48 @@ +From db54f40408b0907a6cf314232bbf2b9f12ac0d9d Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 25 Jun 2010 13:43:54 -0500 +Subject: [PATCH 27/75] mt9t111: Fix detect function retval and cleanup prints + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t111.c | 8 +++----- + 1 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c +index 6a7b2c0..08122ff 100644 +--- a/drivers/media/video/mt9t111.c ++++ b/drivers/media/video/mt9t111.c +@@ -221,7 +221,6 @@ mt9t111_detect(struct i2c_client *client) + /* chip ID is at address 0 */ + if (mt9t111_read_reg(client, MT9T111_CHIP_ID, &val) < 0) + return -ENODEV; +- dev_info(&client->dev, "model id detected 0x%x\n", val); + + if (val != MT9T111_CHIP_ID_VALUE) { + dev_warn(&client->dev, "model id mismatch received 0x%x" +@@ -231,7 +230,7 @@ mt9t111_detect(struct i2c_client *client) + return -ENODEV; + } + +- return 0; ++ return (int)val; + + } + +@@ -390,11 +389,10 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + sensor->state = SENSOR_NOT_DETECTED; + return rval; + } +- mt9t111_loaddefault(c); ++ dev_info(&c->dev, "chip version 0x%02x detected\n", rval); + sensor->state = SENSOR_DETECTED; + sensor->ver = rval; +- pr_info("mt9t111" " chip version 0x%02x detected\n", +- sensor->ver); ++ mt9t111_loaddefault(c); + } + return 0; + } +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0028-omap3beagle-camera-Set-padconf-settings-in-cam-init.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0028-omap3beagle-camera-Set-padconf-settings-in-cam-init.patch new file mode 100644 index 00000000..c9dda1a9 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0028-omap3beagle-camera-Set-padconf-settings-in-cam-init.patch @@ -0,0 +1,66 @@ +From 9d152df885cb6f6874259d93df558e649f62774f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 25 Jun 2010 16:01:00 -0500 +Subject: [PATCH 28/75] omap3beagle: camera: Set padconf settings in cam init + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 35 ++++++++++++++++++++++++ + 1 files changed, 35 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index b0148d6..75471f2 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -34,6 +34,7 @@ + + #include <plat/mux.h> + #include <plat/board.h> ++#include <plat/control.h> + + #include <media/v4l2-int-device.h> + #include <media/mt9t111.h> +@@ -285,6 +286,40 @@ static int beagle_cam_remove(struct platform_device *pdev) + + gpio_free(LEOPARD_RESET_GPIO); + ++ /* MUX init */ ++ omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, ++ 0x10C); /* CAM_HS */ ++ omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, ++ 0x10E); /* CAM_VS */ ++ omap_ctrl_writew(OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, ++ 0x110); /* CAM_XCLKA */ ++ omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, ++ 0x112); /* CAM_PCLK */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x116); /* CAM_D0 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x118); /* CAM_D1 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x11A); /* CAM_D2 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x11C); /* CAM_D3 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x11E); /* CAM_D4 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x120); /* CAM_D5 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x122); /* CAM_D6 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x124); /* CAM_D7 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x126); /* CAM_D8 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x128); /* CAM_D9 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x12A); /* CAM_D10 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x12C); /* CAM_D11 */ ++ + return 0; + } + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0029-omap3beagle-camera-only-register-camera-driver-for-3.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0029-omap3beagle-camera-only-register-camera-driver-for-3.patch new file mode 100644 index 00000000..d642d6cb --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0029-omap3beagle-camera-only-register-camera-driver-for-3.patch @@ -0,0 +1,31 @@ +From 7a8fe70470bd026b249f47c0aa37578a97fb2bb3 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Sun, 27 Jun 2010 16:11:39 +0200 +Subject: [PATCH 29/75] omap3beagle: camera: only register camera driver for 36xx based SoCs + +This is a workaround for the bootcrash when used on 35xx based beagleboards. + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 75471f2..8faa437 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -355,7 +355,9 @@ static struct platform_driver beagle_cam_driver = { + */ + int __init omap3beaglelmb_init(void) + { +- platform_driver_register(&beagle_cam_driver); +- return 0; ++ if (cpu_is_omap3630()) { ++ platform_driver_register(&beagle_cam_driver); ++ } ++ return 0; + } + late_initcall(omap3beaglelmb_init); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0030-WIP-mt9t111-Work-in-progress-for-camera-enablement.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0030-WIP-mt9t111-Work-in-progress-for-camera-enablement.patch new file mode 100644 index 00000000..11abb8b4 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0030-WIP-mt9t111-Work-in-progress-for-camera-enablement.patch @@ -0,0 +1,53 @@ +From b310c5ad504443f0d125ca92106f497e14acd8bd Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 25 Jun 2010 16:01:47 -0500 +Subject: [PATCH 30/75] WIP: mt9t111: Work in progress for camera enablement + +This is changing so far: +- Remove useless printk's in enum_frameinterval calls. +- Call mt9t111_loaddefault instead of mt9t111_configure dummy function. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t111.c | 11 +---------- + 1 files changed, 1 insertions(+), 10 deletions(-) + +diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c +index 08122ff..10080af 100644 +--- a/drivers/media/video/mt9t111.c ++++ b/drivers/media/video/mt9t111.c +@@ -288,14 +288,6 @@ static int ioctl_enum_frameintervals(struct v4l2_int_device *s, + { + int ifmt; + +- printk(KERN_INFO "entering ioctl_enum_frameintervals\n"); +- printk(KERN_INFO "index = %d, pixel_format = 0x%x," +- " width = %d, height = %d\n", +- frmi->index, frmi->pixel_format, +- frmi->width, frmi->height); +- printk(KERN_INFO "mt9t111 format = 0x%x\n", +- mt9t111_formats[0].pixelformat); +- + if (frmi->index >= NUM_CAPTURE_FRAMEINTERVALS) + return -EINVAL; + +@@ -379,7 +371,7 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + } + + if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_DETECTED)) +- mt9t111_configure(s); ++ mt9t111_loaddefault(c); + + if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_NOT_DETECTED)) { + rval = mt9t111_detect(c); +@@ -392,7 +384,6 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + dev_info(&c->dev, "chip version 0x%02x detected\n", rval); + sensor->state = SENSOR_DETECTED; + sensor->ver = rval; +- mt9t111_loaddefault(c); + } + return 0; + } +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0031-BeagleXM-Cam-Add-support-for-MT9V113-VGA-Sensor.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0031-BeagleXM-Cam-Add-support-for-MT9V113-VGA-Sensor.patch new file mode 100644 index 00000000..f8b4af9d --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0031-BeagleXM-Cam-Add-support-for-MT9V113-VGA-Sensor.patch @@ -0,0 +1,2441 @@ +From 2355a460abc09be0a8c61360792a59056eb09230 Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Wed, 7 Jul 2010 11:55:43 +0530 +Subject: [PATCH 31/75] BeagleXM:Cam: Add support for MT9V113 VGA Sensor + +This patch replaces the MT9T111 to MT9V113 sensor. +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 132 ++- + arch/arm/mach-omap2/board-omap3beagle.c | 32 +- + drivers/media/video/Kconfig | 10 + + drivers/media/video/Makefile | 1 + + drivers/media/video/mt9v113.c | 1522 ++++++++++++++++++++++++ + drivers/media/video/mt9v113_regs.h | 294 +++++ + include/media/mt9v113.h | 83 ++ + include/media/v4l2-int-device.h | 27 + + 8 files changed, 2023 insertions(+), 78 deletions(-) + create mode 100644 drivers/media/video/mt9v113.c + create mode 100644 drivers/media/video/mt9v113_regs.h + create mode 100644 include/media/mt9v113.h + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 8faa437..6c06265 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -37,7 +37,7 @@ + #include <plat/control.h> + + #include <media/v4l2-int-device.h> +-#include <media/mt9t111.h> ++#include <media/mt9v113.h> + + /* Include V4L2 ISP-Camera driver related header file */ + #include <../drivers/media/video/omap34xxcam.h> +@@ -50,99 +50,99 @@ + + #define CAM_USE_XCLKA 0 + +-#define ISP_MT9T111_MCLK 216000000 ++#define ISP_MT9V113_MCLK 216000000 + + #define LEOPARD_RESET_GPIO 98 + +-static struct regulator *beagle_mt9t111_1_8v1; +-static struct regulator *beagle_mt9t111_1_8v2; ++static struct regulator *beagle_mt9v113_1_8v1; ++static struct regulator *beagle_mt9v113_1_8v2; + +-#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++#if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE) + + /* Arbitrary memory handling limit */ +-#define MT9T111_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN(2048 * 1536 * 4) ++#define MT9V113_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN(2048 * 1536 * 4) + +-static struct isp_interface_config mt9t111_if_config = { +- .ccdc_par_ser = ISP_PARLL, ++static struct isp_interface_config mt9v113_if_config = { ++ .ccdc_par_ser = ISP_PARLL, + .dataline_shift = 0x0, + .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE, + .strobe = 0x0, + .prestrobe = 0x0, + .shutter = 0x0, +- .cam_mclk = ISP_MT9T111_MCLK, ++ .cam_mclk = ISP_MT9V113_MCLK, + .wenlog = ISPCCDC_CFG_WENLOG_AND, + .wait_hs_vs = 2, + .u.par.par_bridge = 0x1, + .u.par.par_clk_pol = 0x0, + }; + +-static struct v4l2_ifparm mt9t111_ifparm_s = { ++static struct v4l2_ifparm mt9v113_ifparm_s = { + #if 1 +- .if_type = V4L2_IF_TYPE_RAW, ++ .if_type = V4L2_IF_TYPE_RAW, + .u = { +- .raw = { ++ .raw = { + .frame_start_on_rising_vs = 1, + .bt_sync_correct = 0, + .swap = 0, + .latch_clk_inv = 0, + .nobt_hs_inv = 0, /* active high */ + .nobt_vs_inv = 0, /* active high */ +- .clock_min = MT9T111_CLK_MIN, +- .clock_max = MT9T111_CLK_MAX, ++ .clock_min = MT9V113_CLK_MIN, ++ .clock_max = MT9V113_CLK_MAX, + }, + }, +-#else +- .if_type = V4L2_IF_TYPE_YCbCr, ++#else ++ .if_type = V4L2_IF_TYPE_YCbCr, + .u = { +- .ycbcr = { ++ .ycbcr = { + .frame_start_on_rising_vs = 1, + .bt_sync_correct = 0, + .swap = 0, + .latch_clk_inv = 0, + .nobt_hs_inv = 0, /* active high */ + .nobt_vs_inv = 0, /* active high */ +- .clock_min = MT9T111_CLK_MIN, +- .clock_max = MT9T111_CLK_MAX, ++ .clock_min = MT9V113_CLK_MIN, ++ .clock_max = MT9V113_CLK_MAX, + }, + }, + #endif + }; + + /** +- * @brief mt9t111_ifparm - Returns the mt9t111 interface parameters ++ * @brief mt9v113_ifparm - Returns the mt9v113 interface parameters + * + * @param p - pointer to v4l2_ifparm structure + * + * @return result of operation - 0 is success + */ +-static int mt9t111_ifparm(struct v4l2_ifparm *p) ++static int mt9v113_ifparm(struct v4l2_ifparm *p) + { + if (p == NULL) + return -EINVAL; + +- *p = mt9t111_ifparm_s; ++ *p = mt9v113_ifparm_s; + return 0; + } + + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +-static struct omap34xxcam_hw_config mt9t111_hwc = { ++static struct omap34xxcam_hw_config mt9v113_hwc = { + .dev_index = 0, + .dev_minor = 0, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, + .u.sensor.sensor_isp = 1, +- .u.sensor.capture_mem = MT9T111_BIGGEST_FRAME_BYTE_SIZE * 2, ++ .u.sensor.capture_mem = MT9V113_BIGGEST_FRAME_BYTE_SIZE * 2, + .u.sensor.ival_default = { 1, 10 }, + }; + #endif + + /** +- * @brief mt9t111_set_prv_data - Returns mt9t111 omap34xx driver private data ++ * @brief mt9v113_set_prv_data - Returns mt9v113 omap34xx driver private data + * + * @param priv - pointer to omap34xxcam_hw_config structure + * + * @return result of operation - 0 is success + */ +-static int mt9t111_set_prv_data(void *priv) ++static int mt9v113_set_prv_data(void *priv) + { + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + struct omap34xxcam_hw_config *hwc = priv; +@@ -150,10 +150,10 @@ static int mt9t111_set_prv_data(void *priv) + if (priv == NULL) + return -EINVAL; + +- hwc->u.sensor = mt9t111_hwc.u.sensor; +- hwc->dev_index = mt9t111_hwc.dev_index; +- hwc->dev_minor = mt9t111_hwc.dev_minor; +- hwc->dev_type = mt9t111_hwc.dev_type; ++ hwc->u.sensor = mt9v113_hwc.u.sensor; ++ hwc->dev_index = mt9v113_hwc.dev_index; ++ hwc->dev_minor = mt9v113_hwc.dev_minor; ++ hwc->dev_type = mt9v113_hwc.dev_type; + return 0; + #else + return -EINVAL; +@@ -161,13 +161,13 @@ static int mt9t111_set_prv_data(void *priv) + } + + /** +- * @brief mt9t111_power_set - Power-on or power-off TVP5146 device ++ * @brief mt9v113_power_set - Power-on or power-off TVP5146 device + * + * @param power - enum, Power on/off, resume/standby + * + * @return result of operation - 0 is success + */ +-static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) ++static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + { + struct omap34xxcam_videodev *vdev = s->u.slave->master->priv; + +@@ -176,32 +176,32 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + case V4L2_POWER_STANDBY: + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); + +- if (regulator_is_enabled(beagle_mt9t111_1_8v1)) +- regulator_disable(beagle_mt9t111_1_8v1); +- if (regulator_is_enabled(beagle_mt9t111_1_8v2)) +- regulator_disable(beagle_mt9t111_1_8v2); ++ if (regulator_is_enabled(beagle_mt9v113_1_8v1)) ++ regulator_disable(beagle_mt9v113_1_8v1); ++ if (regulator_is_enabled(beagle_mt9v113_1_8v2)) ++ regulator_disable(beagle_mt9v113_1_8v2); + break; + + case V4L2_POWER_ON: + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +- isp_configure_interface(vdev->cam->isp, &mt9t111_if_config); ++ isp_configure_interface(vdev->cam->isp, &mt9v113_if_config); + #endif + + /* Set RESET_BAR to 0 */ + gpio_set_value(LEOPARD_RESET_GPIO, 0); + + /* turn on VDD */ +- regulator_enable(beagle_mt9t111_1_8v1); ++ regulator_enable(beagle_mt9v113_1_8v1); + + mdelay(1); + + /* turn on VDD_IO */ +- regulator_enable(beagle_mt9t111_1_8v2); ++ regulator_enable(beagle_mt9v113_1_8v2); + + mdelay(50); + + /* Enable EXTCLK */ +- isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); ++ isp_set_xclk(vdev->cam->isp, MT9V113_CLK_MIN, CAM_USE_XCLKA); + + /* + * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): +@@ -229,44 +229,48 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + return 0; + } + +-struct mt9t111_platform_data mt9t111_pdata = { ++struct mt9v113_platform_data mt9v113_pdata = { + .master = "omap34xxcam", +- .power_set = mt9t111_power_set, +- .priv_data_set = mt9t111_set_prv_data, +- .ifparm = mt9t111_ifparm, ++ .power_set = mt9v113_power_set, ++ .priv_data_set = mt9v113_set_prv_data, ++ .ifparm = mt9v113_ifparm, + /* Some interface dependent params */ + .clk_polarity = 0, /* data clocked out on falling edge */ + .hs_polarity = 1, /* 0 - Active low, 1- Active high */ + .vs_polarity = 1, /* 0 - Active low, 1- Active high */ + }; + +-#endif /* #ifdef CONFIG_VIDEO_MT9T111 */ ++#endif /* #ifdef CONFIG_VIDEO_MT9V113 */ + + + static int beagle_cam_probe(struct platform_device *pdev) + { + int err; + +- beagle_mt9t111_1_8v1 = regulator_get(&pdev->dev, "vaux3_1"); +- if (IS_ERR(beagle_mt9t111_1_8v1)) { ++ printk("%s:%d\n", __func__, __LINE__); ++ beagle_mt9v113_1_8v1 = regulator_get(&pdev->dev, "vaux3_1"); ++ if (IS_ERR(beagle_mt9v113_1_8v1)) { + dev_err(&pdev->dev, "vaux3_1 regulator missing\n"); +- return PTR_ERR(beagle_mt9t111_1_8v1); ++ return PTR_ERR(beagle_mt9v113_1_8v1); + } +- beagle_mt9t111_1_8v2 = regulator_get(&pdev->dev, "vaux4_1"); +- if (IS_ERR(beagle_mt9t111_1_8v2)) { ++ printk("%s:%d\n", __func__, __LINE__); ++ beagle_mt9v113_1_8v2 = regulator_get(&pdev->dev, "vaux4_1"); ++ if (IS_ERR(beagle_mt9v113_1_8v2)) { + dev_err(&pdev->dev, "vaux4_1 regulator missing\n"); +- regulator_put(beagle_mt9t111_1_8v1); +- return PTR_ERR(beagle_mt9t111_1_8v2); ++ regulator_put(beagle_mt9v113_1_8v1); ++ return PTR_ERR(beagle_mt9v113_1_8v2); + } + ++ printk("%s:%d\n", __func__, __LINE__); + if (gpio_request(LEOPARD_RESET_GPIO, "cam_rst") != 0) { + dev_err(&pdev->dev, "Could not request GPIO %d", + LEOPARD_RESET_GPIO); +- regulator_put(beagle_mt9t111_1_8v2); +- regulator_put(beagle_mt9t111_1_8v1); ++ regulator_put(beagle_mt9v113_1_8v2); ++ regulator_put(beagle_mt9v113_1_8v1); + return -ENODEV; + } + ++ printk("%s:%d\n", __func__, __LINE__); + /* set to output mode, default value 0 */ + gpio_direction_output(LEOPARD_RESET_GPIO, 0); + +@@ -277,12 +281,13 @@ static int beagle_cam_probe(struct platform_device *pdev) + + static int beagle_cam_remove(struct platform_device *pdev) + { +- if (regulator_is_enabled(beagle_mt9t111_1_8v1)) +- regulator_disable(beagle_mt9t111_1_8v1); +- regulator_put(beagle_mt9t111_1_8v1); +- if (regulator_is_enabled(beagle_mt9t111_1_8v2)) +- regulator_disable(beagle_mt9t111_1_8v2); +- regulator_put(beagle_mt9t111_1_8v2); ++ printk("%s:%d\n", __func__, __LINE__); ++ if (regulator_is_enabled(beagle_mt9v113_1_8v1)) ++ regulator_disable(beagle_mt9v113_1_8v1); ++ regulator_put(beagle_mt9v113_1_8v1); ++ if (regulator_is_enabled(beagle_mt9v113_1_8v2)) ++ regulator_disable(beagle_mt9v113_1_8v2); ++ regulator_put(beagle_mt9v113_1_8v2); + + gpio_free(LEOPARD_RESET_GPIO); + +@@ -355,9 +360,12 @@ static struct platform_driver beagle_cam_driver = { + */ + int __init omap3beaglelmb_init(void) + { ++ printk("%s:%d\n", __func__, __LINE__); + if (cpu_is_omap3630()) { +- platform_driver_register(&beagle_cam_driver); ++ printk("%s:%d\n", __func__, __LINE__); ++ platform_driver_register(&beagle_cam_driver); + } +- return 0; ++ printk("%s:%d\n", __func__, __LINE__); ++ return 0; + } + late_initcall(omap3beaglelmb_init); +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index af9b818..d4b0b0a 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -71,10 +71,10 @@ static struct omap_opp * _omap35x_l3_rate_table = NULL; + static struct omap_opp * _omap37x_l3_rate_table = NULL; + #endif /* CONFIG_PM */ + +-#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++#if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE) + #include <media/v4l2-int-device.h> +-#include <media/mt9t111.h> +-extern struct mt9t111_platform_data mt9t111_pdata; ++#include <media/mt9v113.h> ++extern struct mt9v113_platform_data mt9v113_pdata; + #endif + + #define GPMC_CS0_BASE 0x60 +@@ -159,7 +159,7 @@ static void __init omap3beagle_ks8851_init(void) + printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n"); + return; + } +- ++ + spi_register_board_info(omap3beagle_zippy2_spi_board_info, + ARRAY_SIZE(omap3beagle_zippy2_spi_board_info)); + } +@@ -369,9 +369,9 @@ static int beagle_twl_gpio_setup(struct device *dev, + */ + + if (cpu_is_omap3630()) { +- /* Power on DVI, Serial and PWR led */ ++ /* Power on DVI, Serial and PWR led */ + gpio_request(gpio + 1, "nDVI_PWR_EN"); +- gpio_direction_output(gpio + 1, 0); ++ gpio_direction_output(gpio + 1, 0); + + /* Power on camera interface */ + gpio_request(gpio + 2, "CAM_EN"); +@@ -560,7 +560,7 @@ static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = { + }, + }; + +- ++ + #if defined(CONFIG_EEPROM_AT24) || defined(CONFIG_EEPROM_AT24_MODULE) + #include <linux/i2c/at24.h> + +@@ -594,10 +594,10 @@ static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {}; + #endif + + static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { +-#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++#if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE) + { +- I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR), +- .platform_data = &mt9t111_pdata, ++ I2C_BOARD_INFO("mt9v113", MT9V113_I2C_ADDR), ++ .platform_data = &mt9v113_pdata, + }, + #endif + }; +@@ -606,7 +606,7 @@ static int __init omap3_beagle_i2c_init(void) + { + omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo, + ARRAY_SIZE(beagle_i2c1_boardinfo)); +- if(!strcmp(expansionboard_name, "zippy") || !strcmp(expansionboard_name, "zippy2")) ++ if(!strcmp(expansionboard_name, "zippy") || !strcmp(expansionboard_name, "zippy2")) + { + printk(KERN_INFO "Beagle expansionboard: registering i2c2 bus for zippy/zippy2\n"); + omap_register_i2c_bus(2, 400, beagle_zippy_i2c2_boardinfo, +@@ -681,7 +681,7 @@ static struct spi_board_info beaglefpga_mcspi_board_info[] = { + .modalias = "spidev", + .max_speed_hz = 48000000, //48 Mbps + .bus_num = 4, +- .chip_select = 0, ++ .chip_select = 0, + .mode = SPI_MODE_1, + }, + }; +@@ -830,7 +830,7 @@ static void __init omap3_beagle_init(void) + /* REVISIT leave DVI powered down until it's needed ... */ + gpio_direction_output(170, true); + +- if(!strcmp(expansionboard_name, "zippy")) ++ if(!strcmp(expansionboard_name, "zippy")) + { + printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n"); + omap3beagle_enc28j60_init(); +@@ -838,8 +838,8 @@ static void __init omap3_beagle_init(void) + mmc[1].gpio_wp = 141; + mmc[1].gpio_cd = 162; + } +- +- if(!strcmp(expansionboard_name, "zippy2")) ++ ++ if(!strcmp(expansionboard_name, "zippy2")) + { + printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n"); + omap3beagle_ks8851_init(); +@@ -880,7 +880,7 @@ static void __init omap3_beagle_init(void) + } + + if(!strcmp(expansionboard_name, "beaglefpga")) +- { ++ { + printk(KERN_INFO "Beagle expansionboard: Using McSPI for SPI\n"); + beaglefpga_init_spi(); + } +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index f67ed46..c14d758 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -329,6 +329,16 @@ config VIDEO_MT9V011 + mt0v011 1.3 Mpixel camera. It currently only works with the + em28xx driver. + ++config VIDEO_MT9V113 ++ tristate "Aptina MT9V113 VGA CMOS IMAGE SENSOR" ++ depends on VIDEO_V4L2 && I2C ++ ---help--- ++ This is a Video4Linux2 sensor-level driver for the Aptina MT9V113 ++ image sensor. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called mt9v113. ++ + config VIDEO_TCM825X + tristate "TCM825x camera sensor support" + depends on I2C && VIDEO_V4L2 +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index 31688bf..763c157 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -75,6 +75,7 @@ obj-$(CONFIG_VIDEO_OV7670) += ov7670.o + obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o + obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o + obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o ++obj-$(CONFIG_VIDEO_MT9V113) += mt9v113.o + + obj-$(CONFIG_SOC_CAMERA_MT9M001) += mt9m001.o + obj-$(CONFIG_SOC_CAMERA_MT9M111) += mt9m111.o +diff --git a/drivers/media/video/mt9v113.c b/drivers/media/video/mt9v113.c +new file mode 100644 +index 0000000..755a88a +--- /dev/null ++++ b/drivers/media/video/mt9v113.c +@@ -0,0 +1,1522 @@ ++/* ++ * drivers/media/video/mt9v113.c ++ * ++ * Based on TI TVP5146/47 decoder driver ++ * ++ * ++ * This package is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include <linux/i2c.h> ++#include <linux/delay.h> ++#include <linux/videodev2.h> ++#include <media/v4l2-int-device.h> ++#include <media/mt9v113.h> ++#include <mach/hardware.h> ++#include <linux/io.h> ++ ++#include "mt9v113_regs.h" ++ ++/* Module Name */ ++#define MT9V113_MODULE_NAME "mt9v113" ++ ++/* Private macros for TVP */ ++#define I2C_RETRY_COUNT (5) ++#define LOCK_RETRY_COUNT (5) ++#define LOCK_RETRY_DELAY (200) ++ ++/* Debug functions */ ++static int debug = 1; ++module_param(debug, bool, 0644); ++MODULE_PARM_DESC(debug, "Debug level (0-1)"); ++ ++#define dump_reg(client, reg, val) \ ++ do { \ ++ val = mt9v113_read_reg(client, reg); \ ++ v4l_info(client, "Reg(0x%.2X): 0x%.2X\n", reg, val); \ ++ } while (0) ++ ++/** ++ * enum mt9v113_std - enum for supported standards ++ */ ++enum mt9v113_std { ++ MT9V113_STD_VGA = 0, ++ MT9V113_STD_QVGA, ++ MT9V113_STD_INVALID ++}; ++ ++/** ++ * enum mt9v113_state - enum for different decoder states ++ */ ++enum mt9v113_state { ++ STATE_NOT_DETECTED, ++ STATE_DETECTED ++}; ++ ++/** ++ * struct mt9v113_std_info - Structure to store standard informations ++ * @width: Line width in pixels ++ * @height:Number of active lines ++ * @video_std: Value to write in REG_VIDEO_STD register ++ * @standard: v4l2 standard structure information ++ */ ++struct mt9v113_std_info { ++ unsigned long width; ++ unsigned long height; ++ u8 video_std; ++ struct v4l2_standard standard; ++}; ++ ++/** ++ * struct mt9v113_decoded - decoder object ++ * @v4l2_int_device: Slave handle ++ * @pdata: Board specific ++ * @client: I2C client data ++ * @id: Entry from I2C table ++ * @ver: Chip version ++ * @state: decoder state - detected or not-detected ++ * @pix: Current pixel format ++ * @num_fmts: Number of formats ++ * @fmt_list: Format list ++ * @current_std: Current standard ++ * @num_stds: Number of standards ++ * @std_list: Standards list ++ * @route: input and output routing at chip level ++ */ ++struct mt9v113_decoder { ++ struct v4l2_int_device *v4l2_int_device; ++ const struct mt9v113_platform_data *pdata; ++ struct i2c_client *client; ++ ++ struct i2c_device_id *id; ++ ++ int ver; ++ enum mt9v113_state state; ++ ++ struct v4l2_pix_format pix; ++ int num_fmts; ++ const struct v4l2_fmtdesc *fmt_list; ++ ++ enum mt9v113_std current_std; ++ int num_stds; ++ struct mt9v113_std_info *std_list; ++ ++ struct v4l2_routing route; ++}; ++ ++/* MT9V113 register set for VGA mode */ ++static struct mt9v113_reg mt9v113_vga_reg[] = { ++ {TOK_WRITE, 0x098C, 0x2739}, ++ {TOK_WRITE, 0x0990, 0x0000}, ++ {TOK_WRITE, 0x098C, 0x273B}, ++ {TOK_WRITE, 0x0990, 0x027F}, ++ {TOK_WRITE, 0x098C, 0x273D}, ++ {TOK_WRITE, 0x0990, 0x0000}, ++ {TOK_WRITE, 0x098C, 0x273F}, ++ {TOK_WRITE, 0x0990, 0x01DF}, ++ {TOK_WRITE, 0x098C, 0x2703}, ++ {TOK_WRITE, 0x0990, 0x0280}, ++ {TOK_WRITE, 0x098C, 0x2705}, ++ {TOK_WRITE, 0x0990, 0x01E0}, ++ {TOK_WRITE, 0x098C, 0xA103}, ++ {TOK_WRITE, 0x0990, 0x0005}, ++ {TOK_DELAY, 0, 100}, ++ {TOK_TERM, 0, 0}, ++}; ++ ++/* MT9V113 default register values */ ++static struct mt9v113_reg mt9v113_reg_list[] = { ++ {TOK_WRITE, 0x0018, 0x4028}, ++ {TOK_DELAY, 0, 100}, ++ {TOK_WRITE, 0x001A, 0x0011}, ++ {TOK_WRITE, 0x001A, 0x0010}, ++ {TOK_WRITE, 0x0018, 0x4028}, ++ {TOK_DELAY, 0, 100}, ++ {TOK_WRITE, 0x098C, 0x02F0}, ++ {TOK_WRITE, 0x0990, 0x0000}, ++ {TOK_WRITE, 0x098C, 0x02F2}, ++ {TOK_WRITE, 0x0990, 0x0210}, ++ {TOK_WRITE, 0x098C, 0x02F4}, ++ {TOK_WRITE, 0x0990, 0x001A}, ++ {TOK_WRITE, 0x098C, 0x2145}, ++ {TOK_WRITE, 0x0990, 0x02F4}, ++ {TOK_WRITE, 0x098C, 0xA134}, ++ {TOK_WRITE, 0x0990, 0x0001}, ++ {TOK_WRITE, 0x31E0, 0x0001}, ++ {TOK_WRITE, 0x001A, 0x0210}, ++ {TOK_WRITE, 0x001E, 0x0777}, ++ {TOK_WRITE, 0x0016, 0x42DF}, ++ {TOK_WRITE, 0x0014, 0x2145}, ++ {TOK_WRITE, 0x0014, 0x2145}, ++ {TOK_WRITE, 0x0010, 0x0431}, ++ {TOK_WRITE, 0x0012, 0x0000}, ++ {TOK_WRITE, 0x0014, 0x244B}, ++ {TOK_WRITE, 0x0014, 0x304B}, ++ {TOK_DELAY, 0, 100}, ++ {TOK_WRITE, 0x0014, 0xB04A}, ++ {TOK_WRITE, 0x098C, 0xAB1F}, ++ {TOK_WRITE, 0x0990, 0x00C7}, ++ {TOK_WRITE, 0x098C, 0xAB31}, ++ {TOK_WRITE, 0x0990, 0x001E}, ++ {TOK_WRITE, 0x098C, 0x274F}, ++ {TOK_WRITE, 0x0990, 0x0004}, ++ {TOK_WRITE, 0x098C, 0x2741}, ++ {TOK_WRITE, 0x0990, 0x0004}, ++ {TOK_WRITE, 0x098C, 0xAB20}, ++ {TOK_WRITE, 0x0990, 0x0054}, ++ {TOK_WRITE, 0x098C, 0xAB21}, ++ {TOK_WRITE, 0x0990, 0x0046}, ++ {TOK_WRITE, 0x098C, 0xAB22}, ++ {TOK_WRITE, 0x0990, 0x0002}, ++ {TOK_WRITE, 0x098C, 0xAB24}, ++ {TOK_WRITE, 0x0990, 0x0005}, ++ {TOK_WRITE, 0x098C, 0x2B28}, ++ {TOK_WRITE, 0x0990, 0x170C}, ++ {TOK_WRITE, 0x098C, 0x2B2A}, ++ {TOK_WRITE, 0x0990, 0x3E80}, ++ {TOK_WRITE, 0x3210, 0x09A8}, ++ {TOK_WRITE, 0x098C, 0x2306}, ++ {TOK_WRITE, 0x0990, 0x0315}, ++ {TOK_WRITE, 0x098C, 0x2308}, ++ {TOK_WRITE, 0x0990, 0xFDDC}, ++ {TOK_WRITE, 0x098C, 0x230A}, ++ {TOK_WRITE, 0x0990, 0x003A}, ++ {TOK_WRITE, 0x098C, 0x230C}, ++ {TOK_WRITE, 0x0990, 0xFF58}, ++ {TOK_WRITE, 0x098C, 0x230E}, ++ {TOK_WRITE, 0x0990, 0x02B7}, ++ {TOK_WRITE, 0x098C, 0x2310}, ++ {TOK_WRITE, 0x0990, 0xFF31}, ++ {TOK_WRITE, 0x098C, 0x2312}, ++ {TOK_WRITE, 0x0990, 0xFF4C}, ++ {TOK_WRITE, 0x098C, 0x2314}, ++ {TOK_WRITE, 0x0990, 0xFE4C}, ++ {TOK_WRITE, 0x098C, 0x2316}, ++ {TOK_WRITE, 0x0990, 0x039E}, ++ {TOK_WRITE, 0x098C, 0x2318}, ++ {TOK_WRITE, 0x0990, 0x001C}, ++ {TOK_WRITE, 0x098C, 0x231A}, ++ {TOK_WRITE, 0x0990, 0x0039}, ++ {TOK_WRITE, 0x098C, 0x231C}, ++ {TOK_WRITE, 0x0990, 0x007F}, ++ {TOK_WRITE, 0x098C, 0x231E}, ++ {TOK_WRITE, 0x0990, 0xFF77}, ++ {TOK_WRITE, 0x098C, 0x2320}, ++ {TOK_WRITE, 0x0990, 0x000A}, ++ {TOK_WRITE, 0x098C, 0x2322}, ++ {TOK_WRITE, 0x0990, 0x0020}, ++ {TOK_WRITE, 0x098C, 0x2324}, ++ {TOK_WRITE, 0x0990, 0x001B}, ++ {TOK_WRITE, 0x098C, 0x2326}, ++ {TOK_WRITE, 0x0990, 0xFFC6}, ++ {TOK_WRITE, 0x098C, 0x2328}, ++ {TOK_WRITE, 0x0990, 0x0086}, ++ {TOK_WRITE, 0x098C, 0x232A}, ++ {TOK_WRITE, 0x0990, 0x00B5}, ++ {TOK_WRITE, 0x098C, 0x232C}, ++ {TOK_WRITE, 0x0990, 0xFEC3}, ++ {TOK_WRITE, 0x098C, 0x232E}, ++ {TOK_WRITE, 0x0990, 0x0001}, ++ {TOK_WRITE, 0x098C, 0x2330}, ++ {TOK_WRITE, 0x0990, 0xFFEF}, ++ {TOK_WRITE, 0x098C, 0xA348}, ++ {TOK_WRITE, 0x0990, 0x0008}, ++ {TOK_WRITE, 0x098C, 0xA349}, ++ {TOK_WRITE, 0x0990, 0x0002}, ++ {TOK_WRITE, 0x098C, 0xA34A}, ++ {TOK_WRITE, 0x0990, 0x0090}, ++ {TOK_WRITE, 0x098C, 0xA34B}, ++ {TOK_WRITE, 0x0990, 0x00FF}, ++ {TOK_WRITE, 0x098C, 0xA34C}, ++ {TOK_WRITE, 0x0990, 0x0075}, ++ {TOK_WRITE, 0x098C, 0xA34D}, ++ {TOK_WRITE, 0x0990, 0x00EF}, ++ {TOK_WRITE, 0x098C, 0xA351}, ++ {TOK_WRITE, 0x0990, 0x0000}, ++ {TOK_WRITE, 0x098C, 0xA352}, ++ {TOK_WRITE, 0x0990, 0x007F}, ++ {TOK_WRITE, 0x098C, 0xA354}, ++ {TOK_WRITE, 0x0990, 0x0043}, ++ {TOK_WRITE, 0x098C, 0xA355}, ++ {TOK_WRITE, 0x0990, 0x0001}, ++ {TOK_WRITE, 0x098C, 0xA35D}, ++ {TOK_WRITE, 0x0990, 0x0078}, ++ {TOK_WRITE, 0x098C, 0xA35E}, ++ {TOK_WRITE, 0x0990, 0x0086}, ++ {TOK_WRITE, 0x098C, 0xA35F}, ++ {TOK_WRITE, 0x0990, 0x007E}, ++ {TOK_WRITE, 0x098C, 0xA360}, ++ {TOK_WRITE, 0x0990, 0x0082}, ++ {TOK_WRITE, 0x098C, 0x2361}, ++ {TOK_WRITE, 0x0990, 0x0040}, ++ {TOK_WRITE, 0x098C, 0xA363}, ++ {TOK_WRITE, 0x0990, 0x00D2}, ++ {TOK_WRITE, 0x098C, 0xA364}, ++ {TOK_WRITE, 0x0990, 0x00F6}, ++ {TOK_WRITE, 0x098C, 0xA302}, ++ {TOK_WRITE, 0x0990, 0x0000}, ++ {TOK_WRITE, 0x098C, 0xA303}, ++ {TOK_WRITE, 0x0990, 0x00EF}, ++ {TOK_WRITE, 0x098C, 0xAB20}, ++ {TOK_WRITE, 0x0990, 0x0024}, ++ {TOK_WRITE, 0x098C, 0xA103}, ++ {TOK_WRITE, 0x0990, 0x0006}, ++ {TOK_DELAY, 0, 100}, ++ {TOK_WRITE, 0x098C, 0xA103}, ++ {TOK_WRITE, 0x0990, 0x0005}, ++ {TOK_DELAY, 0, 100}, ++ {TOK_WRITE, 0x098C, 0x222D}, ++ {TOK_WRITE, 0x0990, 0x0088}, ++ {TOK_WRITE, 0x098C, 0xA408}, ++ {TOK_WRITE, 0x0990, 0x0020}, ++ {TOK_WRITE, 0x098C, 0xA409}, ++ {TOK_WRITE, 0x0990, 0x0023}, ++ {TOK_WRITE, 0x098C, 0xA40A}, ++ {TOK_WRITE, 0x0990, 0x0027}, ++ {TOK_WRITE, 0x098C, 0xA40B}, ++ {TOK_WRITE, 0x0990, 0x002A}, ++ {TOK_WRITE, 0x098C, 0x2411}, ++ {TOK_WRITE, 0x0990, 0x0088}, ++ {TOK_WRITE, 0x098C, 0x2413}, ++ {TOK_WRITE, 0x0990, 0x00A4}, ++ {TOK_WRITE, 0x098C, 0x2415}, ++ {TOK_WRITE, 0x0990, 0x0088}, ++ {TOK_WRITE, 0x098C, 0x2417}, ++ {TOK_WRITE, 0x0990, 0x00A4}, ++ {TOK_WRITE, 0x098C, 0xA404}, ++ {TOK_WRITE, 0x0990, 0x0010}, ++ {TOK_WRITE, 0x098C, 0xA40D}, ++ {TOK_WRITE, 0x0990, 0x0002}, ++ {TOK_WRITE, 0x098C, 0xA40E}, ++ {TOK_WRITE, 0x0990, 0x0003}, ++ {TOK_WRITE, 0x098C, 0xA103}, ++ {TOK_WRITE, 0x0990, 0x0006}, ++ {TOK_DELAY, 0, 100}, ++ /* test pattern all white*/ ++ /* {TOK_WRITE, 0x098C, 0xA766}, ++ {TOK_WRITE, 0x0990, 0x0001}, ++ */ ++ {TOK_WRITE, 0x098C, 0xA103}, ++ {TOK_WRITE, 0x0990, 0x0005}, ++ {TOK_DELAY, 0, 100}, ++ {TOK_TERM, 0, 0}, ++}; ++ ++/* List of image formats supported by mt9v113 ++ * Currently we are using 8 bit mode only, but can be ++ * extended to 10/20 bit mode. ++ */ ++static const struct v4l2_fmtdesc mt9v113_fmt_list[] = { ++ { ++ .index = 0, ++ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, ++ .flags = 0, ++ .description = "8-bit UYVY 4:2:2 Format", ++ .pixelformat = V4L2_PIX_FMT_UYVY, ++ }, ++}; ++ ++/* ++ * Supported standards - ++ * ++ * Currently supports two standards only, need to add support for rest of the ++ * modes, like SECAM, etc... ++ */ ++static struct mt9v113_std_info mt9v113_std_list[] = { ++ /* Standard: STD_NTSC_MJ */ ++ [MT9V113_STD_VGA] = { ++ .width = VGA_NUM_ACTIVE_PIXELS, ++ .height = VGA_NUM_ACTIVE_LINES, ++ .video_std = MT9V113_IMAGE_STD_VGA, ++ .standard = { ++ .index = 0, ++ .id = MT9V113_IMAGE_STD_VGA, ++ .name = "VGA", ++ .frameperiod = {1001, 30000}, ++ .framelines = 480 ++ }, ++ /* Standard: STD_PAL_BDGHIN */ ++ }, ++ [MT9V113_STD_QVGA] = { ++ .width = QVGA_NUM_ACTIVE_PIXELS, ++ .height = QVGA_NUM_ACTIVE_LINES, ++ .video_std = MT9V113_IMAGE_STD_QVGA, ++ .standard = { ++ .index = 1, ++ .id = MT9V113_IMAGE_STD_QVGA, ++ .name = "QVGA", ++ .frameperiod = {1001, 30000}, ++ .framelines = 320 ++ }, ++ }, ++ /* Standard: need to add for additional standard */ ++}; ++/* ++ * Control structure for Auto Gain ++ * This is temporary data, will get replaced once ++ * v4l2_ctrl_query_fill supports it. ++ */ ++static const struct v4l2_queryctrl mt9v113_autogain_ctrl = { ++ .id = V4L2_CID_AUTOGAIN, ++ .name = "Gain, Automatic", ++ .type = V4L2_CTRL_TYPE_BOOLEAN, ++ .minimum = 0, ++ .maximum = 1, ++ .step = 1, ++ .default_value = 1, ++}; ++ ++static int mt9v113_read_reg(struct i2c_client *client, unsigned short reg) ++{ ++ int err = 0; ++ struct i2c_msg msg[1]; ++ unsigned char data[2]; ++ unsigned short val = 0; ++ ++ if (!client->adapter) { ++ err = -ENODEV; ++ return err; ++ }else { ++ // TODO: addr should be set up where else ++ msg->addr = MT9V113_I2C_ADDR;//client->addr; ++ msg->flags = 0; ++ msg->len = I2C_TWO_BYTE_TRANSFER; ++ msg->buf = data; ++ data[0] = (reg & I2C_TXRX_DATA_MASK_UPPER) >> ++ I2C_TXRX_DATA_SHIFT; ++ data[1] = (reg & I2C_TXRX_DATA_MASK); ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err >= 0) { ++ msg->flags = I2C_M_RD; ++ msg->len = I2C_TWO_BYTE_TRANSFER; /* 2 byte read */ ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err >= 0) { ++ val = ((data[0] & I2C_TXRX_DATA_MASK) ++ << I2C_TXRX_DATA_SHIFT) ++ | (data[1] & I2C_TXRX_DATA_MASK); ++ } ++ } ++ } ++ return (int)(0x0000ffff & val); ++} ++ ++ ++ ++static int mt9v113_write_reg(struct i2c_client *client, unsigned short reg, unsigned short val) ++{ ++ int err = 0; ++ int trycnt = 0; ++ ++ struct i2c_msg msg[1]; ++ unsigned char data[4]; ++ err = -1; ++ ++ v4l_dbg(1, debug, client, ++ "mt9v113_write_reg reg=0x%x, val=0x%x\n", ++ reg,val); ++ ++ while ((err < 0) && (trycnt < I2C_RETRY_COUNT)) { ++ trycnt++; ++ if (!client->adapter) { ++ err = -ENODEV; ++ } else { ++ // TODO: addr should be set up where else ++ msg->addr = MT9V113_I2C_ADDR;//client->addr; ++ msg->flags = 0; ++ msg->len = I2C_FOUR_BYTE_TRANSFER; ++ msg->buf = data; ++ data[0] = (reg & I2C_TXRX_DATA_MASK_UPPER) >> ++ I2C_TXRX_DATA_SHIFT; ++ data[1] = (reg & I2C_TXRX_DATA_MASK); ++ data[2] = (val & I2C_TXRX_DATA_MASK_UPPER) >> ++ I2C_TXRX_DATA_SHIFT; ++ data[3] = (val & I2C_TXRX_DATA_MASK); ++ err = i2c_transfer(client->adapter, msg, 1); ++ } ++ } ++ if (err < 0) { ++ printk(KERN_INFO "\n I2C write failed"); ++ } ++ return err; ++} ++ ++/* configure mux, for DM355 EVM only */ ++#ifndef CONFIG_MACH_DM355_LEOPARD ++static int mt9v113_en_mux(struct i2c_client *client) ++{ ++ int err = 0; ++ int trycnt = 0; ++ /* unsigned short readval = 0;*/ ++ ++ struct i2c_msg msg[1]; ++ unsigned char data[4]; ++ err = -1; ++ printk(KERN_INFO ++ "\n entering mt9v113_en_mux \n"); ++ ++ while ((err < 0) && (trycnt < 5)) { ++ trycnt++; ++ if (!client->adapter) { ++ err = -ENODEV; ++ } else { ++ msg->addr = 0x25; ++ msg->flags = 0; ++ msg->len = I2C_TWO_BYTE_TRANSFER; ++ msg->buf = data; ++ data[0] = (unsigned char)(0x08 & I2C_TXRX_DATA_MASK); ++ data[1] = (unsigned char)(0x80 & I2C_TXRX_DATA_MASK); ++ ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err < 0) { ++ printk(KERN_INFO ++ "\n ERROR in ECP register write\n"); ++ } ++ } ++ } ++ if (err < 0) { ++ printk(KERN_INFO "\n I2C write failed"); ++ } ++ return err; ++} ++#endif ++ ++/* ++ * mt9v113_write_regs : Initializes a list of registers ++ * if token is TOK_TERM, then entire write operation terminates ++ * if token is TOK_DELAY, then a delay of 'val' msec is introduced ++ * if token is TOK_SKIP, then the register write is skipped ++ * if token is TOK_WRITE, then the register write is performed ++ * ++ * reglist - list of registers to be written ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int mt9v113_write_regs(struct i2c_client *client, ++ const struct mt9v113_reg reglist[]) ++{ ++ int err; ++ const struct mt9v113_reg *next = reglist; ++ ++ for (; next->token != TOK_TERM; next++) { ++ if (next->token == TOK_DELAY) { ++ msleep(next->val); ++ continue; ++ } ++ ++ if (next->token == TOK_SKIP) ++ continue; ++ ++ err = mt9v113_write_reg(client, next->reg, next->val); ++ if (err < 0) { ++ v4l_err(client, "Write failed. Err[%d]\n", err); ++ return err; ++ } ++ } ++ return 0; ++} ++ ++/* ++ * mt9v113_get_current_std: ++ * Returns the current standard ++ */ ++static enum mt9v113_std mt9v113_get_current_std(struct mt9v113_decoder ++ *decoder) ++{ ++ return MT9V113_STD_VGA; ++} ++ ++/* ++ * Configure the mt9v113 with the current register settings ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int mt9v113_configure(struct mt9v113_decoder *decoder) ++{ ++ int err; ++ ++ /* common register initialization */ ++ err = ++ mt9v113_write_regs(decoder->client, mt9v113_reg_list); ++ if (err) ++ return err; ++ ++// if (debug) ++// mt9v113_reg_dump(decoder); ++ ++ return 0; ++} ++ ++/* ++ * Configure the MT9V113 to VGA mode ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int mt9v113_vga_mode(struct mt9v113_decoder *decoder) ++{ ++ int err; ++ ++ err = ++ mt9v113_write_regs(decoder->client, mt9v113_vga_reg); ++ if (err) ++ return err; ++ ++ return 0; ++} ++ ++ ++/* ++ * Detect if an mt9v113 is present, and if so which revision. ++ * A device is considered to be detected if the chip ID (LSB and MSB) ++ * registers match the expected values. ++ * Any value of the rom version register is accepted. ++ * Returns ENODEV error number if no device is detected, or zero ++ * if a device is detected. ++ */ ++static int mt9v113_detect(struct mt9v113_decoder *decoder) ++{ ++ unsigned short val=0; ++ ++#ifndef CONFIG_MACH_DM355_LEOPARD ++// mt9v113_en_mux(decoder->client); ++#endif ++ ++ val = mt9v113_read_reg(decoder->client, REG_CHIP_ID); ++ ++ v4l_dbg(1, debug, decoder->client, ++ "chip id detected 0x%x\n", ++ val); ++ ++ if (MT9V113_CHIP_ID != val) { ++ /* We didn't read the values we expected, so this must not be ++ * MT9V113. ++ */ ++ v4l_err(decoder->client, ++ "chip id mismatch read 0x%x, expecting 0x%x\n", val, MT9V113_CHIP_ID); ++ return -ENODEV; ++ } ++ ++ decoder->ver = val; ++ decoder->state = STATE_DETECTED; ++ ++ v4l_info(decoder->client, ++ "%s found at 0x%x (%s)\n", decoder->client->name, ++ decoder->client->addr << 1, ++ decoder->client->adapter->name); ++ ++ return 0; ++} ++ ++/* ++ * Following are decoder interface functions implemented by ++ * mt9v113 decoder driver. ++ */ ++ ++/** ++ * ioctl_querystd - V4L2 decoder interface handler for VIDIOC_QUERYSTD ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @std_id: standard V4L2 std_id ioctl enum ++ * ++ * Returns the current standard detected by mt9v113. If no active input is ++ * detected, returns -EINVAL ++ */ ++static int ioctl_querystd(struct v4l2_int_device *s, v4l2_std_id *std_id) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ enum mt9v113_std current_std; ++ ++ if (std_id == NULL) ++ return -EINVAL; ++ ++ /* get the current standard */ ++ current_std = mt9v113_get_current_std(decoder); ++ if (current_std == MT9V113_IMAGE_STD_INVALID) ++ return -EINVAL; ++ ++ decoder->current_std = current_std; ++ *std_id = decoder->std_list[current_std].standard.id; ++ ++ v4l_dbg(1, debug, decoder->client, "Current STD: %s", ++ decoder->std_list[current_std].standard.name); ++ return 0; ++} ++ ++/** ++ * ioctl_s_std - V4L2 decoder interface handler for VIDIOC_S_STD ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @std_id: standard V4L2 v4l2_std_id ioctl enum ++ * ++ * If std_id is supported, sets the requested standard. Otherwise, returns ++ * -EINVAL ++ */ ++static int ioctl_s_std(struct v4l2_int_device *s, v4l2_std_id *std_id) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int err, i; ++ ++ if (std_id == NULL) ++ return -EINVAL; ++ ++ for (i = 0; i < decoder->num_stds; i++) ++ if (*std_id & decoder->std_list[i].standard.id) ++ break; ++ ++ if ((i == decoder->num_stds) || (i == MT9V113_STD_INVALID)) ++ return -EINVAL; ++ ++ err = mt9v113_write_reg(decoder->client, REG_VIDEO_STD, ++ decoder->std_list[i].video_std); ++ if (err) ++ return err; ++ ++ decoder->current_std = i; ++ mt9v113_reg_list[REG_VIDEO_STD].val = decoder->std_list[i].video_std; ++ ++ v4l_dbg(1, debug, decoder->client, "Standard set to: %s", ++ decoder->std_list[i].standard.name); ++ return 0; ++} ++ ++/** ++ * ioctl_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @index: number of the input ++ * ++ * If index is valid, selects the requested input. Otherwise, returns -EINVAL if ++ * the input is not supported or there is no active signal present in the ++ * selected input. ++ */ ++static int ioctl_s_routing(struct v4l2_int_device *s, ++ struct v4l2_routing *route) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_queryctrl - V4L2 decoder interface handler for VIDIOC_QUERYCTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @qctrl: standard V4L2 v4l2_queryctrl structure ++ * ++ * If the requested control is supported, returns the control information. ++ * Otherwise, returns -EINVAL if the control is not supported. ++ */ ++static int ++ioctl_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qctrl) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int err = -EINVAL; ++ ++ if (qctrl == NULL) ++ return err; ++ ++ switch (qctrl->id) { ++ case V4L2_CID_BRIGHTNESS: ++ /* Brightness supported is same as standard one (0-255), ++ * so make use of standard API provided. ++ */ ++ err = v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 128); ++ break; ++ case V4L2_CID_CONTRAST: ++ case V4L2_CID_SATURATION: ++ /* Saturation and Contrast supported is - ++ * Contrast: 0 - 255 (Default - 128) ++ * Saturation: 0 - 255 (Default - 128) ++ */ ++ err = v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 128); ++ break; ++ case V4L2_CID_HUE: ++ /* Hue Supported is - ++ * Hue - -180 - +180 (Default - 0, Step - +180) ++ */ ++ err = v4l2_ctrl_query_fill(qctrl, -180, 180, 180, 0); ++ break; ++ case V4L2_CID_AUTOGAIN: ++ /* Autogain is either 0 or 1*/ ++ memcpy(qctrl, &mt9v113_autogain_ctrl, ++ sizeof(struct v4l2_queryctrl)); ++ err = 0; ++ break; ++ default: ++ v4l_err(decoder->client, ++ "invalid control id %d\n", qctrl->id); ++ return err; ++ } ++ ++ v4l_dbg(1, debug, decoder->client, ++ "Query Control: %s : Min - %d, Max - %d, Def - %d", ++ qctrl->name, ++ qctrl->minimum, ++ qctrl->maximum, ++ qctrl->default_value); ++ ++ return err; ++} ++ ++/** ++ * ioctl_g_ctrl - V4L2 decoder interface handler for VIDIOC_G_CTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @ctrl: pointer to v4l2_control structure ++ * ++ * If the requested control is supported, returns the control's current ++ * value from the decoder. Otherwise, returns -EINVAL if the control is not ++ * supported. ++ */ ++static int ++ioctl_g_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ ++ if (ctrl == NULL) ++ return -EINVAL; ++ ++ switch (ctrl->id) { ++ case V4L2_CID_BRIGHTNESS: ++ ctrl->value = mt9v113_reg_list[REG_BRIGHTNESS].val; ++ break; ++ case V4L2_CID_CONTRAST: ++ ctrl->value = mt9v113_reg_list[REG_CONTRAST].val; ++ break; ++ case V4L2_CID_SATURATION: ++ ctrl->value = mt9v113_reg_list[REG_SATURATION].val; ++ break; ++ case V4L2_CID_HUE: ++ ctrl->value = mt9v113_reg_list[REG_HUE].val; ++ if (ctrl->value == 0x7F) ++ ctrl->value = 180; ++ else if (ctrl->value == 0x80) ++ ctrl->value = -180; ++ else ++ ctrl->value = 0; ++ ++ break; ++ case V4L2_CID_AUTOGAIN: ++ ctrl->value = mt9v113_reg_list[REG_AFE_GAIN_CTRL].val; ++ if ((ctrl->value & 0x3) == 3) ++ ctrl->value = 1; ++ else ++ ctrl->value = 0; ++ ++ break; ++ default: ++ v4l_err(decoder->client, ++ "invalid control id %d\n", ctrl->id); ++ return -EINVAL; ++ } ++ ++ v4l_dbg(1, debug, decoder->client, ++ "Get Control: ID - %d - %d", ++ ctrl->id, ctrl->value); ++ return 0; ++} ++ ++/** ++ * ioctl_s_ctrl - V4L2 decoder interface handler for VIDIOC_S_CTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @ctrl: pointer to v4l2_control structure ++ * ++ * If the requested control is supported, sets the control's current ++ * value in HW. Otherwise, returns -EINVAL if the control is not supported. ++ */ ++static int ++ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int err = -EINVAL, value; ++ ++ if (ctrl == NULL) ++ return err; ++ ++ value = (__s32) ctrl->value; ++ ++ switch (ctrl->id) { ++ case V4L2_CID_BRIGHTNESS: ++ if (ctrl->value < 0 || ctrl->value > 255) { ++ v4l_err(decoder->client, ++ "invalid brightness setting %d\n", ++ ctrl->value); ++ return -ERANGE; ++ } ++ err = mt9v113_write_reg(decoder->client, REG_BRIGHTNESS, ++ value); ++ if (err) ++ return err; ++ mt9v113_reg_list[REG_BRIGHTNESS].val = value; ++ break; ++ case V4L2_CID_CONTRAST: ++ if (ctrl->value < 0 || ctrl->value > 255) { ++ v4l_err(decoder->client, ++ "invalid contrast setting %d\n", ++ ctrl->value); ++ return -ERANGE; ++ } ++ err = mt9v113_write_reg(decoder->client, REG_CONTRAST, ++ value); ++ if (err) ++ return err; ++ mt9v113_reg_list[REG_CONTRAST].val = value; ++ break; ++ case V4L2_CID_SATURATION: ++ if (ctrl->value < 0 || ctrl->value > 255) { ++ v4l_err(decoder->client, ++ "invalid saturation setting %d\n", ++ ctrl->value); ++ return -ERANGE; ++ } ++ err = mt9v113_write_reg(decoder->client, REG_SATURATION, ++ value); ++ if (err) ++ return err; ++ mt9v113_reg_list[REG_SATURATION].val = value; ++ break; ++ case V4L2_CID_HUE: ++ if (value == 180) ++ value = 0x7F; ++ else if (value == -180) ++ value = 0x80; ++ else if (value == 0) ++ value = 0; ++ else { ++ v4l_err(decoder->client, ++ "invalid hue setting %d\n", ++ ctrl->value); ++ return -ERANGE; ++ } ++ err = mt9v113_write_reg(decoder->client, REG_HUE, ++ value); ++ if (err) ++ return err; ++ mt9v113_reg_list[REG_HUE].val = value; ++ break; ++ case V4L2_CID_AUTOGAIN: ++ if (value == 1) ++ value = 0x0F; ++ else if (value == 0) ++ value = 0x0C; ++ else { ++ v4l_err(decoder->client, ++ "invalid auto gain setting %d\n", ++ ctrl->value); ++ return -ERANGE; ++ } ++ err = mt9v113_write_reg(decoder->client, REG_AFE_GAIN_CTRL, ++ value); ++ if (err) ++ return err; ++ mt9v113_reg_list[REG_AFE_GAIN_CTRL].val = value; ++ break; ++ default: ++ v4l_err(decoder->client, ++ "invalid control id %d\n", ctrl->id); ++ return err; ++ } ++ ++ v4l_dbg(1, debug, decoder->client, ++ "Set Control: ID - %d - %d", ++ ctrl->id, ctrl->value); ++ ++ return err; ++} ++ ++/** ++ * ioctl_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure ++ * ++ * Implement the VIDIOC_ENUM_FMT ioctl to enumerate supported formats ++ */ ++static int ++ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int index; ++ ++ if (fmt == NULL) ++ return -EINVAL; ++ ++ index = fmt->index; ++ if ((index >= decoder->num_fmts) || (index < 0)) ++ return -EINVAL; /* Index out of bound */ ++ ++ if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; /* only capture is supported */ ++ ++ memcpy(fmt, &decoder->fmt_list[index], ++ sizeof(struct v4l2_fmtdesc)); ++ ++ v4l_dbg(1, debug, decoder->client, ++ "Current FMT: index - %d (%s)", ++ decoder->fmt_list[index].index, ++ decoder->fmt_list[index].description); ++ return 0; ++} ++ ++/** ++ * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure ++ * ++ * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This ++ * ioctl is used to negotiate the image capture size and pixel format ++ * without actually making it take effect. ++ */ ++static int ++ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int ifmt; ++ struct v4l2_pix_format *pix; ++ enum mt9v113_std current_std; ++ ++ if (f == NULL) ++ return -EINVAL; ++ ++ if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ pix = &f->fmt.pix; ++ ++ /* Calculate height and width based on current standard */ ++ current_std = mt9v113_get_current_std(decoder); ++ if (current_std == MT9V113_STD_INVALID) ++ return -EINVAL; ++ ++ decoder->current_std = current_std; ++ pix->width = decoder->std_list[current_std].width; ++ pix->height = decoder->std_list[current_std].height; ++ ++ for (ifmt = 0; ifmt < decoder->num_fmts; ifmt++) { ++ if (pix->pixelformat == ++ decoder->fmt_list[ifmt].pixelformat) ++ break; ++ } ++ if (ifmt == decoder->num_fmts) ++ ifmt = 0; /* None of the format matched, select default */ ++ pix->pixelformat = decoder->fmt_list[ifmt].pixelformat; ++ ++ pix->field = V4L2_FIELD_NONE; ++ pix->bytesperline = pix->width * 2; ++ pix->sizeimage = pix->bytesperline * pix->height; ++ pix->colorspace = V4L2_COLORSPACE_SMPTE170M; ++ pix->priv = 0; ++ ++ v4l_dbg(1, debug, decoder->client, ++ "Try FMT: pixelformat - %s, bytesperline - %d" ++ "Width - %d, Height - %d", ++ decoder->fmt_list[ifmt].description, pix->bytesperline, ++ pix->width, pix->height); ++ return 0; ++} ++ ++/** ++ * ioctl_s_fmt_cap - V4L2 decoder interface handler for VIDIOC_S_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure ++ * ++ * If the requested format is supported, configures the HW to use that ++ * format, returns error code if format not supported or HW can't be ++ * correctly configured. ++ */ ++static int ++ioctl_s_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ struct v4l2_pix_format *pix; ++ int rval; ++ ++ if (f == NULL) ++ return -EINVAL; ++ ++ if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; /* only capture is supported */ ++ ++ pix = &f->fmt.pix; ++ rval = ioctl_try_fmt_cap(s, f); ++ if (rval) ++ return rval; ++ ++ decoder->pix = *pix; ++ ++ return rval; ++} ++ ++/** ++ * ioctl_g_fmt_cap - V4L2 decoder interface handler for ioctl_g_fmt_cap ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 v4l2_format structure ++ * ++ * Returns the decoder's current pixel format in the v4l2_format ++ * parameter. ++ */ ++static int ++ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ ++ if (f == NULL) ++ return -EINVAL; ++ ++ if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; /* only capture is supported */ ++ ++ f->fmt.pix = decoder->pix; ++ ++ v4l_dbg(1, debug, decoder->client, ++ "Current FMT: bytesperline - %d" ++ "Width - %d, Height - %d", ++ decoder->pix.bytesperline, ++ decoder->pix.width, decoder->pix.height); ++ return 0; ++} ++ ++/** ++ * ioctl_g_parm - V4L2 decoder interface handler for VIDIOC_G_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure ++ * ++ * Returns the decoder's video CAPTURE parameters. ++ */ ++static int ++ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ struct v4l2_captureparm *cparm; ++ enum mt9v113_std current_std; ++ ++ if (a == NULL) ++ return -EINVAL; ++ ++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; /* only capture is supported */ ++ ++ memset(a, 0, sizeof(*a)); ++ a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ /* get the current standard */ ++ current_std = mt9v113_get_current_std(decoder); ++ if (current_std == MT9V113_STD_INVALID) ++ return -EINVAL; ++ ++ decoder->current_std = current_std; ++ ++ cparm = &a->parm.capture; ++ cparm->capability = V4L2_CAP_TIMEPERFRAME; ++ cparm->timeperframe = ++ decoder->std_list[current_std].standard.frameperiod; ++ ++ return 0; ++} ++ ++/** ++ * ioctl_s_parm - V4L2 decoder interface handler for VIDIOC_S_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure ++ * ++ * Configures the decoder to use the input parameters, if possible. If ++ * not possible, returns the appropriate error code. ++ */ ++static int ++ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ struct v4l2_fract *timeperframe; ++ enum mt9v113_std current_std; ++ ++ if (a == NULL) ++ return -EINVAL; ++ ++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; /* only capture is supported */ ++ ++ timeperframe = &a->parm.capture.timeperframe; ++ ++ /* get the current standard */ ++ current_std = mt9v113_get_current_std(decoder); ++ if (current_std == MT9V113_STD_INVALID) ++ return -EINVAL; ++ ++ decoder->current_std = current_std; ++ ++ *timeperframe = ++ decoder->std_list[current_std].standard.frameperiod; ++ ++ return 0; ++} ++ ++/** ++ * ioctl_g_ifparm - V4L2 decoder interface handler for vidioc_int_g_ifparm_num ++ * @s: pointer to standard V4L2 device structure ++ * @p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure ++ * ++ * Gets slave interface parameters. ++ * Calculates the required xclk value to support the requested ++ * clock parameters in p. This value is returned in the p ++ * parameter. ++ */ ++static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int rval; ++ ++ if (p == NULL) ++ return -EINVAL; ++ ++ if (NULL == decoder->pdata->ifparm) ++ return -EINVAL; ++ ++ rval = decoder->pdata->ifparm(p); ++ if (rval) { ++ v4l_err(decoder->client, "g_ifparm.Err[%d]\n", rval); ++ return rval; ++ } ++ ++ p->u.bt656.clock_curr = 27000000; // TODO: read clock rate from sensor ++ ++ return 0; ++} ++ ++/** ++ * ioctl_g_priv - V4L2 decoder interface handler for vidioc_int_g_priv_num ++ * @s: pointer to standard V4L2 device structure ++ * @p: void pointer to hold decoder's private data address ++ * ++ * Returns device's (decoder's) private data area address in p parameter ++ */ ++static int ioctl_g_priv(struct v4l2_int_device *s, void *p) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ ++ if (NULL == decoder->pdata->priv_data_set) ++ return -EINVAL; ++ ++ return decoder->pdata->priv_data_set(p); ++} ++ ++/** ++ * ioctl_s_power - V4L2 decoder interface handler for vidioc_int_s_power_num ++ * @s: pointer to standard V4L2 device structure ++ * @on: power state to which device is to be set ++ * ++ * Sets devices power state to requrested state, if possible. ++ */ ++static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int err = 0; ++ ++ switch (on) { ++ case V4L2_POWER_OFF: ++ /* Power Down Sequence */ ++ err = ++ mt9v113_write_reg(decoder->client, REG_OPERATION_MODE, ++ 0x01); ++ /* Disable mux for mt9v113 data path */ ++ if (decoder->pdata->power_set) ++ err |= decoder->pdata->power_set(s, on); ++ decoder->state = STATE_NOT_DETECTED; ++ break; ++ ++ case V4L2_POWER_STANDBY: ++ if (decoder->pdata->power_set) ++ err = decoder->pdata->power_set(s, on); ++ break; ++ ++ case V4L2_POWER_ON: ++ /* Enable mux for mt9v113 data path */ ++ if ((decoder->pdata->power_set) && ++ (decoder->state == STATE_NOT_DETECTED)) { ++ ++ err = decoder->pdata->power_set(s, on); ++ ++ /* Detect the sensor is not already detected */ ++ err |= mt9v113_detect(decoder); ++ if (err) { ++ v4l_err(decoder->client, ++ "Unable to detect decoder\n"); ++ return err; ++ } ++ } ++ // Only VGA mode for now ++ err |= mt9v113_vga_mode(decoder); ++ break; ++ ++ default: ++ err = -ENODEV; ++ break; ++ } ++ ++ return err; ++} ++ ++/** ++ * ioctl_init - V4L2 decoder interface handler for VIDIOC_INT_INIT ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Initialize the decoder device (calls mt9v113_configure()) ++ */ ++static int ioctl_init(struct v4l2_int_device *s) ++{ ++// struct mt9v113_decoder *decoder = s->priv; ++ int err = 0; ++ ++ /* Set default standard to auto */ ++ //mt9v113_reg_list[REG_VIDEO_STD].val = ++ // VIDEO_STD_AUTO_SWITCH_BIT; ++// err |= mt9v113_configure(decoder); ++// err |= mt9v113_vga_mode(decoder); ++ ++ return err; ++} ++ ++/** ++ * ioctl_dev_exit - V4L2 decoder interface handler for vidioc_int_dev_exit_num ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Delinitialise the dev. at slave detach. The complement of ioctl_dev_init. ++ */ ++static int ioctl_dev_exit(struct v4l2_int_device *s) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_dev_init - V4L2 decoder interface handler for vidioc_int_dev_init_num ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Initialise the device when slave attaches to the master. Returns 0 if ++ * mt9v113 device could be found, otherwise returns appropriate error. ++ */ ++static int ioctl_dev_init(struct v4l2_int_device *s) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int err; ++ ++ printk("%s: %d\n", __func__, __LINE__); ++ err = mt9v113_detect(decoder); ++ if (err < 0) { ++ v4l_err(decoder->client, ++ "Unable to detect decoder\n"); ++ return err; ++ } ++ ++ v4l_info(decoder->client, ++ "chip version 0x%.2x detected\n", decoder->ver); ++ ++ err |= mt9v113_configure(decoder); ++ err |= mt9v113_vga_mode(decoder); ++ ++ return 0; ++} ++ ++static struct v4l2_int_ioctl_desc mt9v113_ioctl_desc[] = { ++ {vidioc_int_dev_init_num, (v4l2_int_ioctl_func*) ioctl_dev_init}, ++ {vidioc_int_dev_exit_num, (v4l2_int_ioctl_func*) ioctl_dev_exit}, ++ {vidioc_int_s_power_num, (v4l2_int_ioctl_func*) ioctl_s_power}, ++ {vidioc_int_g_priv_num, (v4l2_int_ioctl_func*) ioctl_g_priv}, ++ {vidioc_int_g_ifparm_num, (v4l2_int_ioctl_func*) ioctl_g_ifparm}, ++ {vidioc_int_init_num, (v4l2_int_ioctl_func*) ioctl_init}, ++ {vidioc_int_enum_fmt_cap_num, ++ (v4l2_int_ioctl_func *) ioctl_enum_fmt_cap}, ++ {vidioc_int_try_fmt_cap_num, ++ (v4l2_int_ioctl_func *) ioctl_try_fmt_cap}, ++ {vidioc_int_g_fmt_cap_num, ++ (v4l2_int_ioctl_func *) ioctl_g_fmt_cap}, ++ {vidioc_int_s_fmt_cap_num, ++ (v4l2_int_ioctl_func *) ioctl_s_fmt_cap}, ++ {vidioc_int_g_parm_num, (v4l2_int_ioctl_func *) ioctl_g_parm}, ++ {vidioc_int_s_parm_num, (v4l2_int_ioctl_func *) ioctl_s_parm}, ++ {vidioc_int_queryctrl_num, ++ (v4l2_int_ioctl_func *) ioctl_queryctrl}, ++ {vidioc_int_g_ctrl_num, (v4l2_int_ioctl_func *) ioctl_g_ctrl}, ++ {vidioc_int_s_ctrl_num, (v4l2_int_ioctl_func *) ioctl_s_ctrl}, ++ {vidioc_int_querystd_num, (v4l2_int_ioctl_func *) ioctl_querystd}, ++ {vidioc_int_s_std_num, (v4l2_int_ioctl_func *) ioctl_s_std}, ++ {vidioc_int_s_video_routing_num, ++ (v4l2_int_ioctl_func *) ioctl_s_routing}, ++}; ++ ++static struct v4l2_int_slave mt9v113_slave = { ++ .ioctls = mt9v113_ioctl_desc, ++ .num_ioctls = ARRAY_SIZE(mt9v113_ioctl_desc), ++}; ++ ++static struct mt9v113_decoder mt9v113_dev = { ++ .state = STATE_NOT_DETECTED, ++ ++ .fmt_list = mt9v113_fmt_list, ++ .num_fmts = ARRAY_SIZE(mt9v113_fmt_list), ++ ++ .pix = { /* Default to 8-bit YUV 422 */ ++ .width = VGA_NUM_ACTIVE_PIXELS, ++ .height = VGA_NUM_ACTIVE_LINES, ++ .pixelformat = V4L2_PIX_FMT_UYVY, ++ .field = V4L2_FIELD_NONE, ++ .bytesperline = VGA_NUM_ACTIVE_PIXELS * 2, ++ .sizeimage = ++ VGA_NUM_ACTIVE_PIXELS * 2 * VGA_NUM_ACTIVE_LINES, ++ .colorspace = V4L2_COLORSPACE_SMPTE170M, ++ }, ++ ++ .current_std = MT9V113_STD_VGA, ++ .std_list = mt9v113_std_list, ++ .num_stds = ARRAY_SIZE(mt9v113_std_list), ++ ++}; ++ ++static struct v4l2_int_device mt9v113_int_device = { ++ .module = THIS_MODULE, ++ .name = MT9V113_MODULE_NAME, ++ .priv = &mt9v113_dev, ++ .type = v4l2_int_type_slave, ++ .u = { ++ .slave = &mt9v113_slave, ++ }, ++}; ++ ++/** ++ * mt9v113_probe - decoder driver i2c probe handler ++ * @client: i2c driver client device structure ++ * ++ * Register decoder as an i2c client device and V4L2 ++ * device. ++ */ ++static int ++mt9v113_probe(struct i2c_client *client, const struct i2c_device_id *id) ++{ ++ struct mt9v113_decoder *decoder = &mt9v113_dev; ++ int err; ++ ++ printk("%s: %d\n", __func__, __LINE__); ++ /* Check if the adapter supports the needed features */ ++ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) ++ return -EIO; ++ ++ printk("%s: %d\n", __func__, __LINE__); ++ decoder->pdata = client->dev.platform_data; ++ if (!decoder->pdata) { ++ v4l_err(client, "No platform data!!\n"); ++ return -ENODEV; ++ } ++ printk("%s: %d\n", __func__, __LINE__); ++ /* ++ * Fetch platform specific data, and configure the ++ * mt9v113_reg_list[] accordingly. Since this is one ++ * time configuration, no need to preserve. ++ */ ++ ++ /*mt9v113_reg_list[REG_OUTPUT_FORMATTER2].val |= ++ (decoder->pdata->clk_polarity << 1); ++ mt9v113_reg_list[REG_SYNC_CONTROL].val |= ++ ((decoder->pdata->hs_polarity << 2) | ++ (decoder->pdata->vs_polarity << 3)); ++ */ ++ /* ++ * Save the id data, required for power up sequence ++ */ ++ decoder->id = (struct i2c_device_id *)id; ++ /* Attach to Master */ ++ strcpy(mt9v113_int_device.u.slave->attach_to, decoder->pdata->master); ++ decoder->v4l2_int_device = &mt9v113_int_device; ++ decoder->client = client; ++ i2c_set_clientdata(client, decoder); ++ ++ /* Register with V4L2 layer as slave device */ ++ err = v4l2_int_device_register(decoder->v4l2_int_device); ++ if (err) { ++ i2c_set_clientdata(client, NULL); ++ v4l_err(client, ++ "Unable to register to v4l2. Err[%d]\n", err); ++ ++ } else ++ v4l_info(client, "Registered to v4l2 master %s!!\n", ++ decoder->pdata->master); ++ ++ return 0; ++} ++ ++/** ++ * mt9v113_remove - decoder driver i2c remove handler ++ * @client: i2c driver client device structure ++ * ++ * Unregister decoder as an i2c client device and V4L2 ++ * device. Complement of mt9v113_probe(). ++ */ ++static int __exit mt9v113_remove(struct i2c_client *client) ++{ ++ struct mt9v113_decoder *decoder = i2c_get_clientdata(client); ++ ++ if (!client->adapter) ++ return -ENODEV; /* our client isn't attached */ ++ ++ v4l2_int_device_unregister(decoder->v4l2_int_device); ++ i2c_set_clientdata(client, NULL); ++ ++ return 0; ++} ++/* ++ * mt9v113 Init/Power on Sequence ++ */ ++static const struct mt9v113_reg mt9v113m_init_reg_seq[] = { ++ {TOK_WRITE, REG_OPERATION_MODE, 0x01}, ++ {TOK_WRITE, REG_OPERATION_MODE, 0x00}, ++}; ++static const struct mt9v113_init_seq mt9v113m_init = { ++ .no_regs = ARRAY_SIZE(mt9v113m_init_reg_seq), ++ .init_reg_seq = mt9v113m_init_reg_seq, ++}; ++/* ++ * I2C Device Table - ++ * ++ * name - Name of the actual device/chip. ++ * driver_data - Driver data ++ */ ++static const struct i2c_device_id mt9v113_id[] = { ++ {"mt9v113", (unsigned long)&mt9v113m_init}, ++ {}, ++}; ++ ++MODULE_DEVICE_TABLE(i2c, mt9v113_id); ++ ++static struct i2c_driver mt9v113_i2c_driver = { ++ .driver = { ++ .name = MT9V113_MODULE_NAME, ++ .owner = THIS_MODULE, ++ }, ++ .probe = mt9v113_probe, ++ .remove = __exit_p(mt9v113_remove), ++ .id_table = mt9v113_id, ++}; ++ ++/** ++ * mt9v113_init ++ * ++ * Module init function ++ */ ++static int __init mt9v113_init(void) ++{ ++ return i2c_add_driver(&mt9v113_i2c_driver); ++} ++ ++/** ++ * mt9v113_cleanup ++ * ++ * Module exit function ++ */ ++static void __exit mt9v113_cleanup(void) ++{ ++ i2c_del_driver(&mt9v113_i2c_driver); ++} ++ ++module_init(mt9v113_init); ++module_exit(mt9v113_cleanup); ++ ++MODULE_AUTHOR("Texas Instruments"); ++MODULE_DESCRIPTION("MT9V113 linux decoder driver"); ++MODULE_LICENSE("GPL"); +diff --git a/drivers/media/video/mt9v113_regs.h b/drivers/media/video/mt9v113_regs.h +new file mode 100644 +index 0000000..64b065f +--- /dev/null ++++ b/drivers/media/video/mt9v113_regs.h +@@ -0,0 +1,294 @@ ++/* ++ * drivers/media/video/mt9v113_regs.h ++ * ++ * Copyright (C) 2008 Texas Instruments Inc ++ * Author: Vaibhav Hiremath <hvaibhav@ti.com> ++ * ++ * Contributors: ++ * Sivaraj R <sivaraj@ti.com> ++ * Brijesh R Jadav <brijesh.j@ti.com> ++ * Hardik Shah <hardik.shah@ti.com> ++ * Manjunath Hadli <mrh@ti.com> ++ * Karicheri Muralidharan <m-karicheri2@ti.com> ++ * ++ * This package is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef _MT9V113_REGS_H ++#define _MT9V113_REGS_H ++ ++/* ++ * MT9V113 registers ++ */ ++#define REG_CHIP_ID (0x00) ++ ++/* ++ * MT9V113 registers ++ */ ++#define REG_INPUT_SEL (0x00) ++#define REG_AFE_GAIN_CTRL (0x01) ++#define REG_VIDEO_STD (0x02) ++#define REG_OPERATION_MODE (0x03) ++#define REG_AUTOSWITCH_MASK (0x04) ++ ++#define REG_COLOR_KILLER (0x05) ++#define REG_LUMA_CONTROL1 (0x06) ++#define REG_LUMA_CONTROL2 (0x07) ++#define REG_LUMA_CONTROL3 (0x08) ++ ++#define REG_BRIGHTNESS (0x09) ++#define REG_CONTRAST (0x0A) ++#define REG_SATURATION (0x0B) ++#define REG_HUE (0x0C) ++ ++#define REG_CHROMA_CONTROL1 (0x0D) ++#define REG_CHROMA_CONTROL2 (0x0E) ++ ++/* 0x0F Reserved */ ++ ++#define REG_COMP_PR_SATURATION (0x10) ++#define REG_COMP_Y_CONTRAST (0x11) ++#define REG_COMP_PB_SATURATION (0x12) ++ ++/* 0x13 Reserved */ ++ ++#define REG_COMP_Y_BRIGHTNESS (0x14) ++ ++/* 0x15 Reserved */ ++ ++#define REG_AVID_START_PIXEL_LSB (0x16) ++#define REG_AVID_START_PIXEL_MSB (0x17) ++#define REG_AVID_STOP_PIXEL_LSB (0x18) ++#define REG_AVID_STOP_PIXEL_MSB (0x19) ++ ++#define REG_HSYNC_START_PIXEL_LSB (0x1A) ++#define REG_HSYNC_START_PIXEL_MSB (0x1B) ++#define REG_HSYNC_STOP_PIXEL_LSB (0x1C) ++#define REG_HSYNC_STOP_PIXEL_MSB (0x1D) ++ ++#define REG_VSYNC_START_LINE_LSB (0x1E) ++#define REG_VSYNC_START_LINE_MSB (0x1F) ++#define REG_VSYNC_STOP_LINE_LSB (0x20) ++#define REG_VSYNC_STOP_LINE_MSB (0x21) ++ ++#define REG_VBLK_START_LINE_LSB (0x22) ++#define REG_VBLK_START_LINE_MSB (0x23) ++#define REG_VBLK_STOP_LINE_LSB (0x24) ++#define REG_VBLK_STOP_LINE_MSB (0x25) ++ ++/* 0x26 - 0x27 Reserved */ ++ ++#define REG_FAST_SWTICH_CONTROL (0x28) ++ ++/* 0x29 Reserved */ ++ ++#define REG_FAST_SWTICH_SCART_DELAY (0x2A) ++ ++/* 0x2B Reserved */ ++ ++#define REG_SCART_DELAY (0x2C) ++#define REG_CTI_DELAY (0x2D) ++#define REG_CTI_CONTROL (0x2E) ++ ++/* 0x2F - 0x31 Reserved */ ++ ++#define REG_SYNC_CONTROL (0x32) ++#define REG_OUTPUT_FORMATTER1 (0x33) ++#define REG_OUTPUT_FORMATTER2 (0x34) ++#define REG_OUTPUT_FORMATTER3 (0x35) ++#define REG_OUTPUT_FORMATTER4 (0x36) ++#define REG_OUTPUT_FORMATTER5 (0x37) ++#define REG_OUTPUT_FORMATTER6 (0x38) ++#define REG_CLEAR_LOST_LOCK (0x39) ++ ++#define REG_STATUS1 (0x3A) ++#define REG_STATUS2 (0x3B) ++ ++#define REG_AGC_GAIN_STATUS_LSB (0x3C) ++#define REG_AGC_GAIN_STATUS_MSB (0x3D) ++ ++/* 0x3E Reserved */ ++ ++#define REG_VIDEO_STD_STATUS (0x3F) ++#define REG_GPIO_INPUT1 (0x40) ++#define REG_GPIO_INPUT2 (0x41) ++ ++/* 0x42 - 0x45 Reserved */ ++ ++#define REG_AFE_COARSE_GAIN_CH1 (0x46) ++#define REG_AFE_COARSE_GAIN_CH2 (0x47) ++#define REG_AFE_COARSE_GAIN_CH3 (0x48) ++#define REG_AFE_COARSE_GAIN_CH4 (0x49) ++ ++#define REG_AFE_FINE_GAIN_PB_B_LSB (0x4A) ++#define REG_AFE_FINE_GAIN_PB_B_MSB (0x4B) ++#define REG_AFE_FINE_GAIN_Y_G_CHROMA_LSB (0x4C) ++#define REG_AFE_FINE_GAIN_Y_G_CHROMA_MSB (0x4D) ++#define REG_AFE_FINE_GAIN_PR_R_LSB (0x4E) ++#define REG_AFE_FINE_GAIN_PR_R_MSB (0x4F) ++#define REG_AFE_FINE_GAIN_CVBS_LUMA_LSB (0x50) ++#define REG_AFE_FINE_GAIN_CVBS_LUMA_MSB (0x51) ++ ++/* 0x52 - 0x68 Reserved */ ++ ++#define REG_FBIT_VBIT_CONTROL1 (0x69) ++ ++/* 0x6A - 0x6B Reserved */ ++ ++#define REG_BACKEND_AGC_CONTROL (0x6C) ++ ++/* 0x6D - 0x6E Reserved */ ++ ++#define REG_AGC_DECREMENT_SPEED_CONTROL (0x6F) ++#define REG_ROM_VERSION (0x70) ++ ++/* 0x71 - 0x73 Reserved */ ++ ++#define REG_AGC_WHITE_PEAK_PROCESSING (0x74) ++#define REG_FBIT_VBIT_CONTROL2 (0x75) ++#define REG_VCR_TRICK_MODE_CONTROL (0x76) ++#define REG_HORIZONTAL_SHAKE_INCREMENT (0x77) ++#define REG_AGC_INCREMENT_SPEED (0x78) ++#define REG_AGC_INCREMENT_DELAY (0x79) ++ ++/* 0x7A - 0x7F Reserved */ ++ ++#define REG_CHIP_ID_MSB (0x80) ++#define REG_CHIP_ID_LSB (0x81) ++ ++/* 0x82 Reserved */ ++ ++#define REG_CPLL_SPEED_CONTROL (0x83) ++ ++/* 0x84 - 0x96 Reserved */ ++ ++#define REG_STATUS_REQUEST (0x97) ++ ++/* 0x98 - 0x99 Reserved */ ++ ++#define REG_VERTICAL_LINE_COUNT_LSB (0x9A) ++#define REG_VERTICAL_LINE_COUNT_MSB (0x9B) ++ ++/* 0x9C - 0x9D Reserved */ ++ ++#define REG_AGC_DECREMENT_DELAY (0x9E) ++ ++/* 0x9F - 0xB0 Reserved */ ++ ++#define REG_VDP_TTX_FILTER_1_MASK1 (0xB1) ++#define REG_VDP_TTX_FILTER_1_MASK2 (0xB2) ++#define REG_VDP_TTX_FILTER_1_MASK3 (0xB3) ++#define REG_VDP_TTX_FILTER_1_MASK4 (0xB4) ++#define REG_VDP_TTX_FILTER_1_MASK5 (0xB5) ++#define REG_VDP_TTX_FILTER_2_MASK1 (0xB6) ++#define REG_VDP_TTX_FILTER_2_MASK2 (0xB7) ++#define REG_VDP_TTX_FILTER_2_MASK3 (0xB8) ++#define REG_VDP_TTX_FILTER_2_MASK4 (0xB9) ++#define REG_VDP_TTX_FILTER_2_MASK5 (0xBA) ++#define REG_VDP_TTX_FILTER_CONTROL (0xBB) ++#define REG_VDP_FIFO_WORD_COUNT (0xBC) ++#define REG_VDP_FIFO_INTERRUPT_THRLD (0xBD) ++ ++/* 0xBE Reserved */ ++ ++#define REG_VDP_FIFO_RESET (0xBF) ++#define REG_VDP_FIFO_OUTPUT_CONTROL (0xC0) ++#define REG_VDP_LINE_NUMBER_INTERRUPT (0xC1) ++#define REG_VDP_PIXEL_ALIGNMENT_LSB (0xC2) ++#define REG_VDP_PIXEL_ALIGNMENT_MSB (0xC3) ++ ++/* 0xC4 - 0xD5 Reserved */ ++ ++#define REG_VDP_LINE_START (0xD6) ++#define REG_VDP_LINE_STOP (0xD7) ++#define REG_VDP_GLOBAL_LINE_MODE (0xD8) ++#define REG_VDP_FULL_FIELD_ENABLE (0xD9) ++#define REG_VDP_FULL_FIELD_MODE (0xDA) ++ ++/* 0xDB - 0xDF Reserved */ ++ ++#define REG_VBUS_DATA_ACCESS_NO_VBUS_ADDR_INCR (0xE0) ++#define REG_VBUS_DATA_ACCESS_VBUS_ADDR_INCR (0xE1) ++#define REG_FIFO_READ_DATA (0xE2) ++ ++/* 0xE3 - 0xE7 Reserved */ ++ ++#define REG_VBUS_ADDRESS_ACCESS1 (0xE8) ++#define REG_VBUS_ADDRESS_ACCESS2 (0xE9) ++#define REG_VBUS_ADDRESS_ACCESS3 (0xEA) ++ ++/* 0xEB - 0xEF Reserved */ ++ ++#define REG_INTERRUPT_RAW_STATUS0 (0xF0) ++#define REG_INTERRUPT_RAW_STATUS1 (0xF1) ++#define REG_INTERRUPT_STATUS0 (0xF2) ++#define REG_INTERRUPT_STATUS1 (0xF3) ++#define REG_INTERRUPT_MASK0 (0xF4) ++#define REG_INTERRUPT_MASK1 (0xF5) ++#define REG_INTERRUPT_CLEAR0 (0xF6) ++#define REG_INTERRUPT_CLEAR1 (0xF7) ++ ++/* 0xF8 - 0xFF Reserved */ ++ ++/* The ID values we are looking for */ ++#define MT9V113_CHIP_ID_MSB (0x51) ++ ++#define MT9V113_IMAGE_STD_VGA (0x01) ++#define MT9V113_IMAGE_STD_QVGA (0x02) ++#define MT9V113_IMAGE_STD_INVALID (0xFF) ++ ++/* ++ * Status bit ++ */ ++#define STATUS_TV_VCR_BIT (1<<0) ++#define STATUS_HORZ_SYNC_LOCK_BIT (1<<1) ++#define STATUS_VIRT_SYNC_LOCK_BIT (1<<2) ++#define STATUS_CLR_SUBCAR_LOCK_BIT (1<<3) ++#define STATUS_LOST_LOCK_DETECT_BIT (1<<4) ++#define STATUS_FEILD_RATE_BIT (1<<5) ++#define STATUS_LINE_ALTERNATING_BIT (1<<6) ++#define STATUS_PEAK_WHITE_DETECT_BIT (1<<7) ++ ++/* Tokens for register write */ ++#define TOK_WRITE (0) /* token for write operation */ ++#define TOK_TERM (1) /* terminating token */ ++#define TOK_DELAY (2) /* delay token for reg list */ ++#define TOK_SKIP (3) /* token to skip a register */ ++/** ++ * struct mt9v113_reg - Structure for TVP5146/47 register initialization values ++ * @token - Token: TOK_WRITE, TOK_TERM etc.. ++ * @reg - Register offset ++ * @val - Register Value for TOK_WRITE or delay in ms for TOK_DELAY ++ */ ++struct mt9v113_reg { ++ unsigned short token; ++ unsigned short reg; ++ unsigned short val; ++}; ++ ++/** ++ * struct mt9v113_init_seq - Structure for TVP5146/47/46M2/47M1 power up ++ * Sequence. ++ * @ no_regs - Number of registers to write for power up sequence. ++ * @ init_reg_seq - Array of registers and respective value to write. ++ */ ++struct mt9v113_init_seq { ++ unsigned int no_regs; ++ const struct mt9v113_reg *init_reg_seq; ++}; ++ ++#define MT9V113_CHIP_ID (0x2280) ++ ++#endif /* ifndef _MT9V113_REGS_H */ +diff --git a/include/media/mt9v113.h b/include/media/mt9v113.h +new file mode 100644 +index 0000000..c7ad362 +--- /dev/null ++++ b/include/media/mt9v113.h +@@ -0,0 +1,83 @@ ++/* ++ * drivers/media/video/mt9v113.h ++ * ++ * Copyright (C) 2008 Texas Instruments Inc ++ * Author: Vaibhav Hiremath <hvaibhav@ti.com> ++ * ++ * Contributors: ++ * Sivaraj R <sivaraj@ti.com> ++ * Brijesh R Jadav <brijesh.j@ti.com> ++ * Hardik Shah <hardik.shah@ti.com> ++ * Manjunath Hadli <mrh@ti.com> ++ * Karicheri Muralidharan <m-karicheri2@ti.com> ++ * ++ * This package is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef _MT9V113_H ++#define _MT9V113_H ++ ++/* ++ * Other macros ++ */ ++#define MT9V113_MODULE_NAME "mt9v113" ++ ++/* Number of pixels and number of lines per frame for different standards */ ++#define VGA_NUM_ACTIVE_PIXELS (640*2) ++#define VGA_NUM_ACTIVE_LINES (480) ++#define QVGA_NUM_ACTIVE_PIXELS (320*2) ++#define QVGA_NUM_ACTIVE_LINES (240) ++ ++/** ++ * struct mt9v113_platform_data - Platform data values and access functions. ++ * @power_set: Power state access function, zero is off, non-zero is on. ++ * @ifparm: Interface parameters access function. ++ * @priv_data_set: Device private data (pointer) access function. ++ * @clk_polarity: Clock polarity of the current interface. ++ * @ hs_polarity: HSYNC Polarity configuration for current interface. ++ * @ vs_polarity: VSYNC Polarity configuration for current interface. ++ */ ++struct mt9v113_platform_data { ++ char *master; ++ int (*power_set) (struct v4l2_int_device *s, enum v4l2_power on); ++ int (*ifparm) (struct v4l2_ifparm *p); ++ int (*priv_data_set) (void *); ++ /* Interface control params */ ++ bool clk_polarity; ++ bool hs_polarity; ++ bool vs_polarity; ++}; ++ ++// new ++ ++/*i2c adress for MT9V113*/ ++#define MT9V113_I2C_ADDR (0x78 >>1) ++ ++#define I2C_ONE_BYTE_TRANSFER (1) ++#define I2C_TWO_BYTE_TRANSFER (2) ++#define I2C_THREE_BYTE_TRANSFER (3) ++#define I2C_FOUR_BYTE_TRANSFER (4) ++#define I2C_TXRX_DATA_MASK (0x00FF) ++#define I2C_TXRX_DATA_MASK_UPPER (0xFF00) ++#define I2C_TXRX_DATA_SHIFT (8) ++ ++#define MT9V113_VGA_30FPS (1130) ++#define MT9V113_QVGA_30FPS (1131) ++ ++#define MT9V113_CLK_MAX (54000000) /* 54MHz */ ++#define MT9V113_CLK_MIN (6000000) /* 6Mhz */ ++ ++#endif /* ifndef _MT9V113_H */ ++ +diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h +index ce415ec..7827575 100644 +--- a/include/media/v4l2-int-device.h ++++ b/include/media/v4l2-int-device.h +@@ -115,6 +115,7 @@ enum v4l2_if_type { + V4L2_IF_TYPE_BT656, + V4L2_IF_TYPE_YCbCr, + V4L2_IF_TYPE_RAW, ++ V4L2_IF_TYPE_PARALLEL, + }; + + enum v4l2_if_type_bt656_mode { +@@ -215,12 +216,38 @@ struct v4l2_if_type_raw { + u32 clock_curr; + }; + ++struct v4l2_if_type_parallel { ++ /* ++ * 0: Frame begins when vsync is high. ++ * 1: Frame begins when vsync changes from low to high. ++ */ ++ unsigned frame_start_on_rising_vs:1; ++ /* Swap every two adjacent image data elements. */ ++ unsigned swap:1; ++ /* Inverted latch clock polarity from slave. */ ++ unsigned latch_clk_inv:1; ++ /* Hs polarity. 0 is active high, 1 active low. */ ++ unsigned no_hs_inv:1; ++ /* Vs polarity. 0 is active high, 1 active low. */ ++ unsigned no_vs_inv:1; ++ /* Minimum accepted bus clock for slave (in Hz). */ ++ u32 clock_min; ++ /* Maximum accepted bus clock for slave. */ ++ u32 clock_max; ++ /* ++ * Current wish of the slave. May only change in response to ++ * ioctls that affect image capture. ++ */ ++ u32 clock_curr; ++}; ++ + struct v4l2_ifparm { + enum v4l2_if_type if_type; + union { + struct v4l2_if_type_bt656 bt656; + struct v4l2_if_type_ycbcr ycbcr; + struct v4l2_if_type_raw raw; ++ struct v4l2_if_type_parallel parallel; + } u; + }; + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0032-MT9V113-Fixed-sensor-nitialization-issues.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0032-MT9V113-Fixed-sensor-nitialization-issues.patch new file mode 100644 index 00000000..72d9aa66 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0032-MT9V113-Fixed-sensor-nitialization-issues.patch @@ -0,0 +1,294 @@ +From d35c02203462b5c94c7be1abeba9be2a175646fe Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Fri, 9 Jul 2010 17:38:09 +0530 +Subject: [PATCH 32/75] MT9V113: Fixed sensor nitialization issues + +With this patch sensor is now able to generate HS, VS and pixel clock, also +CCDC is able to generate HS/VS, VD0, VD1 interrupts. + +There are some issues with Buffer processing in ISR routine because of which +DQBUF still hangs. +--- + drivers/media/video/mt9v113.c | 155 ++++++++++++++++++++---------------- + drivers/media/video/omap34xxcam.c | 2 +- + 2 files changed, 87 insertions(+), 70 deletions(-) + +diff --git a/drivers/media/video/mt9v113.c b/drivers/media/video/mt9v113.c +index 755a88a..8f8ba35 100644 +--- a/drivers/media/video/mt9v113.c ++++ b/drivers/media/video/mt9v113.c +@@ -389,8 +389,8 @@ static int mt9v113_read_reg(struct i2c_client *client, unsigned short reg) + err = -ENODEV; + return err; + }else { +- // TODO: addr should be set up where else +- msg->addr = MT9V113_I2C_ADDR;//client->addr; ++ /* TODO: addr should be set up where else client->addr */ ++ msg->addr = MT9V113_I2C_ADDR; + msg->flags = 0; + msg->len = I2C_TWO_BYTE_TRANSFER; + msg->buf = data; +@@ -432,8 +432,8 @@ static int mt9v113_write_reg(struct i2c_client *client, unsigned short reg, unsi + if (!client->adapter) { + err = -ENODEV; + } else { +- // TODO: addr should be set up where else +- msg->addr = MT9V113_I2C_ADDR;//client->addr; ++ /* TODO:addr should be set up where else client->addr */ ++ msg->addr = MT9V113_I2C_ADDR; + msg->flags = 0; + msg->len = I2C_FOUR_BYTE_TRANSFER; + msg->buf = data; +@@ -446,51 +446,11 @@ static int mt9v113_write_reg(struct i2c_client *client, unsigned short reg, unsi + err = i2c_transfer(client->adapter, msg, 1); + } + } +- if (err < 0) { ++ if (err < 0) + printk(KERN_INFO "\n I2C write failed"); +- } +- return err; +-} +- +-/* configure mux, for DM355 EVM only */ +-#ifndef CONFIG_MACH_DM355_LEOPARD +-static int mt9v113_en_mux(struct i2c_client *client) +-{ +- int err = 0; +- int trycnt = 0; +- /* unsigned short readval = 0;*/ +- +- struct i2c_msg msg[1]; +- unsigned char data[4]; +- err = -1; +- printk(KERN_INFO +- "\n entering mt9v113_en_mux \n"); +- +- while ((err < 0) && (trycnt < 5)) { +- trycnt++; +- if (!client->adapter) { +- err = -ENODEV; +- } else { +- msg->addr = 0x25; +- msg->flags = 0; +- msg->len = I2C_TWO_BYTE_TRANSFER; +- msg->buf = data; +- data[0] = (unsigned char)(0x08 & I2C_TXRX_DATA_MASK); +- data[1] = (unsigned char)(0x80 & I2C_TXRX_DATA_MASK); + +- err = i2c_transfer(client->adapter, msg, 1); +- if (err < 0) { +- printk(KERN_INFO +- "\n ERROR in ECP register write\n"); +- } +- } +- } +- if (err < 0) { +- printk(KERN_INFO "\n I2C write failed"); +- } + return err; + } +-#endif + + /* + * mt9v113_write_regs : Initializes a list of registers +@@ -550,9 +510,10 @@ static int mt9v113_configure(struct mt9v113_decoder *decoder) + if (err) + return err; + +-// if (debug) +-// mt9v113_reg_dump(decoder); +- ++#if 0 ++ if (debug) ++ mt9v113_reg_dump(decoder); ++#endif + return 0; + } + +@@ -573,6 +534,62 @@ static int mt9v113_vga_mode(struct mt9v113_decoder *decoder) + } + + ++/** ++ * ioctl_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes ++ * @s: pointer to standard V4L2 device structure ++ * @frms: pointer to standard V4L2 framesizes enumeration structure ++ * ++ * Returns possible framesizes depending on choosen pixel format ++ **/ ++static int ioctl_enum_framesizes(struct v4l2_int_device *s, ++ struct v4l2_frmsizeenum *frms) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int ifmt; ++ ++ for (ifmt = 0; ifmt < decoder->num_fmts; ifmt++) { ++ if (frms->pixel_format == decoder->fmt_list[ifmt].pixelformat) ++ break; ++ } ++ /* Is requested pixelformat not found on sensor? */ ++ if (ifmt == decoder->num_fmts) ++ return -EINVAL; ++ ++ /* Do we already reached all discrete framesizes? */ ++ if (frms->index >= decoder->num_stds) ++ return -EINVAL; ++ ++ frms->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frms->discrete.width = decoder->std_list[frms->index].width; ++ frms->discrete.height = decoder->std_list[frms->index].height; ++ ++ return 0; ++ ++} ++ ++static int ioctl_enum_frameintervals(struct v4l2_int_device *s, ++ struct v4l2_frmivalenum *frmi) ++{ ++ struct mt9v113_decoder *decoder = s->priv; ++ int ifmt; ++ ++ if (frmi->index >= 1) ++ return -EINVAL; ++ ++ for (ifmt = 0; ifmt < decoder->num_fmts; ifmt++) { ++ if (frmi->pixel_format == decoder->fmt_list[ifmt].pixelformat) ++ break; ++ } ++ /* Is requested pixelformat not found on sensor? */ ++ if (ifmt == decoder->num_fmts) ++ return -EINVAL; ++ ++ frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frmi->discrete.numerator = 1; ++ frmi->discrete.denominator = 10; ++ return 0; ++} ++ + /* + * Detect if an mt9v113 is present, and if so which revision. + * A device is considered to be detected if the chip ID (LSB and MSB) +@@ -585,15 +602,9 @@ static int mt9v113_detect(struct mt9v113_decoder *decoder) + { + unsigned short val=0; + +-#ifndef CONFIG_MACH_DM355_LEOPARD +-// mt9v113_en_mux(decoder->client); +-#endif +- + val = mt9v113_read_reg(decoder->client, REG_CHIP_ID); + +- v4l_dbg(1, debug, decoder->client, +- "chip id detected 0x%x\n", +- val); ++ v4l_dbg(1, debug, decoder->client, "chip id detected 0x%x\n", val); + + if (MT9V113_CHIP_ID != val) { + /* We didn't read the values we expected, so this must not be +@@ -1042,7 +1053,7 @@ ioctl_s_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) + if (rval) + return rval; + +- decoder->pix = *pix; ++ decoder->pix = *pix; + + return rval; + } +@@ -1177,7 +1188,7 @@ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) + return rval; + } + +- p->u.bt656.clock_curr = 27000000; // TODO: read clock rate from sensor ++ p->u.bt656.clock_curr = 27000000; /* TODO:read clock rate from sensor */ + + return 0; + } +@@ -1211,12 +1222,17 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + struct mt9v113_decoder *decoder = s->priv; + int err = 0; + ++ if (decoder->state == STATE_DETECTED) ++ return 0; ++ + switch (on) { + case V4L2_POWER_OFF: + /* Power Down Sequence */ +- err = +- mt9v113_write_reg(decoder->client, REG_OPERATION_MODE, +- 0x01); ++/* TODO: FIXME: implement proper OFF and Standby code here */ ++#if 0 ++ err = mt9v113_write_reg(decoder->client, REG_OPERATION_MODE, ++ 0x01); ++#endif + /* Disable mux for mt9v113 data path */ + if (decoder->pdata->power_set) + err |= decoder->pdata->power_set(s, on); +@@ -1242,9 +1258,10 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + "Unable to detect decoder\n"); + return err; + } ++ /* Only VGA mode for now */ ++ err |= mt9v113_configure(decoder); ++ err |= mt9v113_vga_mode(decoder); + } +- // Only VGA mode for now +- err |= mt9v113_vga_mode(decoder); + break; + + default: +@@ -1263,14 +1280,11 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + */ + static int ioctl_init(struct v4l2_int_device *s) + { +-// struct mt9v113_decoder *decoder = s->priv; ++ struct mt9v113_decoder *decoder = s->priv; + int err = 0; + +- /* Set default standard to auto */ +- //mt9v113_reg_list[REG_VIDEO_STD].val = +- // VIDEO_STD_AUTO_SWITCH_BIT; +-// err |= mt9v113_configure(decoder); +-// err |= mt9v113_vga_mode(decoder); ++ err |= mt9v113_configure(decoder); ++ err |= mt9v113_vga_mode(decoder); + + return err; + } +@@ -1298,7 +1312,6 @@ static int ioctl_dev_init(struct v4l2_int_device *s) + struct mt9v113_decoder *decoder = s->priv; + int err; + +- printk("%s: %d\n", __func__, __LINE__); + err = mt9v113_detect(decoder); + if (err < 0) { + v4l_err(decoder->client, +@@ -1340,6 +1353,10 @@ static struct v4l2_int_ioctl_desc mt9v113_ioctl_desc[] = { + {vidioc_int_s_std_num, (v4l2_int_ioctl_func *) ioctl_s_std}, + {vidioc_int_s_video_routing_num, + (v4l2_int_ioctl_func *) ioctl_s_routing}, ++ {vidioc_int_enum_framesizes_num, ++ (v4l2_int_ioctl_func *)ioctl_enum_framesizes}, ++ {vidioc_int_enum_frameintervals_num, ++ (v4l2_int_ioctl_func *)ioctl_enum_frameintervals}, + }; + + static struct v4l2_int_slave mt9v113_slave = { +diff --git a/drivers/media/video/omap34xxcam.c b/drivers/media/video/omap34xxcam.c +index 6301ed3..2e8153b 100644 +--- a/drivers/media/video/omap34xxcam.c ++++ b/drivers/media/video/omap34xxcam.c +@@ -1852,8 +1852,8 @@ static int omap34xxcam_open(struct file *file) + vdev->slave_config[OMAP34XXCAM_SLAVE_SENSOR] + .cur_input = route.input; + } +- sensor_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + } ++ sensor_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + /* Get the format the sensor is using. */ + rval = vidioc_int_g_fmt_cap(vdev->vdev_sensor, &sensor_format); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0033-mt9v113-Fix-wrong-active-widths.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0033-mt9v113-Fix-wrong-active-widths.patch new file mode 100644 index 00000000..06eec34e --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0033-mt9v113-Fix-wrong-active-widths.patch @@ -0,0 +1,29 @@ +From 54295e317df7f12a7b9e4f5a55f4801717863bb1 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 9 Jul 2010 16:22:38 -0500 +Subject: [PATCH 33/75] mt9v113: Fix wrong active widths + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + include/media/mt9v113.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/media/mt9v113.h b/include/media/mt9v113.h +index c7ad362..0a30f4c 100644 +--- a/include/media/mt9v113.h ++++ b/include/media/mt9v113.h +@@ -35,9 +35,9 @@ + #define MT9V113_MODULE_NAME "mt9v113" + + /* Number of pixels and number of lines per frame for different standards */ +-#define VGA_NUM_ACTIVE_PIXELS (640*2) ++#define VGA_NUM_ACTIVE_PIXELS (640) + #define VGA_NUM_ACTIVE_LINES (480) +-#define QVGA_NUM_ACTIVE_PIXELS (320*2) ++#define QVGA_NUM_ACTIVE_PIXELS (320) + #define QVGA_NUM_ACTIVE_LINES (240) + + /** +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0034-omap3isp-Fix-Wrong-check-on-non-interlaced-sensor-on.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0034-omap3isp-Fix-Wrong-check-on-non-interlaced-sensor-on.patch new file mode 100644 index 00000000..6bf18244 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0034-omap3isp-Fix-Wrong-check-on-non-interlaced-sensor-on.patch @@ -0,0 +1,34 @@ +From 0cd100387c233429ce2b9c8ceb7a36e900785fce Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 9 Jul 2010 16:56:18 -0500 +Subject: [PATCH 34/75] omap3isp: Fix Wrong check on non-interlaced sensor on isr + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/isp/isp.c | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c +index 29dd005..2ef2d58 100644 +--- a/drivers/media/video/isp/isp.c ++++ b/drivers/media/video/isp/isp.c +@@ -978,11 +978,12 @@ static irqreturn_t omap34xx_isp_isr(int irq, void *_pdev) + } + + if (irqstatus & CCDC_VD0) { +- if (isp->pipeline.pix.field == V4L2_FIELD_INTERLACED) { ++ if (((isp->pipeline.pix.field == V4L2_FIELD_INTERLACED) && ++ (isp->current_field != 0)) || ++ (isp->pipeline.pix.field != V4L2_FIELD_INTERLACED)) { + /* Skip even fields, and process only odd fields */ +- if (isp->current_field != 0) +- if (RAW_CAPTURE(isp)) +- isp_buf_process(dev, bufs); ++ if (RAW_CAPTURE(isp)) ++ isp_buf_process(dev, bufs); + } + if (!ispccdc_busy(&isp->isp_ccdc)) + ispccdc_config_shadow_registers(&isp->isp_ccdc); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0035-omap3isp-Fix-bad-YUV_BT-checks-in-datapath_config.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0035-omap3isp-Fix-bad-YUV_BT-checks-in-datapath_config.patch new file mode 100644 index 00000000..e0be1a82 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0035-omap3isp-Fix-bad-YUV_BT-checks-in-datapath_config.patch @@ -0,0 +1,45 @@ +From d9c512d63c23d8f60e897357263bef4668660b13 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Sat, 10 Jul 2010 09:51:16 -0500 +Subject: [PATCH 35/75] omap3isp: Fix bad YUV_BT checks in datapath_config + +The use of an external write enable signals (from ISP point of +view) shouldn't depend on the sensor parallel interface type. + +Also, the bit shift selection should NOT be other than 9_0 by +default (i.e. No shift). + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/isp/ispccdc.c | 15 +++++---------- + 1 files changed, 5 insertions(+), 10 deletions(-) + +diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c +index 137a5e6..ea6d87c 100644 +--- a/drivers/media/video/isp/ispccdc.c ++++ b/drivers/media/video/isp/ispccdc.c +@@ -602,16 +602,11 @@ static int ispccdc_config_datapath(struct isp_ccdc_device *isp_ccdc, + syn_mode &= ~ISPCCDC_SYN_MODE_VP2SDR; + syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ; + syn_mode |= ISPCCDC_SYN_MODE_WEN; +- if (pipe->ccdc_in == CCDC_YUV_BT) { +- syn_mode &= ~ISPCCDC_SYN_MODE_EXWEN; +- isp_reg_and(isp_ccdc->dev, OMAP3_ISP_IOMEM_CCDC, +- ISPCCDC_CFG, ~ISPCCDC_CFG_WENLOG); +- } else { +- syn_mode |= ISPCCDC_SYN_MODE_EXWEN; +- isp_reg_or(isp_ccdc->dev, OMAP3_ISP_IOMEM_CCDC, +- ISPCCDC_CFG, ISPCCDC_CFG_WENLOG); +- } +- vpcfg.bitshift_sel = BIT11_2; ++ syn_mode &= ~ISPCCDC_SYN_MODE_EXWEN; ++ ++ isp_reg_and(isp_ccdc->dev, OMAP3_ISP_IOMEM_CCDC, ++ ISPCCDC_CFG, ~ISPCCDC_CFG_WENLOG); ++ vpcfg.bitshift_sel = BIT9_0; + vpcfg.freq_sel = PIXCLKBY2; + ispccdc_config_vp(isp_ccdc, vpcfg); + ispccdc_enable_vp(isp_ccdc, 0); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0036-omap3isp-Set-vd_pol-to-0-by-default-on-all-cases.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0036-omap3isp-Set-vd_pol-to-0-by-default-on-all-cases.patch new file mode 100644 index 00000000..f5ceb0d7 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0036-omap3isp-Set-vd_pol-to-0-by-default-on-all-cases.patch @@ -0,0 +1,35 @@ +From 5f87765bb16091048e67bc56f7ce1ab0694d9186 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Sat, 10 Jul 2010 09:57:40 -0500 +Subject: [PATCH 36/75] omap3isp: Set vd_pol to 0 by default on all cases + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/isp/ispccdc.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c +index ea6d87c..b4691c0 100644 +--- a/drivers/media/video/isp/ispccdc.c ++++ b/drivers/media/video/isp/ispccdc.c +@@ -671,7 +671,7 @@ static int ispccdc_config_datapath(struct isp_ccdc_device *isp_ccdc, + syncif.fldstat = 0; + syncif.hdpol = 0; + syncif.ipmod = YUV16; +- syncif.vdpol = 1; ++ syncif.vdpol = 0; + syncif.bt_r656_en = 0; + ispccdc_config_imgattr(isp_ccdc, 0); + ispccdc_config_sync_if(isp_ccdc, syncif); +@@ -688,7 +688,7 @@ static int ispccdc_config_datapath(struct isp_ccdc_device *isp_ccdc, + syncif.fldstat = 0; + syncif.hdpol = 0; + syncif.ipmod = YUV8; +- syncif.vdpol = 1; ++ syncif.vdpol = 0; + syncif.bt_r656_en = 1; + ispccdc_config_imgattr(isp_ccdc, 0); + ispccdc_config_sync_if(isp_ccdc, syncif); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0037-omap3isp-ccdc-Set-datalines-to-10-for-YUV_SYNC.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0037-omap3isp-ccdc-Set-datalines-to-10-for-YUV_SYNC.patch new file mode 100644 index 00000000..12e59601 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0037-omap3isp-ccdc-Set-datalines-to-10-for-YUV_SYNC.patch @@ -0,0 +1,29 @@ +From d9c257a16e4f4c5c6bff57cbe3b9673d3cf61bfa Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 12 Jul 2010 14:09:38 -0500 +Subject: [PATCH 37/75] omap3isp: ccdc: Set datalines to 10 for YUV_SYNC + +Most of the sensors we use are 10 bits, so set this as +default. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/isp/ispccdc.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c +index b4691c0..280a721 100644 +--- a/drivers/media/video/isp/ispccdc.c ++++ b/drivers/media/video/isp/ispccdc.c +@@ -664,7 +664,7 @@ static int ispccdc_config_datapath(struct isp_ccdc_device *isp_ccdc, + case CCDC_YUV_SYNC: + syncif.ccdc_mastermode = 0; + syncif.datapol = 0; +- syncif.datsz = DAT8; ++ syncif.datsz = DAT10; + syncif.fldmode = 0; + syncif.fldout = 0; + syncif.fldpol = 0; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0038-omap3beagle-camera-Fix-parallel-i-f-settings.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0038-omap3beagle-camera-Fix-parallel-i-f-settings.patch new file mode 100644 index 00000000..a9589719 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0038-omap3beagle-camera-Fix-parallel-i-f-settings.patch @@ -0,0 +1,43 @@ +From cd05a2c5c623cc497f0d56b35b29d28a9206a3bd Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 12 Jul 2010 14:11:44 -0500 +Subject: [PATCH 38/75] omap3beagle: camera: Fix parallel i/f settings + +This makes the sensor input be shifted from 13:4 -> 9:0, as +in YUV streaming, the 8 least significant pins are used. + +Also, activate the 8 to 16 bit conversion bridge in ISP, in +big endian mode. + +This makes the ISP interpret the data correctly now. ;) + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 6c06265..0a591a1 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -64,7 +64,7 @@ static struct regulator *beagle_mt9v113_1_8v2; + + static struct isp_interface_config mt9v113_if_config = { + .ccdc_par_ser = ISP_PARLL, +- .dataline_shift = 0x0, ++ .dataline_shift = 0x2, + .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE, + .strobe = 0x0, + .prestrobe = 0x0, +@@ -72,7 +72,7 @@ static struct isp_interface_config mt9v113_if_config = { + .cam_mclk = ISP_MT9V113_MCLK, + .wenlog = ISPCCDC_CFG_WENLOG_AND, + .wait_hs_vs = 2, +- .u.par.par_bridge = 0x1, ++ .u.par.par_bridge = 0x3, + .u.par.par_clk_pol = 0x0, + }; + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0039-omap3beagle-camera-Clean-up-Remove-unneccessary-code.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0039-omap3beagle-camera-Clean-up-Remove-unneccessary-code.patch new file mode 100644 index 00000000..77b19fad --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0039-omap3beagle-camera-Clean-up-Remove-unneccessary-code.patch @@ -0,0 +1,118 @@ +From 6466bc74ab74cafb6aec47040b3408fc2be3455b Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Tue, 13 Jul 2010 19:38:51 +0530 +Subject: [PATCH 39/75] omap3beagle-camera:Clean up: Remove unneccessary code/printf + +Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 25 +++-------------------- + 1 files changed, 4 insertions(+), 21 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 0a591a1..be59040 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -77,7 +77,7 @@ static struct isp_interface_config mt9v113_if_config = { + }; + + static struct v4l2_ifparm mt9v113_ifparm_s = { +-#if 1 ++#if 0 + .if_type = V4L2_IF_TYPE_RAW, + .u = { + .raw = { +@@ -192,32 +192,24 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + + /* turn on VDD */ + regulator_enable(beagle_mt9v113_1_8v1); +- + mdelay(1); +- + /* turn on VDD_IO */ + regulator_enable(beagle_mt9v113_1_8v2); +- + mdelay(50); + + /* Enable EXTCLK */ + isp_set_xclk(vdev->cam->isp, MT9V113_CLK_MIN, CAM_USE_XCLKA); +- + /* + * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): + * ((1000000 * 70) / 6000000) = aprox 12 us. + */ +- + udelay(12); +- + /* Set RESET_BAR to 1 */ + gpio_set_value(LEOPARD_RESET_GPIO, 1); +- + /* + * Wait at least 100 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): + * ((1000000 * 100) / 6000000) = aprox 17 us. + */ +- + udelay(17); + + break; +@@ -245,15 +237,11 @@ struct mt9v113_platform_data mt9v113_pdata = { + + static int beagle_cam_probe(struct platform_device *pdev) + { +- int err; +- +- printk("%s:%d\n", __func__, __LINE__); + beagle_mt9v113_1_8v1 = regulator_get(&pdev->dev, "vaux3_1"); + if (IS_ERR(beagle_mt9v113_1_8v1)) { + dev_err(&pdev->dev, "vaux3_1 regulator missing\n"); + return PTR_ERR(beagle_mt9v113_1_8v1); + } +- printk("%s:%d\n", __func__, __LINE__); + beagle_mt9v113_1_8v2 = regulator_get(&pdev->dev, "vaux4_1"); + if (IS_ERR(beagle_mt9v113_1_8v2)) { + dev_err(&pdev->dev, "vaux4_1 regulator missing\n"); +@@ -261,7 +249,6 @@ static int beagle_cam_probe(struct platform_device *pdev) + return PTR_ERR(beagle_mt9v113_1_8v2); + } + +- printk("%s:%d\n", __func__, __LINE__); + if (gpio_request(LEOPARD_RESET_GPIO, "cam_rst") != 0) { + dev_err(&pdev->dev, "Could not request GPIO %d", + LEOPARD_RESET_GPIO); +@@ -270,7 +257,6 @@ static int beagle_cam_probe(struct platform_device *pdev) + return -ENODEV; + } + +- printk("%s:%d\n", __func__, __LINE__); + /* set to output mode, default value 0 */ + gpio_direction_output(LEOPARD_RESET_GPIO, 0); + +@@ -281,10 +267,10 @@ static int beagle_cam_probe(struct platform_device *pdev) + + static int beagle_cam_remove(struct platform_device *pdev) + { +- printk("%s:%d\n", __func__, __LINE__); + if (regulator_is_enabled(beagle_mt9v113_1_8v1)) + regulator_disable(beagle_mt9v113_1_8v1); + regulator_put(beagle_mt9v113_1_8v1); ++ + if (regulator_is_enabled(beagle_mt9v113_1_8v2)) + regulator_disable(beagle_mt9v113_1_8v2); + regulator_put(beagle_mt9v113_1_8v2); +@@ -360,12 +346,9 @@ static struct platform_driver beagle_cam_driver = { + */ + int __init omap3beaglelmb_init(void) + { +- printk("%s:%d\n", __func__, __LINE__); +- if (cpu_is_omap3630()) { +- printk("%s:%d\n", __func__, __LINE__); ++ if (cpu_is_omap3630()) + platform_driver_register(&beagle_cam_driver); +- } +- printk("%s:%d\n", __func__, __LINE__); ++ + return 0; + } + late_initcall(omap3beaglelmb_init); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch new file mode 100644 index 00000000..80121607 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch @@ -0,0 +1,390 @@ +From 9c9215eade28a09ac12888e9a02af107955009c5 Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Tue, 13 Jul 2010 19:39:34 +0530 +Subject: [PATCH 40/75] mt9v113:Clean Up: Remove unneccessary code/printf + +Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> +--- + drivers/media/video/mt9v113.c | 105 ++++++++++++++++------------------------ + 1 files changed, 42 insertions(+), 63 deletions(-) + +diff --git a/drivers/media/video/mt9v113.c b/drivers/media/video/mt9v113.c +index 8f8ba35..9a86cce 100644 +--- a/drivers/media/video/mt9v113.c ++++ b/drivers/media/video/mt9v113.c +@@ -22,10 +22,10 @@ + #include <linux/i2c.h> + #include <linux/delay.h> + #include <linux/videodev2.h> ++#include <linux/io.h> ++ + #include <media/v4l2-int-device.h> + #include <media/mt9v113.h> +-#include <mach/hardware.h> +-#include <linux/io.h> + + #include "mt9v113_regs.h" + +@@ -34,21 +34,13 @@ + + /* Private macros for TVP */ + #define I2C_RETRY_COUNT (5) +-#define LOCK_RETRY_COUNT (5) +-#define LOCK_RETRY_DELAY (200) + + /* Debug functions */ + static int debug = 1; + module_param(debug, bool, 0644); + MODULE_PARM_DESC(debug, "Debug level (0-1)"); + +-#define dump_reg(client, reg, val) \ +- do { \ +- val = mt9v113_read_reg(client, reg); \ +- v4l_info(client, "Reg(0x%.2X): 0x%.2X\n", reg, val); \ +- } while (0) +- +-/** ++/* + * enum mt9v113_std - enum for supported standards + */ + enum mt9v113_std { +@@ -57,7 +49,7 @@ enum mt9v113_std { + MT9V113_STD_INVALID + }; + +-/** ++/* + * enum mt9v113_state - enum for different decoder states + */ + enum mt9v113_state { +@@ -65,7 +57,7 @@ enum mt9v113_state { + STATE_DETECTED + }; + +-/** ++/* + * struct mt9v113_std_info - Structure to store standard informations + * @width: Line width in pixels + * @height:Number of active lines +@@ -79,7 +71,7 @@ struct mt9v113_std_info { + struct v4l2_standard standard; + }; + +-/** ++/* + * struct mt9v113_decoded - decoder object + * @v4l2_int_device: Slave handle + * @pdata: Board specific +@@ -93,7 +85,6 @@ struct mt9v113_std_info { + * @current_std: Current standard + * @num_stds: Number of standards + * @std_list: Standards list +- * @route: input and output routing at chip level + */ + struct mt9v113_decoder { + struct v4l2_int_device *v4l2_int_device; +@@ -112,8 +103,6 @@ struct mt9v113_decoder { + enum mt9v113_std current_std; + int num_stds; + struct mt9v113_std_info *std_list; +- +- struct v4l2_routing route; + }; + + /* MT9V113 register set for VGA mode */ +@@ -160,7 +149,7 @@ static struct mt9v113_reg mt9v113_reg_list[] = { + {TOK_WRITE, 0x0016, 0x42DF}, + {TOK_WRITE, 0x0014, 0x2145}, + {TOK_WRITE, 0x0014, 0x2145}, +- {TOK_WRITE, 0x0010, 0x0431}, ++ {TOK_WRITE, 0x0010, 0x0231}, + {TOK_WRITE, 0x0012, 0x0000}, + {TOK_WRITE, 0x0014, 0x244B}, + {TOK_WRITE, 0x0014, 0x304B}, +@@ -378,6 +367,10 @@ static const struct v4l2_queryctrl mt9v113_autogain_ctrl = { + .default_value = 1, + }; + ++const struct v4l2_fract mt9v113_frameintervals[] = { ++ { .numerator = 1, .denominator = 10 } ++}; ++ + static int mt9v113_read_reg(struct i2c_client *client, unsigned short reg) + { + int err = 0; +@@ -510,10 +503,6 @@ static int mt9v113_configure(struct mt9v113_decoder *decoder) + if (err) + return err; + +-#if 0 +- if (debug) +- mt9v113_reg_dump(decoder); +-#endif + return 0; + } + +@@ -534,13 +523,13 @@ static int mt9v113_vga_mode(struct mt9v113_decoder *decoder) + } + + +-/** ++/* + * ioctl_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes + * @s: pointer to standard V4L2 device structure + * @frms: pointer to standard V4L2 framesizes enumeration structure + * + * Returns possible framesizes depending on choosen pixel format +- **/ ++ */ + static int ioctl_enum_framesizes(struct v4l2_int_device *s, + struct v4l2_frmsizeenum *frms) + { +@@ -584,9 +573,14 @@ static int ioctl_enum_frameintervals(struct v4l2_int_device *s, + if (ifmt == decoder->num_fmts) + return -EINVAL; + ++ if (frmi->index >= ARRAY_SIZE(mt9v113_frameintervals)) ++ return -EINVAL; ++ + frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; +- frmi->discrete.numerator = 1; +- frmi->discrete.denominator = 10; ++ frmi->discrete.numerator = ++ mt9v113_frameintervals[frmi->index].numerator; ++ frmi->discrete.denominator = ++ mt9v113_frameintervals[frmi->index].denominator; + return 0; + } + +@@ -631,7 +625,7 @@ static int mt9v113_detect(struct mt9v113_decoder *decoder) + * mt9v113 decoder driver. + */ + +-/** ++/* + * ioctl_querystd - V4L2 decoder interface handler for VIDIOC_QUERYSTD ioctl + * @s: pointer to standard V4L2 device structure + * @std_id: standard V4L2 std_id ioctl enum +@@ -660,7 +654,7 @@ static int ioctl_querystd(struct v4l2_int_device *s, v4l2_std_id *std_id) + return 0; + } + +-/** ++/* + * ioctl_s_std - V4L2 decoder interface handler for VIDIOC_S_STD ioctl + * @s: pointer to standard V4L2 device structure + * @std_id: standard V4L2 v4l2_std_id ioctl enum +@@ -696,7 +690,7 @@ static int ioctl_s_std(struct v4l2_int_device *s, v4l2_std_id *std_id) + return 0; + } + +-/** ++/* + * ioctl_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl + * @s: pointer to standard V4L2 device structure + * @index: number of the input +@@ -711,7 +705,7 @@ static int ioctl_s_routing(struct v4l2_int_device *s, + return 0; + } + +-/** ++/* + * ioctl_queryctrl - V4L2 decoder interface handler for VIDIOC_QUERYCTRL ioctl + * @s: pointer to standard V4L2 device structure + * @qctrl: standard V4L2 v4l2_queryctrl structure +@@ -771,7 +765,7 @@ ioctl_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qctrl) + return err; + } + +-/** ++/* + * ioctl_g_ctrl - V4L2 decoder interface handler for VIDIOC_G_CTRL ioctl + * @s: pointer to standard V4L2 device structure + * @ctrl: pointer to v4l2_control structure +@@ -828,7 +822,7 @@ ioctl_g_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl) + return 0; + } + +-/** ++/* + * ioctl_s_ctrl - V4L2 decoder interface handler for VIDIOC_S_CTRL ioctl + * @s: pointer to standard V4L2 device structure + * @ctrl: pointer to v4l2_control structure +@@ -936,7 +930,7 @@ ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl) + return err; + } + +-/** ++/* + * ioctl_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl + * @s: pointer to standard V4L2 device structure + * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure +@@ -969,7 +963,7 @@ ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt) + return 0; + } + +-/** ++/* + * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl + * @s: pointer to standard V4L2 device structure + * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure +@@ -1026,7 +1020,7 @@ ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) + return 0; + } + +-/** ++/* + * ioctl_s_fmt_cap - V4L2 decoder interface handler for VIDIOC_S_FMT ioctl + * @s: pointer to standard V4L2 device structure + * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure +@@ -1058,7 +1052,7 @@ ioctl_s_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) + return rval; + } + +-/** ++/* + * ioctl_g_fmt_cap - V4L2 decoder interface handler for ioctl_g_fmt_cap + * @s: pointer to standard V4L2 device structure + * @f: pointer to standard V4L2 v4l2_format structure +@@ -1087,7 +1081,7 @@ ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) + return 0; + } + +-/** ++/* + * ioctl_g_parm - V4L2 decoder interface handler for VIDIOC_G_PARM ioctl + * @s: pointer to standard V4L2 device structure + * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure +@@ -1125,7 +1119,7 @@ ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) + return 0; + } + +-/** ++/* + * ioctl_s_parm - V4L2 decoder interface handler for VIDIOC_S_PARM ioctl + * @s: pointer to standard V4L2 device structure + * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure +@@ -1161,7 +1155,7 @@ ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) + return 0; + } + +-/** ++/* + * ioctl_g_ifparm - V4L2 decoder interface handler for vidioc_int_g_ifparm_num + * @s: pointer to standard V4L2 device structure + * @p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure +@@ -1193,7 +1187,7 @@ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) + return 0; + } + +-/** ++/* + * ioctl_g_priv - V4L2 decoder interface handler for vidioc_int_g_priv_num + * @s: pointer to standard V4L2 device structure + * @p: void pointer to hold decoder's private data address +@@ -1210,7 +1204,7 @@ static int ioctl_g_priv(struct v4l2_int_device *s, void *p) + return decoder->pdata->priv_data_set(p); + } + +-/** ++/* + * ioctl_s_power - V4L2 decoder interface handler for vidioc_int_s_power_num + * @s: pointer to standard V4L2 device structure + * @on: power state to which device is to be set +@@ -1272,7 +1266,7 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + return err; + } + +-/** ++/* + * ioctl_init - V4L2 decoder interface handler for VIDIOC_INT_INIT + * @s: pointer to standard V4L2 device structure + * +@@ -1289,7 +1283,7 @@ static int ioctl_init(struct v4l2_int_device *s) + return err; + } + +-/** ++/* + * ioctl_dev_exit - V4L2 decoder interface handler for vidioc_int_dev_exit_num + * @s: pointer to standard V4L2 device structure + * +@@ -1300,7 +1294,7 @@ static int ioctl_dev_exit(struct v4l2_int_device *s) + return 0; + } + +-/** ++/* + * ioctl_dev_init - V4L2 decoder interface handler for vidioc_int_dev_init_num + * @s: pointer to standard V4L2 device structure + * +@@ -1397,7 +1391,7 @@ static struct v4l2_int_device mt9v113_int_device = { + }, + }; + +-/** ++/* + * mt9v113_probe - decoder driver i2c probe handler + * @client: i2c driver client device structure + * +@@ -1410,30 +1404,15 @@ mt9v113_probe(struct i2c_client *client, const struct i2c_device_id *id) + struct mt9v113_decoder *decoder = &mt9v113_dev; + int err; + +- printk("%s: %d\n", __func__, __LINE__); + /* Check if the adapter supports the needed features */ + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + return -EIO; + +- printk("%s: %d\n", __func__, __LINE__); + decoder->pdata = client->dev.platform_data; + if (!decoder->pdata) { + v4l_err(client, "No platform data!!\n"); + return -ENODEV; + } +- printk("%s: %d\n", __func__, __LINE__); +- /* +- * Fetch platform specific data, and configure the +- * mt9v113_reg_list[] accordingly. Since this is one +- * time configuration, no need to preserve. +- */ +- +- /*mt9v113_reg_list[REG_OUTPUT_FORMATTER2].val |= +- (decoder->pdata->clk_polarity << 1); +- mt9v113_reg_list[REG_SYNC_CONTROL].val |= +- ((decoder->pdata->hs_polarity << 2) | +- (decoder->pdata->vs_polarity << 3)); +- */ + /* + * Save the id data, required for power up sequence + */ +@@ -1458,7 +1437,7 @@ mt9v113_probe(struct i2c_client *client, const struct i2c_device_id *id) + return 0; + } + +-/** ++/* + * mt9v113_remove - decoder driver i2c remove handler + * @client: i2c driver client device structure + * +@@ -1511,7 +1490,7 @@ static struct i2c_driver mt9v113_i2c_driver = { + .id_table = mt9v113_id, + }; + +-/** ++/* + * mt9v113_init + * + * Module init function +@@ -1521,7 +1500,7 @@ static int __init mt9v113_init(void) + return i2c_add_driver(&mt9v113_i2c_driver); + } + +-/** ++/* + * mt9v113_cleanup + * + * Module exit function +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0041-MT9V113-Min-Max-clk-input-changed-as-per-the-spec.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0041-MT9V113-Min-Max-clk-input-changed-as-per-the-spec.patch new file mode 100644 index 00000000..bae51993 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0041-MT9V113-Min-Max-clk-input-changed-as-per-the-spec.patch @@ -0,0 +1,54 @@ +From f92ea92f012235a17c04021de470b65aeb7fbe29 Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Tue, 13 Jul 2010 19:40:39 +0530 +Subject: [PATCH 41/75] MT9V113: Min, Max clk input changed as per the spec + +Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 2 +- + drivers/media/video/isp/ispreg.h | 2 +- + include/media/mt9v113.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index be59040..8d4e5ab 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -198,7 +198,7 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + mdelay(50); + + /* Enable EXTCLK */ +- isp_set_xclk(vdev->cam->isp, MT9V113_CLK_MIN, CAM_USE_XCLKA); ++ isp_set_xclk(vdev->cam->isp, MT9V113_CLK_MIN*2, CAM_USE_XCLKA); + /* + * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): + * ((1000000 * 70) / 6000000) = aprox 12 us. +diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h +index 1240e0e..098713e 100644 +--- a/drivers/media/video/isp/ispreg.h ++++ b/drivers/media/video/isp/ispreg.h +@@ -116,7 +116,7 @@ + #define ISP_32B_BOUNDARY_BUF 0xFFFFFFE0 + #define ISP_32B_BOUNDARY_OFFSET 0x0000FFE0 + +-#define CM_CAM_MCLK_HZ 172800000 /* Hz */ ++#define CM_CAM_MCLK_HZ 216000000 /* Hz */ + + /* ISP Submodules offset */ + +diff --git a/include/media/mt9v113.h b/include/media/mt9v113.h +index 0a30f4c..4504f26 100644 +--- a/include/media/mt9v113.h ++++ b/include/media/mt9v113.h +@@ -76,7 +76,7 @@ struct mt9v113_platform_data { + #define MT9V113_VGA_30FPS (1130) + #define MT9V113_QVGA_30FPS (1131) + +-#define MT9V113_CLK_MAX (54000000) /* 54MHz */ ++#define MT9V113_CLK_MAX (48000000) /* 48MHz */ + #define MT9V113_CLK_MIN (6000000) /* 6Mhz */ + + #endif /* ifndef _MT9V113_H */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0042-omap3beagle-camera-Further-clode-cleanup.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0042-omap3beagle-camera-Further-clode-cleanup.patch new file mode 100644 index 00000000..8855e6d6 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0042-omap3beagle-camera-Further-clode-cleanup.patch @@ -0,0 +1,237 @@ +From 7f6cbc648dcf2d7805f12e7b56bb2c7b602ca61d Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Wed, 14 Jul 2010 19:07:06 +0530 +Subject: [PATCH 42/75] omap3beagle-camera: Further clode cleanup + +Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 89 ++++-------------------- + drivers/media/video/isp/isp.h | 13 ++++ + 2 files changed, 28 insertions(+), 74 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 8d4e5ab..90eadd0 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -46,21 +46,19 @@ + #include "mux.h" + #include "board-omap3beagle-camera.h" + +-#define MODULE_NAME "omap3beaglelmb" ++#define MODULE_NAME "omap3beaglelmb" + +-#define CAM_USE_XCLKA 0 ++#define CAM_USE_XCLKA 0 + +-#define ISP_MT9V113_MCLK 216000000 ++#define ISP_MT9V113_MCLK 216000000 + +-#define LEOPARD_RESET_GPIO 98 ++#define LEOPARD_RESET_GPIO 98 + + static struct regulator *beagle_mt9v113_1_8v1; + static struct regulator *beagle_mt9v113_1_8v2; + +-#if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE) +- + /* Arbitrary memory handling limit */ +-#define MT9V113_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN(2048 * 1536 * 4) ++#define MT9V113_MAX_FRAME_SIZE PAGE_ALIGN(640 * 480 * 4) + + static struct isp_interface_config mt9v113_if_config = { + .ccdc_par_ser = ISP_PARLL, +@@ -77,21 +75,6 @@ static struct isp_interface_config mt9v113_if_config = { + }; + + static struct v4l2_ifparm mt9v113_ifparm_s = { +-#if 0 +- .if_type = V4L2_IF_TYPE_RAW, +- .u = { +- .raw = { +- .frame_start_on_rising_vs = 1, +- .bt_sync_correct = 0, +- .swap = 0, +- .latch_clk_inv = 0, +- .nobt_hs_inv = 0, /* active high */ +- .nobt_vs_inv = 0, /* active high */ +- .clock_min = MT9V113_CLK_MIN, +- .clock_max = MT9V113_CLK_MAX, +- }, +- }, +-#else + .if_type = V4L2_IF_TYPE_YCbCr, + .u = { + .ycbcr = { +@@ -99,13 +82,12 @@ static struct v4l2_ifparm mt9v113_ifparm_s = { + .bt_sync_correct = 0, + .swap = 0, + .latch_clk_inv = 0, +- .nobt_hs_inv = 0, /* active high */ +- .nobt_vs_inv = 0, /* active high */ ++ .nobt_hs_inv = 0, ++ .nobt_vs_inv = 0, + .clock_min = MT9V113_CLK_MIN, + .clock_max = MT9V113_CLK_MAX, + }, + }, +-#endif + }; + + /** +@@ -124,16 +106,14 @@ static int mt9v113_ifparm(struct v4l2_ifparm *p) + return 0; + } + +-#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + static struct omap34xxcam_hw_config mt9v113_hwc = { + .dev_index = 0, + .dev_minor = 0, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, + .u.sensor.sensor_isp = 1, +- .u.sensor.capture_mem = MT9V113_BIGGEST_FRAME_BYTE_SIZE * 2, ++ .u.sensor.capture_mem = MT9V113_MAX_FRAME_SIZE * 2, + .u.sensor.ival_default = { 1, 10 }, + }; +-#endif + + /** + * @brief mt9v113_set_prv_data - Returns mt9v113 omap34xx driver private data +@@ -144,7 +124,6 @@ static struct omap34xxcam_hw_config mt9v113_hwc = { + */ + static int mt9v113_set_prv_data(void *priv) + { +-#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + struct omap34xxcam_hw_config *hwc = priv; + + if (priv == NULL) +@@ -154,10 +133,8 @@ static int mt9v113_set_prv_data(void *priv) + hwc->dev_index = mt9v113_hwc.dev_index; + hwc->dev_minor = mt9v113_hwc.dev_minor; + hwc->dev_type = mt9v113_hwc.dev_type; ++ + return 0; +-#else +- return -EINVAL; +-#endif + } + + /** +@@ -172,21 +149,22 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + struct omap34xxcam_videodev *vdev = s->u.slave->master->priv; + + switch (power) { +- case V4L2_POWER_OFF: + case V4L2_POWER_STANDBY: ++ break; ++ ++ case V4L2_POWER_OFF: + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); + + if (regulator_is_enabled(beagle_mt9v113_1_8v1)) + regulator_disable(beagle_mt9v113_1_8v1); + if (regulator_is_enabled(beagle_mt9v113_1_8v2)) + regulator_disable(beagle_mt9v113_1_8v2); ++ + break; + + case V4L2_POWER_ON: +-#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +- isp_configure_interface(vdev->cam->isp, &mt9v113_if_config); +-#endif + ++ isp_configure_interface(vdev->cam->isp, &mt9v113_if_config); + /* Set RESET_BAR to 0 */ + gpio_set_value(LEOPARD_RESET_GPIO, 0); + +@@ -216,8 +194,8 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + + default: + return -ENODEV; +- break; + } ++ + return 0; + } + +@@ -232,9 +210,6 @@ struct mt9v113_platform_data mt9v113_pdata = { + .vs_polarity = 1, /* 0 - Active low, 1- Active high */ + }; + +-#endif /* #ifdef CONFIG_VIDEO_MT9V113 */ +- +- + static int beagle_cam_probe(struct platform_device *pdev) + { + beagle_mt9v113_1_8v1 = regulator_get(&pdev->dev, "vaux3_1"); +@@ -277,40 +252,6 @@ static int beagle_cam_remove(struct platform_device *pdev) + + gpio_free(LEOPARD_RESET_GPIO); + +- /* MUX init */ +- omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, +- 0x10C); /* CAM_HS */ +- omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, +- 0x10E); /* CAM_VS */ +- omap_ctrl_writew(OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, +- 0x110); /* CAM_XCLKA */ +- omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, +- 0x112); /* CAM_PCLK */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x116); /* CAM_D0 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x118); /* CAM_D1 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x11A); /* CAM_D2 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x11C); /* CAM_D3 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x11E); /* CAM_D4 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x120); /* CAM_D5 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x122); /* CAM_D6 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x124); /* CAM_D7 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x126); /* CAM_D8 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x128); /* CAM_D9 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x12A); /* CAM_D10 */ +- omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, +- 0x12C); /* CAM_D11 */ +- + return 0; + } + +diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h +index 85c3fa9..4929fad 100644 +--- a/drivers/media/video/isp/isp.h ++++ b/drivers/media/video/isp/isp.h +@@ -482,10 +482,23 @@ int isp_set_callback(struct device *dev, enum isp_callback_type type, + + int isp_unset_callback(struct device *dev, enum isp_callback_type type); + ++#if defined(CONFIG_VIDEO_OMAP3_ISP) + u32 isp_set_xclk(struct device *dev, u32 xclk, u8 xclksel); + + int isp_configure_interface(struct device *dev, + struct isp_interface_config *config); ++#else ++static inline u32 isp_set_xclk(struct device *dev, u32 xclk, u8 xclksel) ++{ ++ return 0; ++} ++static inline int isp_configure_interface(struct device *dev, ++ struct isp_interface_config *config) ++{ ++ return 0; ++} ++ ++#endif + + struct device *isp_get(void); + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0043-mt9v113-Settings-from-Aptima-used-to-increase-FPS.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0043-mt9v113-Settings-from-Aptima-used-to-increase-FPS.patch new file mode 100644 index 00000000..af7e4d08 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0043-mt9v113-Settings-from-Aptima-used-to-increase-FPS.patch @@ -0,0 +1,135 @@ +From b13a4b53a958c182adf61af6b1ea35826fe97de5 Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Wed, 14 Jul 2010 19:07:34 +0530 +Subject: [PATCH 43/75] mt9v113: Settings from Aptima used to increase FPS + +The FPS is still low at around ~15FPS, expected one is 30FPS. + +Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> +--- + drivers/media/video/mt9v113.c | 55 +++++++++++++++++++++++++--------------- + 1 files changed, 34 insertions(+), 21 deletions(-) + +diff --git a/drivers/media/video/mt9v113.c b/drivers/media/video/mt9v113.c +index 9a86cce..466702e 100644 +--- a/drivers/media/video/mt9v113.c ++++ b/drivers/media/video/mt9v113.c +@@ -119,6 +119,21 @@ static struct mt9v113_reg mt9v113_vga_reg[] = { + {TOK_WRITE, 0x0990, 0x0280}, + {TOK_WRITE, 0x098C, 0x2705}, + {TOK_WRITE, 0x0990, 0x01E0}, ++ {TOK_WRITE, 0x098C, 0x2715}, ++ {TOK_WRITE, 0x0990, 0x0001}, ++ {TOK_WRITE, 0x098C, 0x2717}, ++ {TOK_WRITE, 0x0990, 0x0026}, ++ {TOK_WRITE, 0x098C, 0x2719}, ++ {TOK_WRITE, 0x0990, 0x001A}, ++ {TOK_WRITE, 0x098C, 0x271B}, ++ {TOK_WRITE, 0x0990, 0x006B}, ++ {TOK_WRITE, 0x098C, 0x271D}, ++ {TOK_WRITE, 0x0990, 0x006B}, ++ {TOK_WRITE, 0x098C, 0x271F}, ++ {TOK_WRITE, 0x0990, 0x0202}, ++ {TOK_WRITE, 0x098C, 0x2721}, ++ {TOK_WRITE, 0x0990, 0x034A}, ++ + {TOK_WRITE, 0x098C, 0xA103}, + {TOK_WRITE, 0x0990, 0x0005}, + {TOK_DELAY, 0, 100}, +@@ -148,8 +163,7 @@ static struct mt9v113_reg mt9v113_reg_list[] = { + {TOK_WRITE, 0x001E, 0x0777}, + {TOK_WRITE, 0x0016, 0x42DF}, + {TOK_WRITE, 0x0014, 0x2145}, +- {TOK_WRITE, 0x0014, 0x2145}, +- {TOK_WRITE, 0x0010, 0x0231}, ++ {TOK_WRITE, 0x0010, 0x0234}, + {TOK_WRITE, 0x0012, 0x0000}, + {TOK_WRITE, 0x0014, 0x244B}, + {TOK_WRITE, 0x0014, 0x304B}, +@@ -267,29 +281,31 @@ static struct mt9v113_reg mt9v113_reg_list[] = { + {TOK_WRITE, 0x0990, 0x0005}, + {TOK_DELAY, 0, 100}, + {TOK_WRITE, 0x098C, 0x222D}, +- {TOK_WRITE, 0x0990, 0x0088}, ++ {TOK_WRITE, 0x0990, 0x0081}, + {TOK_WRITE, 0x098C, 0xA408}, +- {TOK_WRITE, 0x0990, 0x0020}, ++ {TOK_WRITE, 0x0990, 0x001F}, + {TOK_WRITE, 0x098C, 0xA409}, +- {TOK_WRITE, 0x0990, 0x0023}, ++ {TOK_WRITE, 0x0990, 0x0021}, + {TOK_WRITE, 0x098C, 0xA40A}, +- {TOK_WRITE, 0x0990, 0x0027}, ++ {TOK_WRITE, 0x0990, 0x0025}, + {TOK_WRITE, 0x098C, 0xA40B}, +- {TOK_WRITE, 0x0990, 0x002A}, ++ {TOK_WRITE, 0x0990, 0x0027}, + {TOK_WRITE, 0x098C, 0x2411}, +- {TOK_WRITE, 0x0990, 0x0088}, ++ {TOK_WRITE, 0x0990, 0x0081}, + {TOK_WRITE, 0x098C, 0x2413}, +- {TOK_WRITE, 0x0990, 0x00A4}, ++ {TOK_WRITE, 0x0990, 0x009A}, + {TOK_WRITE, 0x098C, 0x2415}, +- {TOK_WRITE, 0x0990, 0x0088}, ++ {TOK_WRITE, 0x0990, 0x0081}, + {TOK_WRITE, 0x098C, 0x2417}, +- {TOK_WRITE, 0x0990, 0x00A4}, ++ {TOK_WRITE, 0x0990, 0x009A}, + {TOK_WRITE, 0x098C, 0xA404}, + {TOK_WRITE, 0x0990, 0x0010}, + {TOK_WRITE, 0x098C, 0xA40D}, + {TOK_WRITE, 0x0990, 0x0002}, + {TOK_WRITE, 0x098C, 0xA40E}, + {TOK_WRITE, 0x0990, 0x0003}, ++ {TOK_WRITE, 0x098C, 0xA410}, ++ {TOK_WRITE, 0x0990, 0x000A}, + {TOK_WRITE, 0x098C, 0xA103}, + {TOK_WRITE, 0x0990, 0x0006}, + {TOK_DELAY, 0, 100}, +@@ -1216,13 +1232,10 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + struct mt9v113_decoder *decoder = s->priv; + int err = 0; + +- if (decoder->state == STATE_DETECTED) +- return 0; +- + switch (on) { + case V4L2_POWER_OFF: + /* Power Down Sequence */ +-/* TODO: FIXME: implement proper OFF and Standby code here */ ++ /* TODO: FIXME: implement proper OFF and Standby code here */ + #if 0 + err = mt9v113_write_reg(decoder->client, REG_OPERATION_MODE, + 0x01); +@@ -1240,10 +1253,10 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + + case V4L2_POWER_ON: + /* Enable mux for mt9v113 data path */ +- if ((decoder->pdata->power_set) && +- (decoder->state == STATE_NOT_DETECTED)) { ++ if (decoder->state == STATE_NOT_DETECTED) { + +- err = decoder->pdata->power_set(s, on); ++ if (decoder->pdata->power_set) ++ err = decoder->pdata->power_set(s, on); + + /* Detect the sensor is not already detected */ + err |= mt9v113_detect(decoder); +@@ -1252,10 +1265,10 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + "Unable to detect decoder\n"); + return err; + } +- /* Only VGA mode for now */ +- err |= mt9v113_configure(decoder); +- err |= mt9v113_vga_mode(decoder); + } ++ /* Only VGA mode for now */ ++ err |= mt9v113_configure(decoder); ++ err |= mt9v113_vga_mode(decoder); + break; + + default: +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0044-mt9v113-AE-param-tuned-to-get-28-30FPS.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0044-mt9v113-AE-param-tuned-to-get-28-30FPS.patch new file mode 100644 index 00000000..bf8347ce --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0044-mt9v113-AE-param-tuned-to-get-28-30FPS.patch @@ -0,0 +1,33 @@ +From 12b4010768d5bf36bdc1100204be1a9de913d4f4 Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <hvaibhav@ti.com> +Date: Thu, 15 Jul 2010 13:53:03 +0530 +Subject: [PATCH 44/75] mt9v113: AE param tuned to get 28~30FPS + +Please note that with this change we are compromising with +image quality, so should be used only in case of high FPS use-case. +--- + drivers/media/video/mt9v113.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/drivers/media/video/mt9v113.c b/drivers/media/video/mt9v113.c +index 466702e..6714240 100644 +--- a/drivers/media/video/mt9v113.c ++++ b/drivers/media/video/mt9v113.c +@@ -306,6 +306,14 @@ static struct mt9v113_reg mt9v113_reg_list[] = { + {TOK_WRITE, 0x0990, 0x0003}, + {TOK_WRITE, 0x098C, 0xA410}, + {TOK_WRITE, 0x0990, 0x000A}, ++ ++ {TOK_WRITE, 0x098C, 0xA20C}, ++ {TOK_WRITE, 0x0990, 0x0003}, ++ {TOK_WRITE, 0x098C, 0xA20B}, ++ {TOK_WRITE, 0x0990, 0x0000}, ++ {TOK_WRITE, 0x098C, 0xA215}, ++ {TOK_WRITE, 0x0990, 0x0004}, ++ + {TOK_WRITE, 0x098C, 0xA103}, + {TOK_WRITE, 0x0990, 0x0006}, + {TOK_DELAY, 0, 100}, +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0045-omap3beagle-camera-Cleanup-of-boardfile.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0045-omap3beagle-camera-Cleanup-of-boardfile.patch new file mode 100644 index 00000000..f4c6ba02 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0045-omap3beagle-camera-Cleanup-of-boardfile.patch @@ -0,0 +1,161 @@ +From 62059bb8a86836a042bf1720a9bc4bdfa301026f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 12 Jul 2010 15:44:18 -0500 +Subject: [PATCH 45/75] omap3beagle: camera: Cleanup of boardfile + +This removes a lot of dead code. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 51 ++++++++++++++++++------ + arch/arm/mach-omap2/board-omap3beagle-camera.h | 41 ------------------- + 2 files changed, 38 insertions(+), 54 deletions(-) + delete mode 100644 arch/arm/mach-omap2/board-omap3beagle-camera.h + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 90eadd0..befa7d4 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -44,9 +44,6 @@ + #include <../drivers/media/video/isp/ispreg.h> + + #include "mux.h" +-#include "board-omap3beagle-camera.h" +- +-#define MODULE_NAME "omap3beaglelmb" + + #define CAM_USE_XCLKA 0 + +@@ -129,11 +126,7 @@ static int mt9v113_set_prv_data(void *priv) + if (priv == NULL) + return -EINVAL; + +- hwc->u.sensor = mt9v113_hwc.u.sensor; +- hwc->dev_index = mt9v113_hwc.dev_index; +- hwc->dev_minor = mt9v113_hwc.dev_minor; +- hwc->dev_type = mt9v113_hwc.dev_type; +- ++ *hwc = mt9v113_hwc; + return 0; + } + +@@ -204,10 +197,6 @@ struct mt9v113_platform_data mt9v113_pdata = { + .power_set = mt9v113_power_set, + .priv_data_set = mt9v113_set_prv_data, + .ifparm = mt9v113_ifparm, +- /* Some interface dependent params */ +- .clk_polarity = 0, /* data clocked out on falling edge */ +- .hs_polarity = 1, /* 0 - Active low, 1- Active high */ +- .vs_polarity = 1, /* 0 - Active low, 1- Active high */ + }; + + static int beagle_cam_probe(struct platform_device *pdev) +@@ -217,6 +206,7 @@ static int beagle_cam_probe(struct platform_device *pdev) + dev_err(&pdev->dev, "vaux3_1 regulator missing\n"); + return PTR_ERR(beagle_mt9v113_1_8v1); + } ++ + beagle_mt9v113_1_8v2 = regulator_get(&pdev->dev, "vaux4_1"); + if (IS_ERR(beagle_mt9v113_1_8v2)) { + dev_err(&pdev->dev, "vaux4_1 regulator missing\n"); +@@ -235,7 +225,41 @@ static int beagle_cam_probe(struct platform_device *pdev) + /* set to output mode, default value 0 */ + gpio_direction_output(LEOPARD_RESET_GPIO, 0); + +- printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); ++ /* MUX init */ ++ omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, ++ 0x10C); /* CAM_HS */ ++ omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, ++ 0x10E); /* CAM_VS */ ++ omap_ctrl_writew(OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, ++ 0x110); /* CAM_XCLKA */ ++ omap_ctrl_writew(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, ++ 0x112); /* CAM_PCLK */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x116); /* CAM_D0 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x118); /* CAM_D1 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x11A); /* CAM_D2 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x11C); /* CAM_D3 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x11E); /* CAM_D4 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x120); /* CAM_D5 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x122); /* CAM_D6 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x124); /* CAM_D7 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x126); /* CAM_D8 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x128); /* CAM_D9 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x12A); /* CAM_D10 */ ++ omap_ctrl_writew(OMAP_PIN_INPUT | OMAP_MUX_MODE0, ++ 0x12C); /* CAM_D11 */ ++ ++ printk(KERN_INFO "omap3beaglelmb: Driver registration complete\n"); + + return 0; + } +@@ -287,6 +311,7 @@ static struct platform_driver beagle_cam_driver = { + */ + int __init omap3beaglelmb_init(void) + { ++ /* NOTE: Beagle xM boards are the only ones with camera interface */ + if (cpu_is_omap3630()) + platform_driver_register(&beagle_cam_driver); + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.h b/arch/arm/mach-omap2/board-omap3beagle-camera.h +deleted file mode 100644 +index 1026aeb..0000000 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.h ++++ /dev/null +@@ -1,41 +0,0 @@ +-/* +- * Copyright (C) 2010 Texas Instruments Inc +- * Author: Sergio Aguirre <saaguirre@ti.com> +- * +- * Based on work done by: +- * Vaibhav Hiremath <hvaibhav@ti.com> +- * Anuj Aggarwal <anuj.aggarwal@ti.com> +- * Sivaraj R <sivaraj@ti.com> +- * +- * This package is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +- */ +- +-#ifndef __BOARD_OMAP3BEAGLE_LMB_H_ +-#define __BOARD_OMAP3BEAGLE_LMB_H_ +- +-/* mux id to enable/disable signal routing to different peripherals */ +-enum omap3beaglelmb_mux { +- MUX_TVP5146 = 0, +- MUX_CAMERA_SENSOR, +- MUX_EXP_CAMERA_SENSOR, +- NUM_MUX +-}; +- +-/* enum to enable or disable mux */ +-enum config_mux { +- DISABLE_MUX, +- ENABLE_MUX +-}; +- +-#endif /* __BOARD_OMAP3BEAGLE_LMB_H_ */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0046-omap3beagle-camera-Cleanup-regulator-usage.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0046-omap3beagle-camera-Cleanup-regulator-usage.patch new file mode 100644 index 00000000..9f3cbb26 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0046-omap3beagle-camera-Cleanup-regulator-usage.patch @@ -0,0 +1,172 @@ +From d3ea23ea580848bb5e0ed423db4d914661cd1d7d Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 12 Jul 2010 15:53:44 -0500 +Subject: [PATCH 46/75] omap3beagle: camera: Cleanup regulator usage + +We were missing the point of regulator abstraction layer. + +Camera board file shouldn't be aware of what vaux is using, but +just asking for a specific power supply (for cam_1v8 and cam_2v8). + +How is that mapped before, is something that the regulator machine +should figure out. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 50 ++++++++++++------------ + arch/arm/mach-omap2/board-omap3beagle.c | 24 +++++------- + 2 files changed, 35 insertions(+), 39 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index befa7d4..c91529d 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -51,8 +51,8 @@ + + #define LEOPARD_RESET_GPIO 98 + +-static struct regulator *beagle_mt9v113_1_8v1; +-static struct regulator *beagle_mt9v113_1_8v2; ++static struct regulator *cam_1v8_reg; ++static struct regulator *cam_2v8_reg; + + /* Arbitrary memory handling limit */ + #define MT9V113_MAX_FRAME_SIZE PAGE_ALIGN(640 * 480 * 4) +@@ -148,10 +148,10 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + case V4L2_POWER_OFF: + isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); + +- if (regulator_is_enabled(beagle_mt9v113_1_8v1)) +- regulator_disable(beagle_mt9v113_1_8v1); +- if (regulator_is_enabled(beagle_mt9v113_1_8v2)) +- regulator_disable(beagle_mt9v113_1_8v2); ++ if (regulator_is_enabled(cam_1v8_reg)) ++ regulator_disable(cam_1v8_reg); ++ if (regulator_is_enabled(cam_2v8_reg)) ++ regulator_disable(cam_2v8_reg); + + break; + +@@ -162,10 +162,10 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + gpio_set_value(LEOPARD_RESET_GPIO, 0); + + /* turn on VDD */ +- regulator_enable(beagle_mt9v113_1_8v1); ++ regulator_enable(cam_1v8_reg); + mdelay(1); + /* turn on VDD_IO */ +- regulator_enable(beagle_mt9v113_1_8v2); ++ regulator_enable(cam_2v8_reg); + mdelay(50); + + /* Enable EXTCLK */ +@@ -201,24 +201,24 @@ struct mt9v113_platform_data mt9v113_pdata = { + + static int beagle_cam_probe(struct platform_device *pdev) + { +- beagle_mt9v113_1_8v1 = regulator_get(&pdev->dev, "vaux3_1"); +- if (IS_ERR(beagle_mt9v113_1_8v1)) { +- dev_err(&pdev->dev, "vaux3_1 regulator missing\n"); +- return PTR_ERR(beagle_mt9v113_1_8v1); ++ cam_1v8_reg = regulator_get(&pdev->dev, "cam_1v8"); ++ if (IS_ERR(cam_1v8_reg)) { ++ dev_err(&pdev->dev, "cam_1v8 regulator missing\n"); ++ return PTR_ERR(cam_1v8_reg); + } + +- beagle_mt9v113_1_8v2 = regulator_get(&pdev->dev, "vaux4_1"); +- if (IS_ERR(beagle_mt9v113_1_8v2)) { +- dev_err(&pdev->dev, "vaux4_1 regulator missing\n"); +- regulator_put(beagle_mt9v113_1_8v1); +- return PTR_ERR(beagle_mt9v113_1_8v2); ++ cam_2v8_reg = regulator_get(&pdev->dev, "cam_2v8"); ++ if (IS_ERR(cam_2v8_reg)) { ++ dev_err(&pdev->dev, "cam_2v8 regulator missing\n"); ++ regulator_put(cam_1v8_reg); ++ return PTR_ERR(cam_2v8_reg); + } + + if (gpio_request(LEOPARD_RESET_GPIO, "cam_rst") != 0) { + dev_err(&pdev->dev, "Could not request GPIO %d", + LEOPARD_RESET_GPIO); +- regulator_put(beagle_mt9v113_1_8v2); +- regulator_put(beagle_mt9v113_1_8v1); ++ regulator_put(cam_2v8_reg); ++ regulator_put(cam_1v8_reg); + return -ENODEV; + } + +@@ -266,13 +266,13 @@ static int beagle_cam_probe(struct platform_device *pdev) + + static int beagle_cam_remove(struct platform_device *pdev) + { +- if (regulator_is_enabled(beagle_mt9v113_1_8v1)) +- regulator_disable(beagle_mt9v113_1_8v1); +- regulator_put(beagle_mt9v113_1_8v1); ++ if (regulator_is_enabled(cam_1v8_reg)) ++ regulator_disable(cam_1v8_reg); ++ regulator_put(cam_1v8_reg); + +- if (regulator_is_enabled(beagle_mt9v113_1_8v2)) +- regulator_disable(beagle_mt9v113_1_8v2); +- regulator_put(beagle_mt9v113_1_8v2); ++ if (regulator_is_enabled(cam_2v8_reg)) ++ regulator_disable(cam_2v8_reg); ++ regulator_put(cam_2v8_reg); + + gpio_free(LEOPARD_RESET_GPIO); + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index d4b0b0a..b0da483 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -414,18 +414,14 @@ static struct platform_device beagle_cam_device = { + .id = -1, + }; + +-static struct regulator_consumer_supply beagle_vaux3_supplies[] = { +- { +- .supply = "vaux3_1", +- .dev = &beagle_cam_device.dev, +- }, ++static struct regulator_consumer_supply beagle_vaux3_supply = { ++ .supply = "cam_1v8", ++ .dev = &beagle_cam_device.dev, + }; + +-static struct regulator_consumer_supply beagle_vaux4_supplies[] = { +- { +- .supply = "vaux4_1", +- .dev = &beagle_cam_device.dev, +- }, ++static struct regulator_consumer_supply beagle_vaux4_supply = { ++ .supply = "cam_2v8", ++ .dev = &beagle_cam_device.dev, + }; + + /* VAUX3 for CAM_1V8 */ +@@ -439,8 +435,8 @@ static struct regulator_init_data beagle_vaux3 = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = ARRAY_SIZE(beagle_vaux3_supplies), +- .consumer_supplies = beagle_vaux3_supplies, ++ .num_consumer_supplies = 1, ++ .consumer_supplies = &beagle_vaux3_supply, + }; + + /* VAUX4 for CAM_2V8 */ +@@ -454,8 +450,8 @@ static struct regulator_init_data beagle_vaux4 = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = ARRAY_SIZE(beagle_vaux4_supplies), +- .consumer_supplies = beagle_vaux4_supplies, ++ .num_consumer_supplies = 1, ++ .consumer_supplies = &beagle_vaux4_supply, + }; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0047-omap3beagle-camera-Bring-back-mt9t111-support.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0047-omap3beagle-camera-Bring-back-mt9t111-support.patch new file mode 100644 index 00000000..d8614776 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0047-omap3beagle-camera-Bring-back-mt9t111-support.patch @@ -0,0 +1,251 @@ +From e81cdbd3c914965685e213ceef5a14775bfb9397 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 12 Jul 2010 16:42:41 -0500 +Subject: [PATCH 47/75] omap3beagle: camera: Bring back mt9t111 support + +Restore MT9T111 sensor support. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 175 +++++++++++++++++++++++- + arch/arm/mach-omap2/board-omap3beagle.c | 12 ++ + 2 files changed, 184 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index c91529d..2e49158 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -37,7 +37,6 @@ + #include <plat/control.h> + + #include <media/v4l2-int-device.h> +-#include <media/mt9v113.h> + + /* Include V4L2 ISP-Camera driver related header file */ + #include <../drivers/media/video/omap34xxcam.h> +@@ -47,13 +46,16 @@ + + #define CAM_USE_XCLKA 0 + +-#define ISP_MT9V113_MCLK 216000000 +- + #define LEOPARD_RESET_GPIO 98 + + static struct regulator *cam_1v8_reg; + static struct regulator *cam_2v8_reg; + ++#if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE) ++#include <media/mt9v113.h> ++ ++#define ISP_MT9V113_MCLK 216000000 ++ + /* Arbitrary memory handling limit */ + #define MT9V113_MAX_FRAME_SIZE PAGE_ALIGN(640 * 480 * 4) + +@@ -199,6 +201,173 @@ struct mt9v113_platform_data mt9v113_pdata = { + .ifparm = mt9v113_ifparm, + }; + ++#endif /* #ifdef CONFIG_VIDEO_MT9V113 */ ++ ++#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++#include <media/mt9t111.h> ++ ++#define ISP_MT9T111_MCLK 216000000 ++ ++/* Arbitrary memory handling limit */ ++#define MT9T111_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN((2048 * 2) * 1536 * 4) ++ ++static struct isp_interface_config mt9t111_if_config = { ++ .ccdc_par_ser = ISP_PARLL, ++ .dataline_shift = 0x2, ++ .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE, ++ .strobe = 0x0, ++ .prestrobe = 0x0, ++ .shutter = 0x0, ++ .cam_mclk = ISP_MT9T111_MCLK, ++ .wenlog = ISPCCDC_CFG_WENLOG_AND, ++ .wait_hs_vs = 2, ++ .u.par.par_bridge = 0x3, ++ .u.par.par_clk_pol = 0x0, ++}; ++ ++static struct v4l2_ifparm mt9t111_ifparm_s = { ++ .if_type = V4L2_IF_TYPE_RAW, ++ .u = { ++ .raw = { ++ .frame_start_on_rising_vs = 1, ++ .bt_sync_correct = 0, ++ .swap = 0, ++ .latch_clk_inv = 0, ++ .nobt_hs_inv = 0, /* active high */ ++ .nobt_vs_inv = 0, /* active high */ ++ .clock_min = MT9T111_CLK_MIN, ++ .clock_max = MT9T111_CLK_MAX, ++ }, ++ }, ++}; ++ ++/** ++ * @brief mt9t111_ifparm - Returns the mt9t111 interface parameters ++ * ++ * @param p - pointer to v4l2_ifparm structure ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9t111_ifparm(struct v4l2_ifparm *p) ++{ ++ if (p == NULL) ++ return -EINVAL; ++ ++ *p = mt9t111_ifparm_s; ++ return 0; ++} ++ ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++static struct omap34xxcam_hw_config mt9t111_hwc = { ++ .dev_index = 0, ++ .dev_minor = 0, ++ .dev_type = OMAP34XXCAM_SLAVE_SENSOR, ++ .u.sensor.sensor_isp = 0, ++ .u.sensor.capture_mem = MT9T111_BIGGEST_FRAME_BYTE_SIZE, ++ .u.sensor.ival_default = { 1, 10 }, ++}; ++#endif ++ ++/** ++ * @brief mt9t111_set_prv_data - Returns mt9t111 omap34xx driver private data ++ * ++ * @param priv - pointer to omap34xxcam_hw_config structure ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9t111_set_prv_data(void *priv) ++{ ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++ struct omap34xxcam_hw_config *hwc = priv; ++ ++ if (priv == NULL) ++ return -EINVAL; ++ ++ *hwc = mt9t111_hwc; ++ return 0; ++#else ++ return -EINVAL; ++#endif ++} ++ ++/** ++ * @brief mt9t111_power_set - Power-on or power-off TVP5146 device ++ * ++ * @param power - enum, Power on/off, resume/standby ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) ++{ ++ struct omap34xxcam_videodev *vdev = s->u.slave->master->priv; ++ ++ switch (power) { ++ case V4L2_POWER_OFF: ++ case V4L2_POWER_STANDBY: ++ isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); ++ ++ if (regulator_is_enabled(cam_1v8_reg)) ++ regulator_disable(cam_1v8_reg); ++ if (regulator_is_enabled(cam_2v8_reg)) ++ regulator_disable(cam_2v8_reg); ++ break; ++ ++ case V4L2_POWER_ON: ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++ isp_configure_interface(vdev->cam->isp, &mt9t111_if_config); ++#endif ++ ++ /* Set RESET_BAR to 0 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 0); ++ ++ /* turn on VDD */ ++ regulator_enable(cam_1v8_reg); ++ ++ mdelay(1); ++ ++ /* turn on VDD_IO */ ++ regulator_enable(cam_2v8_reg); ++ ++ mdelay(50); ++ ++ /* Enable EXTCLK */ ++ isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); ++ ++ /* ++ * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): ++ * ((1000000 * 70) / 6000000) = aprox 12 us. ++ */ ++ ++ udelay(12); ++ ++ /* Set RESET_BAR to 1 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 1); ++ ++ /* ++ * Wait at least 100 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): ++ * ((1000000 * 100) / 6000000) = aprox 17 us. ++ */ ++ ++ udelay(17); ++ ++ break; ++ ++ default: ++ return -ENODEV; ++ break; ++ } ++ return 0; ++} ++ ++struct mt9t111_platform_data mt9t111_pdata = { ++ .master = "omap34xxcam", ++ .power_set = mt9t111_power_set, ++ .priv_data_set = mt9t111_set_prv_data, ++ .ifparm = mt9t111_ifparm, ++}; ++ ++#endif /* #ifdef CONFIG_VIDEO_MT9T111 */ ++ + static int beagle_cam_probe(struct platform_device *pdev) + { + cam_1v8_reg = regulator_get(&pdev->dev, "cam_1v8"); +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index b0da483..0e7e8b2 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -77,6 +77,12 @@ static struct omap_opp * _omap37x_l3_rate_table = NULL; + extern struct mt9v113_platform_data mt9v113_pdata; + #endif + ++#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++#include <media/v4l2-int-device.h> ++#include <media/mt9t111.h> ++extern struct mt9t111_platform_data mt9t111_pdata; ++#endif ++ + #define GPMC_CS0_BASE 0x60 + #define GPMC_CS_SIZE 0x30 + +@@ -596,6 +602,12 @@ static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { + .platform_data = &mt9v113_pdata, + }, + #endif ++#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++ { ++ I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR), ++ .platform_data = &mt9t111_pdata, ++ }, ++#endif + }; + + static int __init omap3_beagle_i2c_init(void) +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0048-REMOVE-v4l2-Delete-MT9T111-sensor-driver.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0048-REMOVE-v4l2-Delete-MT9T111-sensor-driver.patch new file mode 100644 index 00000000..79ea2b57 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0048-REMOVE-v4l2-Delete-MT9T111-sensor-driver.patch @@ -0,0 +1,2402 @@ +From 59d42cae8d60b7e86013293055f6c989ab578f26 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 00:50:07 -0500 +Subject: [PATCH 48/75] REMOVE: v4l2: Delete MT9T111 sensor driver + +This removes MT9T111 support from the kernel. + +Reason? Driver already exists in open source, and we're going to +reuse that one instead. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/Kconfig | 8 - + drivers/media/video/Makefile | 1 - + drivers/media/video/mt9t111.c | 885 ------------------------ + drivers/media/video/mt9t111_reg.h | 1364 ------------------------------------- + include/media/mt9t111.h | 79 --- + 5 files changed, 0 insertions(+), 2337 deletions(-) + delete mode 100644 drivers/media/video/mt9t111.c + delete mode 100644 drivers/media/video/mt9t111_reg.h + delete mode 100644 include/media/mt9t111.h + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index c14d758..780b246 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -354,14 +354,6 @@ config VIDEO_MT9P012 + MT9P012 camera. It is currently working with the TI OMAP3 + camera controller. + +-config VIDEO_MT9T111 +- tristate "Micron MT9T111 raw sensor driver (3MP)" +- depends on I2C && VIDEO_V4L2 +- ---help--- +- This is a Video4Linux2 sensor-level driver for the Micron +- MT9T111 camera. It is currently working with the TI OMAP3 +- camera controller. +- + config VIDEO_DW9710 + tristate "Lens driver for DW9710" + depends on I2C && VIDEO_V4L2 +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index 763c157..3828723 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -128,7 +128,6 @@ obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o + obj-y += isp/ + obj-$(CONFIG_VIDEO_OMAP3) += omap34xxcam.o + obj-$(CONFIG_VIDEO_MT9P012) += mt9p012.o +-obj-$(CONFIG_VIDEO_MT9T111) += mt9t111.o + obj-$(CONFIG_VIDEO_DW9710) += dw9710.o + obj-$(CONFIG_VIDEO_TPS61059) += tps61059.o + obj-$(CONFIG_VIDEO_OV3640) += ov3640.o +diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c +deleted file mode 100644 +index 10080af..0000000 +--- a/drivers/media/video/mt9t111.c ++++ /dev/null +@@ -1,885 +0,0 @@ +-/* +- * drivers/media/video/mt9t111.c +- * +- * mt9t111 sensor driver +- * +- * Copyright (C) 2009 Leopard Imaging +- * +- * This file is licensed under the terms of the GNU General Public License +- * version 2. This program is licensed "as is" without any warranty of any +- * kind, whether express or implied. +- */ +- +-#include <linux/i2c.h> +-#include <linux/delay.h> +-#include <media/v4l2-int-device.h> +- +-#include <media/mt9t111.h> +-#include "mt9t111_reg.h" +- +-/* YCbCr mode does not work yet */ +-#define USE_RAW +-/* Create a Color bar test pattern, Blue, Green, Red, Grey */ +-/* #define COLOR_BAR */ +- +-#define SENSOR_DETECTED 1 +-#define SENSOR_NOT_DETECTED 0 +- +-static void mt9t111_loaddefault(struct i2c_client *client); +- +-/* +- * as a place holder for further development +- */ +-static void debug_dummy(char *in_msg) +-{ +-} +- +-/* list of image formats supported by mt9t111 sensor */ +-const static struct v4l2_fmtdesc mt9t111_formats[] = { +-#ifdef USE_RAW +- { +- .description = "RAW ", +- .pixelformat = V4L2_PIX_FMT_SGRBG10, +- }, +-#else +- { +- .description = "YUV 422 ", +- .pixelformat = V4L2_PIX_FMT_YUYV, +- }, +-#endif +-}; +- +-#define NUM_CAPTURE_FORMATS ARRAY_SIZE(mt9t111_formats) +- +-/* +- * Array of image sizes supported by MT9T111. These must be ordered from +- * smallest image size to largest. +- */ +-const static struct capture_size mt9t111_sizes[] = { +- { 640, 480 }, +- /* { 2048, 1536} */ +-}; +- +-#define NUM_CAPTURE_SIZE ARRAY_SIZE(mt9t111_sizes) +- +- +-const struct v4l2_fract mt9t111_frameintervals[] = { +- { .numerator = 1, .denominator = 10 } +-}; +- +-#define NUM_CAPTURE_FRAMEINTERVALS ARRAY_SIZE(mt9t111_frameintervals) +- +-/** +- * struct mt9t111_sensor - main structure for storage of sensor information +- * @pdata: access functions and data for platform level information +- * @v4l2_int_device: V4L2 device structure structure +- * @i2c_client: iic client device structure +- * @pix: V4L2 pixel format information structure +- * @timeperframe: time per frame expressed as V4L fraction +- * @scaler: +- * @ver: mt9t111 chip version +- * @fps: frames per second value +- */ +-struct mt9t111_sensor { +- const struct mt9t111_platform_data *pdata; +- struct v4l2_int_device *v4l2_int_device; +- struct i2c_client *i2c_client; +- struct v4l2_pix_format pix; +- struct v4l2_fract timeperframe; +- int scaler; +- int ver; +- int fps; +- int state; +-}; +- +-static struct mt9t111_sensor mt9t111 = { +- .timeperframe = { +- .numerator = 1, +- .denominator = 10, +- }, +- .state = SENSOR_NOT_DETECTED, +-}; +- +-/** +- * mt9t111_read_reg - Read a value from a register in an mt9t111 sensor device +- * @client: i2c driver client structure +- * @data_length: length of data to be read +- * @reg: register address / offset +- * @val: stores the value that gets read +- * +- * Read a value from a register in an mt9t111 sensor device. +- * The value is returned in 'val'. +- * Returns zero if successful, or non-zero otherwise. +- */ +-static int +-mt9t111_read_reg(struct i2c_client *client, u16 reg, u16 *val) +-{ +- struct i2c_msg msg[1]; +- u8 data[4]; +- int err; +- +- msg->addr = client->addr; +- msg->flags = 0; +- msg->len = 2; +- msg->buf = data; +- data[0] = (reg & 0xff00) >> 8; +- data[1] = (reg & 0x00ff); +- err = i2c_transfer(client->adapter, msg, 1); +- if (err >= 0) { +- msg->flags = I2C_M_RD; +- msg->len = 2; /* 2 byte read */ +- err = i2c_transfer(client->adapter, msg, 1); +- if (err >= 0) { +- *val = ((data[0] & 0x00ff) << 8) +- | (data[1] & 0x00ff); +- return 0; +- } +- } +- return err; +-} +- +-/** +- * mt9t111_write_reg - Write a value to a register in an mt9t111 sensor device +- * @client: i2c driver client structure +- * @data_length: length of data to be read +- * @reg: register address / offset +- * @val: value to be written to specified register +- * +- * Write a value to a register in an mt9t111 sensor device. +- * Returns zero if successful, or non-zero otherwise. +- */ +-static int +-mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val) +-{ +- struct i2c_msg msg[1]; +- u8 data[20]; +- int err; +- +- msg->addr = client->addr; +- msg->flags = 0; +- msg->len = 4; +- msg->buf = data; +- data[0] = (u8)((reg & 0xff00) >> 8); +- data[1] = (u8)(reg & 0x00ff); +- data[2] = (u8)((val & 0xff00) >> 8); +- data[3] = (u8)(val & 0x00ff); +- err = i2c_transfer(client->adapter, msg, 1); +- +- return err; +-} +- +-/** +- * mt9t111_write_regs - Write registers to an mt9t111 sensor device +- * @client: i2c driver client structure +- * @reg_in: pointer to registers to write +- * @cnt: the number of registers +- * +- * Write registers . +- * Returns zero if successful, or non-zero otherwise. +- */ +-static int +-mt9t111_write_regs(struct i2c_client *client, mt9t111_regs *reg_in, int cnt) +-{ +- int err = 0; +- int i; +- mt9t111_regs *reg = reg_in; +- +- for (i = 0; i < cnt; i++) { +- if (reg->delay_time == 0) { +- err |= mt9t111_write_reg(client, reg->addr, reg->data); +- } else if (reg->addr != 0 || reg->data != 0) { +- err |= mt9t111_write_reg(client, reg->addr, reg->data); +- mdelay(reg->delay_time); +- } else { +- mdelay(reg->delay_time); +- } +- +- if (err < 0) { +- dev_warn(&client->dev, "write reg error, addr = 0x%x," +- " data = 0x%x \n", +- reg->addr, reg->data); +- return err; +- } +- reg++; +- } +- return err; +-} +- +-/** +- * mt9t111_detect - Detect if an mt9t111 is present, and if so which revision +- * @client: pointer to the i2c client driver structure +- * +- * Detect if an mt9t111 is present +- * Returns a negative error number if no device is detected, or the +- * non-negative value of the version ID register if a device is detected. +- */ +-static int +-mt9t111_detect(struct i2c_client *client) +-{ +- u16 val; +- +- /* chip ID is at address 0 */ +- if (mt9t111_read_reg(client, MT9T111_CHIP_ID, &val) < 0) +- return -ENODEV; +- +- if (val != MT9T111_CHIP_ID_VALUE) { +- dev_warn(&client->dev, "model id mismatch received 0x%x" +- " expecting 0x%x\n", +- val, MT9T111_CHIP_ID_VALUE); +- +- return -ENODEV; +- } +- +- return (int)val; +- +-} +- +-/** +- * mt9t111_configure - Configure the mt9t111 for the specified image mode +- * @s: pointer to standard V4L2 device structure +- * +- * Configure the mt9t111 for a specified image size, pixel format, and frame +- * period. xclk is the frequency (in Hz) of the xclk input to the mt9t111. +- * fper is the frame period (in seconds) expressed as a fraction. +- * Returns zero if successful, or non-zero otherwise. +- * The actual frame period is returned in fper. +- */ +-static int mt9t111_configure(struct v4l2_int_device *s) +-{ +- debug_dummy("debug_dummy -- to set imager mode"); +- +- return 0; +-} +- +-/** +- * ioctl_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes +- * @s: pointer to standard V4L2 device structure +- * @frms: pointer to standard V4L2 framesizes enumeration structure +- * +- * Returns possible framesizes depending on choosen pixel format +- **/ +-static int ioctl_enum_framesizes(struct v4l2_int_device *s, +- struct v4l2_frmsizeenum *frms) +-{ +- int ifmt; +- +- for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) { +- if (frms->pixel_format == mt9t111_formats[ifmt].pixelformat) +- break; +- } +- /* Is requested pixelformat not found on sensor? */ +- if (ifmt == NUM_CAPTURE_FORMATS) +- return -EINVAL; +- +- /* Do we already reached all discrete framesizes? */ +- if (frms->index >= NUM_CAPTURE_SIZE) +- return -EINVAL; +- +- frms->type = V4L2_FRMSIZE_TYPE_DISCRETE; +- frms->discrete.width = mt9t111_sizes[frms->index].width; +- frms->discrete.height = mt9t111_sizes[frms->index].height; +- +- return 0; +- +-} +- +-static int ioctl_enum_frameintervals(struct v4l2_int_device *s, +- struct v4l2_frmivalenum *frmi) +-{ +- int ifmt; +- +- if (frmi->index >= NUM_CAPTURE_FRAMEINTERVALS) +- return -EINVAL; +- +- for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) { +- if (frmi->pixel_format == mt9t111_formats[ifmt].pixelformat) +- break; +- } +- /* Is requested pixelformat not found on sensor? */ +- if (ifmt == NUM_CAPTURE_FORMATS) +- return -EINVAL; +- +- frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; +- frmi->discrete.numerator = +- mt9t111_frameintervals[frmi->index].numerator; +- frmi->discrete.denominator = +- mt9t111_frameintervals[frmi->index].denominator; +- return 0; +-} +- +-/** +- * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT +- * @s: pointer to standard V4L2 device structure +- * +- * Initialize the sensor device (call mt9t111_configure()) +- */ +-static int ioctl_init(struct v4l2_int_device *s) +-{ +- return 0; +-} +- +-/** +- * ioctl_dev_exit - V4L2 sensor interface handler for vidioc_int_dev_exit_num +- * @s: pointer to standard V4L2 device structure +- * +- * Delinitialise the dev. at slave detach. The complement of ioctl_dev_init. +- */ +-static int ioctl_dev_exit(struct v4l2_int_device *s) +-{ +- return 0; +-} +- +-/** +- * ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num +- * @s: pointer to standard V4L2 device structure +- * +- * Initialise the device when slave attaches to the master. Returns 0 if +- * mt9t111 device could be found, otherwise returns appropriate error. +- */ +-static int ioctl_dev_init(struct v4l2_int_device *s) +-{ +- return 0; +-} +- +-/** +- * ioctl_s_power - V4L2 sensor interface handler for vidioc_int_s_power_num +- * @s: pointer to standard V4L2 device structure +- * @on: power state to which device is to be set +- * +- * Sets devices power state to requrested state, if possible. +- */ +-static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) +-{ +- struct mt9t111_sensor *sensor = s->priv; +- struct i2c_client *c = sensor->i2c_client; +- int rval; +- +- if ((on == V4L2_POWER_STANDBY) && (sensor->state == SENSOR_DETECTED)) +- debug_dummy("debug_dummy -- put to standby\n"); +- +- if (on != V4L2_POWER_ON) +- debug_dummy("debug_dummy -- stop master clock\n"); +- else +- debug_dummy("debug_dummy -- enable clock\n");; +- +- rval = sensor->pdata->power_set(s, on); +- if (rval < 0) { +- dev_err(&c->dev, "Unable to set the power state: " "mt9t111" +- " sensor\n"); +- /* sensor->pdata->set_xclk(0); */ +- return rval; +- } +- +- if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_DETECTED)) +- mt9t111_loaddefault(c); +- +- if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_NOT_DETECTED)) { +- rval = mt9t111_detect(c); +- if (rval < 0) { +- dev_err(&c->dev, "Unable to detect " "mt9t111" +- " sensor\n"); +- sensor->state = SENSOR_NOT_DETECTED; +- return rval; +- } +- dev_info(&c->dev, "chip version 0x%02x detected\n", rval); +- sensor->state = SENSOR_DETECTED; +- sensor->ver = rval; +- } +- return 0; +-} +- +-/** +- * ioctl_g_priv - V4L2 sensor interface handler for vidioc_int_g_priv_num +- * @s: pointer to standard V4L2 device structure +- * @p: void pointer to hold sensor's private data address +- * +- * Returns device's (sensor's) private data area address in p parameter +- */ +-static int ioctl_g_priv(struct v4l2_int_device *s, void *p) +-{ +- struct mt9t111_sensor *sensor = s->priv; +- +- return sensor->pdata->priv_data_set(p); +-} +- +-/** +- * ioctl_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl +- * @s: pointer to standard V4L2 device structure +- * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure +- * +- * Configures the sensor to use the input parameters, if possible. If +- * not possible, reverts to the old parameters and returns the +- * appropriate error code. +- */ +-static int ioctl_s_parm(struct v4l2_int_device *s, +- struct v4l2_streamparm *a) +-{ +- /* TODO: set paramters */ +- debug_dummy("debug_dummy -- VIDIOC_S_PARM "); +- return 0; +-} +- +-/** +- * ioctl_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl +- * @s: pointer to standard V4L2 device structure +- * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure +- * +- * Returns the sensor's video CAPTURE parameters. +- */ +-static int ioctl_g_parm(struct v4l2_int_device *s, +- struct v4l2_streamparm *a) +-{ +- struct mt9t111_sensor *sensor = s->priv; +- struct v4l2_captureparm *cparm = &a->parm.capture; +- +- if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) +- return -EINVAL; +- +- memset(a, 0, sizeof(*a)); +- a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; +- +- cparm->capability = V4L2_CAP_TIMEPERFRAME; +- cparm->timeperframe = sensor->timeperframe; +- +- return 0; +-} +- +-/** +- * ioctl_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap +- * @s: pointer to standard V4L2 device structure +- * @f: pointer to standard V4L2 v4l2_format structure +- * +- * Returns the sensor's current pixel format in the v4l2_format +- * parameter. +- */ +-static int ioctl_g_fmt_cap(struct v4l2_int_device *s, +- struct v4l2_format *f) +-{ +- struct mt9t111_sensor *sensor = s->priv; +- f->fmt.pix = sensor->pix; +- +- return 0; +-} +- +-/** +- * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl +- * @s: pointer to standard V4L2 device structure +- * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure +- * +- * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This +- * ioctl is used to negotiate the image capture size and pixel format +- * without actually making it take effect. +- */ +-static int ioctl_try_fmt_cap(struct v4l2_int_device *s, +- struct v4l2_format *f) +-{ +- struct v4l2_pix_format *pix = &f->fmt.pix; +- struct mt9t111_sensor *sensor = s->priv; +- struct v4l2_pix_format *pix2 = &sensor->pix; +- +- pix->width = 640; +- pix->height = 480; +-#ifdef USE_RAW +- pix->pixelformat = V4L2_PIX_FMT_SGRBG10; +- pix->bytesperline = pix->width; +- pix->colorspace = V4L2_COLORSPACE_SRGB; +-#else +- pix->pixelformat = V4L2_PIX_FMT_YUYV; +- pix->bytesperline = pix->width * 2; +- pix->colorspace = V4L2_COLORSPACE_JPEG; +-#endif +- pix->field = V4L2_FIELD_NONE; +- +- pix->sizeimage = pix->bytesperline * pix->height; +- pix->priv = 0; +- *pix2 = *pix; +- return 0; +-} +- +-/** +- * ioctl_s_fmt_cap - V4L2 sensor interface handler for VIDIOC_S_FMT ioctl +- * @s: pointer to standard V4L2 device structure +- * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure +- * +- * If the requested format is supported, configures the HW to use that +- * format, returns error code if format not supported or HW can't be +- * correctly configured. +- */ +-static int ioctl_s_fmt_cap(struct v4l2_int_device *s, +- struct v4l2_format *f) +-{ +- struct mt9t111_sensor *sensor = s->priv; +- struct v4l2_pix_format *pix = &f->fmt.pix; +- int rval; +- +- rval = ioctl_try_fmt_cap(s, f); +- if (!rval) +- sensor->pix = *pix; +- +- return rval; +-} +- +-/** +- * ioctl_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl +- * @s: pointer to standard V4L2 device structure +- * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure +- * +- * Implement the VIDIOC_ENUM_FMT ioctl for the CAPTURE buffer type. +- */ +-static int ioctl_enum_fmt_cap(struct v4l2_int_device *s, +- struct v4l2_fmtdesc *fmt) +-{ +- int index = fmt->index; +- enum v4l2_buf_type type = fmt->type; +- +- memset(fmt, 0, sizeof(*fmt)); +- fmt->index = index; +- fmt->type = type; +- +- switch (fmt->type) { +- case V4L2_BUF_TYPE_VIDEO_CAPTURE: +- if (index >= NUM_CAPTURE_FORMATS) +- return -EINVAL; +- break; +- default: +- return -EINVAL; +- } +- +- fmt->flags = mt9t111_formats[index].flags; +- strlcpy(fmt->description, mt9t111_formats[index].description, +- sizeof(fmt->description)); +- fmt->pixelformat = mt9t111_formats[index].pixelformat; +- +- return 0; +-} +- +-/** +- * ioctl_s_ctrl - V4L2 sensor interface handler for VIDIOC_S_CTRL ioctl +- * @s: pointer to standard V4L2 device structure +- * @vc: standard V4L2 VIDIOC_S_CTRL ioctl structure +- * +- * If the requested control is supported, sets the control's current +- * value in HW (and updates the video_control[] array). Otherwise, +- * returns -EINVAL if the control is not supported. +- */ +-static int ioctl_s_ctrl(struct v4l2_int_device *s, +- struct v4l2_control *vc) +-{ +- debug_dummy("debug_dummy -- s ctrl\n"); +- return 0; +-} +- +-/** +- * ioctl_g_ctrl - V4L2 sensor interface handler for VIDIOC_G_CTRL ioctl +- * @s: pointer to standard V4L2 device structure +- * @vc: standard V4L2 VIDIOC_G_CTRL ioctl structure +- * +- * If the requested control is supported, returns the control's current +- * value from the video_control[] array. Otherwise, returns -EINVAL +- * if the control is not supported. +- */ +-static int ioctl_g_ctrl(struct v4l2_int_device *s, +- struct v4l2_control *vc) +-{ +- debug_dummy("debug_dummy -- g ctrl\n"); +- return 0; +-} +- +-/** +- * ioctl_queryctrl - V4L2 sensor interface handler for VIDIOC_QUERYCTRL ioctl +- * @s: pointer to standard V4L2 device structure +- * @qc: standard V4L2 VIDIOC_QUERYCTRL ioctl structure +- * +- * If the requested control is supported, returns the control information +- * from the video_control[] array. Otherwise, returns -EINVAL if the +- * control is not supported. +- */ +-static int ioctl_queryctrl(struct v4l2_int_device *s, +- struct v4l2_queryctrl *qc) +-{ +- debug_dummy("debug_dummy -- query ctrl\n"); +- return -EINVAL; +-} +- +-/** +- * ioctl_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl +- * @s: pointer to standard V4L2 device structure +- * @index: number of the input +- * +- * If index is valid, selects the requested input. Otherwise, returns -EINVAL if +- * the input is not supported or there is no active signal present in the +- * selected input. +- */ +-static int ioctl_s_routing(struct v4l2_int_device *s, +- struct v4l2_routing *route) +-{ +- return 0; +-} +- +-/** +- * ioctl_g_ifparm - V4L2 decoder interface handler for vidioc_int_g_ifparm_num +- * @s: pointer to standard V4L2 device structure +- * @p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure +- * +- * Gets slave interface parameters. +- * Calculates the required xclk value to support the requested +- * clock parameters in p. This value is returned in the p +- * parameter. +- */ +-static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) +-{ +- struct mt9t111_sensor *sensor = s->priv; +- int rval; +- +- if (p == NULL) +- return -EINVAL; +- +- if (NULL == sensor->pdata->ifparm) +- return -EINVAL; +- +- rval = sensor->pdata->ifparm(p); +- if (rval) { +- v4l_err(sensor->i2c_client, "g_ifparm.Err[%d]\n", rval); +- return rval; +- } +- +- p->u.ycbcr.clock_curr = 40 * 1000000; /* temporal value */ +- +- return 0; +-} +- +-static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = { +- { .num = vidioc_int_enum_framesizes_num, +- .func = (v4l2_int_ioctl_func *)ioctl_enum_framesizes }, +- { .num = vidioc_int_enum_frameintervals_num, +- .func = (v4l2_int_ioctl_func *)ioctl_enum_frameintervals }, +- { .num = vidioc_int_dev_init_num, +- .func = (v4l2_int_ioctl_func *)ioctl_dev_init }, +- { .num = vidioc_int_dev_exit_num, +- .func = (v4l2_int_ioctl_func *)ioctl_dev_exit }, +- { .num = vidioc_int_s_power_num, +- .func = (v4l2_int_ioctl_func *)ioctl_s_power }, +- { .num = vidioc_int_g_priv_num, +- .func = (v4l2_int_ioctl_func *)ioctl_g_priv }, +- { .num = vidioc_int_g_ifparm_num, +- .func = (v4l2_int_ioctl_func *)ioctl_g_ifparm }, +- { .num = vidioc_int_init_num, +- .func = (v4l2_int_ioctl_func *)ioctl_init }, +- { .num = vidioc_int_enum_fmt_cap_num, +- .func = (v4l2_int_ioctl_func *)ioctl_enum_fmt_cap }, +- { .num = vidioc_int_try_fmt_cap_num, +- .func = (v4l2_int_ioctl_func *)ioctl_try_fmt_cap }, +- { .num = vidioc_int_g_fmt_cap_num, +- .func = (v4l2_int_ioctl_func *)ioctl_g_fmt_cap }, +- { .num = vidioc_int_s_fmt_cap_num, +- .func = (v4l2_int_ioctl_func *)ioctl_s_fmt_cap }, +- { .num = vidioc_int_g_parm_num, +- .func = (v4l2_int_ioctl_func *)ioctl_g_parm }, +- { .num = vidioc_int_s_parm_num, +- .func = (v4l2_int_ioctl_func *)ioctl_s_parm }, +- { .num = vidioc_int_queryctrl_num, +- .func = (v4l2_int_ioctl_func *)ioctl_queryctrl }, +- { .num = vidioc_int_g_ctrl_num, +- .func = (v4l2_int_ioctl_func *)ioctl_g_ctrl }, +- { .num = vidioc_int_s_ctrl_num, +- .func = (v4l2_int_ioctl_func *)ioctl_s_ctrl }, +- { .num = vidioc_int_s_video_routing_num, +- .func = (v4l2_int_ioctl_func *)ioctl_s_routing }, +-}; +- +-static void mt9t111_refresh(struct i2c_client *client) +-{ +- int i; +- unsigned short value; +- /* MCU_ADDRESS [SEQ_CMD] -- refresh */ +- mt9t111_write_reg(client, 0x098E, 0x8400); +- mt9t111_write_reg(client, 0x0990, 0x0006); +- for (i = 0; i < 100; i++) { +- mt9t111_write_reg(client, 0x098E, 0x8400); +- mt9t111_read_reg(client, 0x0990, &value); +- if (value == 0) +- break; +- mdelay(5); +- } +-} +- +-#ifdef COLOR_BAR +-static void mt9t111_color_bar(struct i2c_client *client) +-{ +- mt9t111_write_reg(client, 0x3210, 0x01B0); /* disable lens correction */ +- +- mt9t111_write_reg(client, 0x098E, 0x6003); +- mt9t111_write_reg(client, 0x0990, 0x0100); +- mt9t111_write_reg(client, 0x098E, 0x6025); +- mt9t111_write_reg(client, 0x0990, 0x0003); +-} +-#endif +- +-static void mt9t111_bayer_format(struct i2c_client *client) +-{ +- mt9t111_write_regs(client, bayer_pattern_regs, +- sizeof(bayer_pattern_regs) / sizeof(mt9t111_regs)); +-} +- +-static void mt9t111_enable_pll(struct i2c_client *client) +-{ +- int i; +- unsigned short value; +- +- mt9t111_write_regs(client, pll_regs1, +- sizeof(pll_regs1) / sizeof(mt9t111_regs)); +- for (i = 0; i < 100; i++) { +- mt9t111_read_reg(client, 0x0014, &value); +- if ((value & 0x8000) != 0) +- break; +- mdelay(2); +- } +- mt9t111_write_regs(client, pll_regs2, +- sizeof(pll_regs2) / sizeof(mt9t111_regs)); +-} +- +- +-static void mt9t111_loaddefault(struct i2c_client *client) +-{ +- mt9t111_write_reg(client, 0x001A, 0x0219); +- mt9t111_write_reg(client, 0x001A, 0x0218); +- +- mt9t111_enable_pll(client); +- mt9t111_write_regs(client, def_regs1, +- sizeof(def_regs1) / sizeof(mt9t111_regs)); +- mt9t111_write_regs(client, patch_rev6, +- sizeof(patch_rev6) / sizeof(mt9t111_regs)); +- mt9t111_write_regs(client, def_regs2, +- sizeof(def_regs2) / sizeof(mt9t111_regs)); +- +-#ifdef USE_RAW +- mt9t111_bayer_format(client); +-#endif +- +-#ifdef COLOR_BAR +- mt9t111_color_bar(client); +-#endif +- +- mt9t111_refresh(client); +-} +- +-static struct v4l2_int_slave mt9t111_slave = { +- .ioctls = mt9t111_ioctl_desc, +- .num_ioctls = ARRAY_SIZE(mt9t111_ioctl_desc), +-}; +- +-static struct v4l2_int_device mt9t111_int_device = { +- .module = THIS_MODULE, +- .name = "mt9t111", +- .priv = &mt9t111, +- .type = v4l2_int_type_slave, +- .u = { +- .slave = &mt9t111_slave, +- }, +-}; +- +-/** +- * mt9t111_probe - sensor driver i2c probe handler +- * @client: i2c driver client device structure +- * +- * Register sensor as an i2c client device and V4L2 +- * device. +- */ +-static int +-mt9t111_probe(struct i2c_client *client, const struct i2c_device_id *id) +-{ +- struct mt9t111_sensor *sensor = &mt9t111; +- int err; +- +- if (i2c_get_clientdata(client)) +- return -EBUSY; +- +- sensor->pdata = client->dev.platform_data; +- +- if (!sensor->pdata) { +- dev_err(&client->dev, "no platform data?\n"); +- return -ENODEV; +- } +- +- sensor->v4l2_int_device = &mt9t111_int_device; +- sensor->i2c_client = client; +- +- i2c_set_clientdata(client, sensor); +- +- sensor->pix.width = 640; +- sensor->pix.height = 480; +-#ifdef USE_RAW +- sensor->pix.pixelformat = V4L2_PIX_FMT_SGRBG10; +-#else +- sensor->pix.pixelformat = V4L2_PIX_FMT_YUYV; +-#endif +- err = v4l2_int_device_register(sensor->v4l2_int_device); +- if (err) +- i2c_set_clientdata(client, NULL); +- return err; +-} +- +-/** +- * mt9t111_remove - sensor driver i2c remove handler +- * @client: i2c driver client device structure +- * +- * Unregister sensor as an i2c client device and V4L2 +- * device. Complement of mt9t111_probe(). +- */ +-static int __exit +-mt9t111_remove(struct i2c_client *client) +-{ +- struct mt9t111_sensor *sensor = i2c_get_clientdata(client); +- +- if (!client->adapter) +- return -ENODEV; /* our client isn't attached */ +- +- v4l2_int_device_unregister(sensor->v4l2_int_device); +- i2c_set_clientdata(client, NULL); +- +- return 0; +-} +- +-static const struct i2c_device_id mt9t111_id[] = { +- { "mt9t111", 0 }, +- { }, +-}; +-MODULE_DEVICE_TABLE(i2c, mt9t111_id); +- +-static struct i2c_driver mt9t111sensor_i2c_driver = { +- .driver = { +- .name = "mt9t111", +- .owner = THIS_MODULE, +- }, +- .probe = mt9t111_probe, +- .remove = __exit_p(mt9t111_remove), +- .id_table = mt9t111_id, +-}; +- +-/** +- * mt9t111sensor_init - sensor driver module_init handler +- * +- * Registers driver as an i2c client driver. Returns 0 on success, +- * error code otherwise. +- */ +-static int __init mt9t111sensor_init(void) +-{ +-printk(KERN_INFO "entering mt9t111sensor_init\n"); +- return i2c_add_driver(&mt9t111sensor_i2c_driver); +-} +-module_init(mt9t111sensor_init); +- +-/** +- * mt9t111sensor_cleanup - sensor driver module_exit handler +- * +- * Unregisters/deletes driver as an i2c client driver. +- * Complement of mt9t111sensor_init. +- */ +-static void __exit mt9t111sensor_cleanup(void) +-{ +- i2c_del_driver(&mt9t111sensor_i2c_driver); +-} +-module_exit(mt9t111sensor_cleanup); +- +-MODULE_LICENSE("GPL"); +-MODULE_DESCRIPTION("mt9t111 camera sensor driver"); +diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h +deleted file mode 100644 +index e226c37..0000000 +--- a/drivers/media/video/mt9t111_reg.h ++++ /dev/null +@@ -1,1364 +0,0 @@ +-/* +- * drivers/media/video/mt9t111_reg.h +- * +- * mt9t111 sensor driver header file +- * +- * Copyright (C) 2009 Leopard Imaging +- * +- * This file is licensed under the terms of the GNU General Public License +- * version 2. This program is licensed "as is" without any warranty of any +- * kind, whether express or implied. +- */ +- +-#ifndef MT9T111_REG_H +-#define MT9T111_REG_H +- +-/* register addr */ +-#define MT9T111_CHIP_ID (0x0000) +- +-/* register value */ +-#define MT9T111_CHIP_ID_VALUE (0x2680) +- +-typedef struct { +- u16 delay_time; +- u16 addr; +- u16 data; +-} mt9t111_regs; +- +-mt9t111_regs patch_rev6[] = { +- {0, 0x0982, 0x0}, +- {0, 0x098A, 0xCE7}, +- {0, 0x0990, 0x3C3C}, +- {0, 0x0992, 0x3C3C}, +- {0, 0x0994, 0x3C5F}, +- {0, 0x0996, 0x4F30}, +- {0, 0x0998, 0xED08}, +- {0, 0x099a, 0xBD61}, +- {0, 0x099c, 0xD5CE}, +- {0, 0x099e, 0x4CD}, +- {0, 0x098A, 0xCF7}, +- {0, 0x0990, 0x1F17}, +- {0, 0x0992, 0x211}, +- {0, 0x0994, 0xCC33}, +- {0, 0x0996, 0x2E30}, +- {0, 0x0998, 0xED02}, +- {0, 0x099a, 0xCCFF}, +- {0, 0x099c, 0xFDED}, +- {0, 0x099e, 0xCC}, +- {0, 0x098A, 0xD07}, +- {0, 0x0990, 0x2}, +- {0, 0x0992, 0xBD70}, +- {0, 0x0994, 0x6D18}, +- {0, 0x0996, 0xDE1F}, +- {0, 0x0998, 0x181F}, +- {0, 0x099a, 0x8E01}, +- {0, 0x099c, 0x10CC}, +- {0, 0x099e, 0x3C52}, +- {0, 0x098A, 0xD17}, +- {0, 0x0990, 0x30ED}, +- {0, 0x0992, 0x18}, +- {0, 0x0994, 0xECA0}, +- {0, 0x0996, 0xC4FD}, +- {0, 0x0998, 0xBD70}, +- {0, 0x099a, 0x2120}, +- {0, 0x099c, 0x1ECC}, +- {0, 0x099e, 0x3C52}, +- {0, 0x098A, 0xD27}, +- {0, 0x0990, 0x30ED}, +- {0, 0x0992, 0xDE}, +- {0, 0x0994, 0x1FEC}, +- {0, 0x0996, 0xA0BD}, +- {0, 0x0998, 0x7021}, +- {0, 0x099a, 0xCC3C}, +- {0, 0x099c, 0x5230}, +- {0, 0x099e, 0xED02}, +- {0, 0x098A, 0xD37}, +- {0, 0x0990, 0xCCFF}, +- {0, 0x0992, 0xFCED}, +- {0, 0x0994, 0xCC}, +- {0, 0x0996, 0x2}, +- {0, 0x0998, 0xBD70}, +- {0, 0x099a, 0x6DFC}, +- {0, 0x099c, 0x4E1}, +- {0, 0x099e, 0x1A83}, +- {0, 0x098A, 0xD47}, +- {0, 0x0990, 0x1}, +- {0, 0x0992, 0x2720}, +- {0, 0x0994, 0x1A83}, +- {0, 0x0996, 0x4}, +- {0, 0x0998, 0x271E}, +- {0, 0x099a, 0x1A83}, +- {0, 0x099c, 0x8}, +- {0, 0x099e, 0x271C}, +- {0, 0x098A, 0xD57}, +- {0, 0x0990, 0x1A83}, +- {0, 0x0992, 0x10}, +- {0, 0x0994, 0x271A}, +- {0, 0x0996, 0x1A83}, +- {0, 0x0998, 0x20}, +- {0, 0x099a, 0x2718}, +- {0, 0x099c, 0x1A83}, +- {0, 0x099e, 0x40}, +- {0, 0x098A, 0xD67}, +- {0, 0x0990, 0x2716}, +- {0, 0x0992, 0x2019}, +- {0, 0x0994, 0xC61E}, +- {0, 0x0996, 0x2012}, +- {0, 0x0998, 0xC622}, +- {0, 0x099a, 0x200E}, +- {0, 0x099c, 0xC621}, +- {0, 0x099e, 0x200A}, +- {0, 0x098A, 0xD77}, +- {0, 0x0990, 0xC620}, +- {0, 0x0992, 0x2006}, +- {0, 0x0994, 0xC62A}, +- {0, 0x0996, 0x2002}, +- {0, 0x0998, 0xC62B}, +- {0, 0x099a, 0x30ED}, +- {0, 0x099c, 0x8CC}, +- {0, 0x099e, 0x3400}, +- {0, 0x098A, 0xD87}, +- {0, 0x0990, 0x30ED}, +- {0, 0x0992, 0x34}, +- {0, 0x0994, 0xBD6F}, +- {0, 0x0996, 0xD184}, +- {0, 0x0998, 0x330}, +- {0, 0x099a, 0xED07}, +- {0, 0x099c, 0xA60A}, +- {0, 0x099e, 0x4848}, +- {0, 0x098A, 0xD97}, +- {0, 0x0990, 0x5FED}, +- {0, 0x0992, 0x5EA}, +- {0, 0x0994, 0x8AA}, +- {0, 0x0996, 0x731}, +- {0, 0x0998, 0xBD70}, +- {0, 0x099a, 0x2130}, +- {0, 0x099c, 0xC60A}, +- {0, 0x099e, 0x3A35}, +- {0, 0x098A, 0xDA7}, +- {0, 0x0990, 0x3937}, +- {0, 0x0992, 0x3C3C}, +- {0, 0x0994, 0x3C34}, +- {0, 0x0996, 0xDE2F}, +- {0, 0x0998, 0xEE0E}, +- {0, 0x099a, 0xAD00}, +- {0, 0x099c, 0x7D13}, +- {0, 0x099e, 0xEF27}, +- {0, 0x098A, 0xDB7}, +- {0, 0x0990, 0x7CCE}, +- {0, 0x0992, 0x13E0}, +- {0, 0x0994, 0x1E05}, +- {0, 0x0996, 0x1060}, +- {0, 0x0998, 0xE60E}, +- {0, 0x099a, 0x4FC3}, +- {0, 0x099c, 0x13F0}, +- {0, 0x099e, 0x8FE6}, +- {0, 0x098A, 0xDC7}, +- {0, 0x0990, 0x30}, +- {0, 0x0992, 0xE107}, +- {0, 0x0994, 0x2216}, +- {0, 0x0996, 0xF613}, +- {0, 0x0998, 0xEE4F}, +- {0, 0x099a, 0xC313}, +- {0, 0x099c, 0xF38F}, +- {0, 0x099e, 0xE600}, +- {0, 0x098A, 0xDD7}, +- {0, 0x0990, 0x30E1}, +- {0, 0x0992, 0x725}, +- {0, 0x0994, 0x7F6}, +- {0, 0x0996, 0x13EE}, +- {0, 0x0998, 0xC103}, +- {0, 0x099a, 0x253C}, +- {0, 0x099c, 0x7F13}, +- {0, 0x099e, 0xEEF6}, +- {0, 0x098A, 0xDE7}, +- {0, 0x0990, 0x13EF}, +- {0, 0x0992, 0xE706}, +- {0, 0x0994, 0xCC13}, +- {0, 0x0996, 0xF0ED}, +- {0, 0x0998, 0x4CC}, +- {0, 0x099a, 0x13F3}, +- {0, 0x099c, 0x200F}, +- {0, 0x099e, 0x7C13}, +- {0, 0x098A, 0xDF7}, +- {0, 0x0990, 0xEEEC}, +- {0, 0x0992, 0x4C3}, +- {0, 0x0994, 0x1}, +- {0, 0x0996, 0xED04}, +- {0, 0x0998, 0xEC02}, +- {0, 0x099a, 0xC300}, +- {0, 0x099c, 0x1ED}, +- {0, 0x099e, 0x2F6}, +- {0, 0x098A, 0xE07}, +- {0, 0x0990, 0x13EE}, +- {0, 0x0992, 0xE106}, +- {0, 0x0994, 0x2412}, +- {0, 0x0996, 0xEE04}, +- {0, 0x0998, 0xE600}, +- {0, 0x099a, 0x30E1}, +- {0, 0x099c, 0x722}, +- {0, 0x099e, 0xDFEE}, +- {0, 0x098A, 0xE17}, +- {0, 0x0990, 0x2E6}, +- {0, 0x0992, 0x30}, +- {0, 0x0994, 0xE107}, +- {0, 0x0996, 0x25D6}, +- {0, 0x0998, 0xDE49}, +- {0, 0x099a, 0xEE08}, +- {0, 0x099c, 0xAD00}, +- {0, 0x099e, 0xCC13}, +- {0, 0x098A, 0xE27}, +- {0, 0x0990, 0xF630}, +- {0, 0x0992, 0xED00}, +- {0, 0x0994, 0xDE2F}, +- {0, 0x0996, 0xEE10}, +- {0, 0x0998, 0xCC13}, +- {0, 0x099a, 0xFAAD}, +- {0, 0x099c, 0x38}, +- {0, 0x099e, 0x3838}, +- {0, 0x098A, 0xE37}, +- {0, 0x0990, 0x3839}, +- {0, 0x098A, 0x1000}, +- {0, 0x0990, 0xCC10}, +- {0, 0x0992, 0x9BD}, +- {0, 0x0994, 0x4224}, +- {0, 0x0996, 0x7E10}, +- {0, 0x0998, 0x9C6}, +- {0, 0x099a, 0x1F7}, +- {0, 0x099c, 0x18A}, +- {0, 0x099e, 0xC606}, +- {0, 0x098A, 0x1010}, +- {0, 0x0990, 0xF701}, +- {0, 0x0992, 0x8BDE}, +- {0, 0x0994, 0x3F18}, +- {0, 0x0996, 0xCE0B}, +- {0, 0x0998, 0xF1CC}, +- {0, 0x099a, 0x11}, +- {0, 0x099c, 0xBDD7}, +- {0, 0x099e, 0xCC}, +- {0, 0x098A, 0x1020}, +- {0, 0x0990, 0xBF1}, +- {0, 0x0992, 0xDD3F}, +- {0, 0x0994, 0xDE35}, +- {0, 0x0996, 0x18CE}, +- {0, 0x0998, 0xC03}, +- {0, 0x099a, 0xCC00}, +- {0, 0x099c, 0x3FBD}, +- {0, 0x099e, 0xD700}, +- {0, 0x098A, 0x1030}, +- {0, 0x0990, 0xCC0C}, +- {0, 0x0992, 0x3DD}, +- {0, 0x0994, 0x35DE}, +- {0, 0x0996, 0x4718}, +- {0, 0x0998, 0xCE0C}, +- {0, 0x099a, 0x43CC}, +- {0, 0x099c, 0x15}, +- {0, 0x099e, 0xBDD7}, +- {0, 0x098A, 0x1040}, +- {0, 0x0990, 0xCC}, +- {0, 0x0992, 0xC43}, +- {0, 0x0994, 0xDD47}, +- {0, 0x0996, 0xFE00}, +- {0, 0x0998, 0x3318}, +- {0, 0x099a, 0xCE0C}, +- {0, 0x099c, 0x59CC}, +- {0, 0x099e, 0x9}, +- {0, 0x098A, 0x1050}, +- {0, 0x0990, 0xBDD7}, +- {0, 0x0992, 0xCC}, +- {0, 0x0994, 0xC59}, +- {0, 0x0996, 0xFD00}, +- {0, 0x0998, 0x33DE}, +- {0, 0x099a, 0x4118}, +- {0, 0x099c, 0xCE0C}, +- {0, 0x099e, 0x63CC}, +- {0, 0x098A, 0x1060}, +- {0, 0x0990, 0xD}, +- {0, 0x0992, 0xBDD7}, +- {0, 0x0994, 0xCC}, +- {0, 0x0996, 0xC63}, +- {0, 0x0998, 0xDD41}, +- {0, 0x099a, 0xFE00}, +- {0, 0x099c, 0x3118}, +- {0, 0x099e, 0xCE0C}, +- {0, 0x098A, 0x1070}, +- {0, 0x0990, 0x71CC}, +- {0, 0x0992, 0x29}, +- {0, 0x0994, 0xBDD7}, +- {0, 0x0996, 0xCC}, +- {0, 0x0998, 0xC71}, +- {0, 0x099a, 0xFD00}, +- {0, 0x099c, 0x31DE}, +- {0, 0x099e, 0x3918}, +- {0, 0x098A, 0x1080}, +- {0, 0x0990, 0xCE0C}, +- {0, 0x0992, 0x9BCC}, +- {0, 0x0994, 0x23}, +- {0, 0x0996, 0xBDD7}, +- {0, 0x0998, 0xCC}, +- {0, 0x099a, 0xC9B}, +- {0, 0x099c, 0xDD39}, +- {0, 0x099e, 0xDE49}, +- {0, 0x098A, 0x1090}, +- {0, 0x0990, 0x18CE}, +- {0, 0x0992, 0xCBF}, +- {0, 0x0994, 0xCC00}, +- {0, 0x0996, 0xDBD}, +- {0, 0x0998, 0xD700}, +- {0, 0x099a, 0xCC0C}, +- {0, 0x099c, 0xBFDD}, +- {0, 0x099e, 0x49CC}, +- {0, 0x098A, 0x10A0}, +- {0, 0x0990, 0x1162}, +- {0, 0x0992, 0xFD0B}, +- {0, 0x0994, 0xFDCC}, +- {0, 0x0996, 0xCE7}, +- {0, 0x0998, 0xFD0C}, +- {0, 0x099a, 0x1FCC}, +- {0, 0x099c, 0x1245}, +- {0, 0x099e, 0xFD0C}, +- {0, 0x098A, 0x10B0}, +- {0, 0x0990, 0x51CC}, +- {0, 0x0992, 0x110B}, +- {0, 0x0994, 0xFD0C}, +- {0, 0x0996, 0x5BCC}, +- {0, 0x0998, 0x1108}, +- {0, 0x099a, 0xFD0C}, +- {0, 0x099c, 0x65CC}, +- {0, 0x099e, 0x10D0}, +- {0, 0x098A, 0x10C0}, +- {0, 0x0990, 0xFD0C}, +- {0, 0x0992, 0x7BCC}, +- {0, 0x0994, 0x12DE}, +- {0, 0x0996, 0xFD0C}, +- {0, 0x0998, 0xA7CC}, +- {0, 0x099a, 0xDA8}, +- {0, 0x099c, 0xFD0C}, +- {0, 0x099e, 0xCB39}, +- {0, 0x098A, 0x10D0}, +- {0, 0x0990, 0x37DE}, +- {0, 0x0992, 0x1DEC}, +- {0, 0x0994, 0xC5F}, +- {0, 0x0996, 0x8402}, +- {0, 0x0998, 0x4416}, +- {0, 0x099a, 0x4FF7}, +- {0, 0x099c, 0xCCD}, +- {0, 0x099e, 0xE60B}, +- {0, 0x098A, 0x10E0}, +- {0, 0x0990, 0xC407}, +- {0, 0x0992, 0xF70C}, +- {0, 0x0994, 0xCE7F}, +- {0, 0x0996, 0x30C4}, +- {0, 0x0998, 0xEC25}, +- {0, 0x099a, 0xFD30}, +- {0, 0x099c, 0xC5FC}, +- {0, 0x099e, 0x6D6}, +- {0, 0x098A, 0x10F0}, +- {0, 0x0990, 0xFD30}, +- {0, 0x0992, 0xC701}, +- {0, 0x0994, 0xFC30}, +- {0, 0x0996, 0xC0FD}, +- {0, 0x0998, 0xBED}, +- {0, 0x099a, 0xFC30}, +- {0, 0x099c, 0xC2FD}, +- {0, 0x099e, 0xBEF}, +- {0, 0x098A, 0x1100}, +- {0, 0x0990, 0x30E6}, +- {0, 0x0992, 0xBD}, +- {0, 0x0994, 0x5203}, +- {0, 0x0996, 0x3139}, +- {0, 0x0998, 0x7E9E}, +- {0, 0x099a, 0x143C}, +- {0, 0x099c, 0x3C3C}, +- {0, 0x099e, 0x2101}, +- {0, 0x098A, 0x1110}, +- {0, 0x0990, 0xCC00}, +- {0, 0x0992, 0x18BD}, +- {0, 0x0994, 0x6FD1}, +- {0, 0x0996, 0xC504}, +- {0, 0x0998, 0x26F5}, +- {0, 0x099a, 0xDC25}, +- {0, 0x099c, 0x30ED}, +- {0, 0x099e, 0x420}, +- {0, 0x098A, 0x1120}, +- {0, 0x0990, 0x12EE}, +- {0, 0x0992, 0x43C}, +- {0, 0x0994, 0x1838}, +- {0, 0x0996, 0xE621}, +- {0, 0x0998, 0x18E7}, +- {0, 0x099a, 0xBE30}, +- {0, 0x099c, 0xEE04}, +- {0, 0x099e, 0xEC1D}, +- {0, 0x098A, 0x1130}, +- {0, 0x0990, 0x30ED}, +- {0, 0x0992, 0x4EC}, +- {0, 0x0994, 0x426}, +- {0, 0x0996, 0xEACC}, +- {0, 0x0998, 0x1A}, +- {0, 0x099a, 0xED02}, +- {0, 0x099c, 0xCCFB}, +- {0, 0x099e, 0xFFED}, +- {0, 0x098A, 0x1140}, +- {0, 0x0990, 0xCC}, +- {0, 0x0992, 0x400}, +- {0, 0x0994, 0xBD70}, +- {0, 0x0996, 0x6DCC}, +- {0, 0x0998, 0x1A}, +- {0, 0x099a, 0x30ED}, +- {0, 0x099c, 0x2CC}, +- {0, 0x099e, 0xFBFF}, +- {0, 0x098A, 0x1150}, +- {0, 0x0990, 0xED00}, +- {0, 0x0992, 0x5F4F}, +- {0, 0x0994, 0xBD70}, +- {0, 0x0996, 0x6D5F}, +- {0, 0x0998, 0xBD5B}, +- {0, 0x099a, 0x17BD}, +- {0, 0x099c, 0x558B}, +- {0, 0x099e, 0x3838}, +- {0, 0x098A, 0x1160}, +- {0, 0x0990, 0x3839}, +- {0, 0x0992, 0x3C3C}, +- {0, 0x0994, 0xC640}, +- {0, 0x0996, 0xF730}, +- {0, 0x0998, 0xC4FC}, +- {0, 0x099a, 0xBED}, +- {0, 0x099c, 0xFD30}, +- {0, 0x099e, 0xC0FC}, +- {0, 0x098A, 0x1170}, +- {0, 0x0990, 0xBEF}, +- {0, 0x0992, 0xFD30}, +- {0, 0x0994, 0xC2DE}, +- {0, 0x0996, 0x1DEC}, +- {0, 0x0998, 0x25FD}, +- {0, 0x099a, 0x30C5}, +- {0, 0x099c, 0x101}, +- {0, 0x099e, 0x1FC}, +- {0, 0x098A, 0x1180}, +- {0, 0x0990, 0x30C2}, +- {0, 0x0992, 0xFD06}, +- {0, 0x0994, 0xD6EC}, +- {0, 0x0996, 0xC5F}, +- {0, 0x0998, 0x8402}, +- {0, 0x099a, 0x4416}, +- {0, 0x099c, 0x4F30}, +- {0, 0x099e, 0xE703}, +- {0, 0x098A, 0x1190}, +- {0, 0x0990, 0xF10C}, +- {0, 0x0992, 0xCD27}, +- {0, 0x0994, 0x15F1}, +- {0, 0x0996, 0xCCD}, +- {0, 0x0998, 0x2309}, +- {0, 0x099a, 0xFC06}, +- {0, 0x099c, 0xD604}, +- {0, 0x099e, 0xFD06}, +- {0, 0x098A, 0x11A0}, +- {0, 0x0990, 0xD620}, +- {0, 0x0992, 0x7FC}, +- {0, 0x0994, 0x6D6}, +- {0, 0x0996, 0x5FD}, +- {0, 0x0998, 0x6D6}, +- {0, 0x099a, 0xDE1D}, +- {0, 0x099c, 0xE60B}, +- {0, 0x099e, 0xC407}, +- {0, 0x098A, 0x11B0}, +- {0, 0x0990, 0x30E7}, +- {0, 0x0992, 0x2F1}, +- {0, 0x0994, 0xCCE}, +- {0, 0x0996, 0x272C}, +- {0, 0x0998, 0x7D0C}, +- {0, 0x099a, 0xCE27}, +- {0, 0x099c, 0x275D}, +- {0, 0x099e, 0x2724}, +- {0, 0x098A, 0x11C0}, +- {0, 0x0990, 0x7F30}, +- {0, 0x0992, 0xC4FC}, +- {0, 0x0994, 0x6D6}, +- {0, 0x0996, 0xFD30}, +- {0, 0x0998, 0xC5F6}, +- {0, 0x099a, 0xCCE}, +- {0, 0x099c, 0x4FFD}, +- {0, 0x099e, 0x30C7}, +- {0, 0x098A, 0x11D0}, +- {0, 0x0990, 0xC640}, +- {0, 0x0992, 0xF730}, +- {0, 0x0994, 0xC4E6}, +- {0, 0x0996, 0x24F}, +- {0, 0x0998, 0xFD30}, +- {0, 0x099a, 0xC501}, +- {0, 0x099c, 0x101}, +- {0, 0x099e, 0xFC30}, +- {0, 0x098A, 0x11E0}, +- {0, 0x0990, 0xC2FD}, +- {0, 0x0992, 0x6D6}, +- {0, 0x0994, 0x7D06}, +- {0, 0x0996, 0xCB27}, +- {0, 0x0998, 0x2EC6}, +- {0, 0x099a, 0x40F7}, +- {0, 0x099c, 0x30C4}, +- {0, 0x099e, 0xFC06}, +- {0, 0x098A, 0x11F0}, +- {0, 0x0990, 0xC104}, +- {0, 0x0992, 0xF306}, +- {0, 0x0994, 0xD6ED}, +- {0, 0x0996, 0x5F}, +- {0, 0x0998, 0x6D00}, +- {0, 0x099a, 0x2A01}, +- {0, 0x099c, 0x5317}, +- {0, 0x099e, 0xFD30}, +- {0, 0x098A, 0x1200}, +- {0, 0x0990, 0xC0EC}, +- {0, 0x0992, 0xFD}, +- {0, 0x0994, 0x30C2}, +- {0, 0x0996, 0xFC06}, +- {0, 0x0998, 0xC1FD}, +- {0, 0x099a, 0x30C5}, +- {0, 0x099c, 0x101}, +- {0, 0x099e, 0x1FC}, +- {0, 0x098A, 0x1210}, +- {0, 0x0990, 0x30C2}, +- {0, 0x0992, 0xFD06}, +- {0, 0x0994, 0xC720}, +- {0, 0x0996, 0x227F}, +- {0, 0x0998, 0x30C4}, +- {0, 0x099a, 0xDE1D}, +- {0, 0x099c, 0xEC25}, +- {0, 0x099e, 0xFD30}, +- {0, 0x098A, 0x1220}, +- {0, 0x0990, 0xC5FC}, +- {0, 0x0992, 0x6D6}, +- {0, 0x0994, 0xFD30}, +- {0, 0x0996, 0xC701}, +- {0, 0x0998, 0xFC30}, +- {0, 0x099a, 0xC0FD}, +- {0, 0x099c, 0x6D0}, +- {0, 0x099e, 0xFC30}, +- {0, 0x098A, 0x1230}, +- {0, 0x0990, 0xC2FD}, +- {0, 0x0992, 0x6D2}, +- {0, 0x0994, 0xEC25}, +- {0, 0x0996, 0xFD06}, +- {0, 0x0998, 0xC3BD}, +- {0, 0x099a, 0x953C}, +- {0, 0x099c, 0xDE3F}, +- {0, 0x099e, 0xEE10}, +- {0, 0x098A, 0x1240}, +- {0, 0x0990, 0xAD00}, +- {0, 0x0992, 0x3838}, +- {0, 0x0994, 0x3930}, +- {0, 0x0996, 0x8FC3}, +- {0, 0x0998, 0xFFE9}, +- {0, 0x099a, 0x8F35}, +- {0, 0x099c, 0xBDAD}, +- {0, 0x099e, 0x1530}, +- {0, 0x098A, 0x1250}, +- {0, 0x0990, 0x6F16}, +- {0, 0x0992, 0x18DE}, +- {0, 0x0994, 0x1918}, +- {0, 0x0996, 0x8FC3}, +- {0, 0x0998, 0x14B}, +- {0, 0x099a, 0x188F}, +- {0, 0x099c, 0x18EC}, +- {0, 0x099e, 0xFD}, +- {0, 0x098A, 0x1260}, +- {0, 0x0990, 0x50E}, +- {0, 0x0992, 0x18EC}, +- {0, 0x0994, 0x2FD}, +- {0, 0x0996, 0x510}, +- {0, 0x0998, 0xE616}, +- {0, 0x099a, 0x4FED}, +- {0, 0x099c, 0x418}, +- {0, 0x099e, 0x8FC3}, +- {0, 0x098A, 0x1270}, +- {0, 0x0990, 0xFFCB}, +- {0, 0x0992, 0xE304}, +- {0, 0x0994, 0x8FE6}, +- {0, 0x0996, 0xF7}, +- {0, 0x0998, 0x514}, +- {0, 0x099a, 0x18DE}, +- {0, 0x099c, 0x1930}, +- {0, 0x099e, 0xE616}, +- {0, 0x098A, 0x1280}, +- {0, 0x0990, 0x4FED}, +- {0, 0x0992, 0x418}, +- {0, 0x0994, 0x8FC3}, +- {0, 0x0996, 0x119}, +- {0, 0x0998, 0xE304}, +- {0, 0x099a, 0x8FE6}, +- {0, 0x099c, 0xF7}, +- {0, 0x099e, 0x515}, +- {0, 0x098A, 0x1290}, +- {0, 0x0990, 0xFC05}, +- {0, 0x0992, 0x5BFD}, +- {0, 0x0994, 0x512}, +- {0, 0x0996, 0xDE37}, +- {0, 0x0998, 0xEE08}, +- {0, 0x099a, 0xAD00}, +- {0, 0x099c, 0x30E6}, +- {0, 0x099e, 0x164F}, +- {0, 0x098A, 0x12A0}, +- {0, 0x0990, 0x5ED}, +- {0, 0x0992, 0x48F}, +- {0, 0x0994, 0xC300}, +- {0, 0x0996, 0x630}, +- {0, 0x0998, 0xE304}, +- {0, 0x099a, 0x8FF6}, +- {0, 0x099c, 0x516}, +- {0, 0x099e, 0x4FED}, +- {0, 0x098A, 0x12B0}, +- {0, 0x0990, 0x30}, +- {0, 0x0992, 0x6C16}, +- {0, 0x0994, 0xE616}, +- {0, 0x0996, 0xC103}, +- {0, 0x0998, 0x2598}, +- {0, 0x099a, 0xCC32}, +- {0, 0x099c, 0x8EED}, +- {0, 0x099e, 0xEC}, +- {0, 0x098A, 0x12C0}, +- {0, 0x0990, 0x6BD}, +- {0, 0x0992, 0x7021}, +- {0, 0x0994, 0xCC32}, +- {0, 0x0996, 0x6C30}, +- {0, 0x0998, 0xED02}, +- {0, 0x099a, 0xCCF8}, +- {0, 0x099c, 0xED}, +- {0, 0x099e, 0xA6}, +- {0, 0x098A, 0x12D0}, +- {0, 0x0990, 0x9E3}, +- {0, 0x0992, 0xA84}, +- {0, 0x0994, 0x7BD}, +- {0, 0x0996, 0x706D}, +- {0, 0x0998, 0x30C6}, +- {0, 0x099a, 0x173A}, +- {0, 0x099c, 0x3539}, +- {0, 0x099e, 0x3CBD}, +- {0, 0x098A, 0x12E0}, +- {0, 0x0990, 0x776D}, +- {0, 0x0992, 0xCC32}, +- {0, 0x0994, 0x5C30}, +- {0, 0x0996, 0xED00}, +- {0, 0x0998, 0xFC13}, +- {0, 0x099a, 0x8683}, +- {0, 0x099c, 0x1}, +- {0, 0x099e, 0xBD70}, +- {0, 0x098A, 0x12F0}, +- {0, 0x0990, 0x21CC}, +- {0, 0x0992, 0x325E}, +- {0, 0x0994, 0x30ED}, +- {0, 0x0996, 0xFC}, +- {0, 0x0998, 0x1388}, +- {0, 0x099a, 0x8300}, +- {0, 0x099c, 0x1BD}, +- {0, 0x099e, 0x7021}, +- {0, 0x098A, 0x1300}, +- {0, 0x0990, 0x3839}, +- {0, 0x098E, 0x0010}, +- {0, 0x0990, 0x1000}, +- {0, 0x098E, 0x0003}, +- {100, 0x0990, 0x0004} +-}; +- +-mt9t111_regs def_regs1[] = { +- {0, 0x001A, 0x0218}, +- {0, 0x001E, 0x0777}, +- {0, 0x3084, 0x2409}, +- {0, 0x3092, 0x0A49}, +- {0, 0x3094, 0x4949}, +- {0, 0x3096, 0x4950}, +- {0, 0x0018, 0x402D}, +- {100, 0x0018, 0x402C}, +- {0, 0x098E, 0x6800}, +- {0, 0x0990, 0x0280}, +- {0, 0x098E, 0x6802}, +- {0, 0x0990, 0x01E0}, +- {0, 0x098E, 0xE88E}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x68A0}, +- {0, 0x0990, 0x082D}, +- {0, 0x098E, 0x4802}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x4804}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x4806}, +- {0, 0x0990, 0x060D}, +- {0, 0x098E, 0x4808}, +- {0, 0x0990, 0x080D}, +- {0, 0x098E, 0x480A}, +- {0, 0x0990, 0x0111}, +- {0, 0x098E, 0x480C}, +- {0, 0x0990, 0x046C}, +- {0, 0x098E, 0x480F}, +- {0, 0x0990, 0x00CC}, +- {0, 0x098E, 0x4811}, +- {0, 0x0990, 0x0381}, +- {0, 0x098E, 0x4813}, +- {0, 0x0990, 0x024F}, +- {0, 0x098E, 0x481D}, +- {0, 0x0990, 0x05AE}, +- {0, 0x098E, 0x481F}, +- {0, 0x0990, 0x05D0}, +- {0, 0x098E, 0x4825}, +- {0, 0x0990, 0x07AC}, +- {0, 0x098E, 0x6C00}, +- {0, 0x0990, 0x0800}, +- {0, 0x098E, 0x6C02}, +- {0, 0x0990, 0x0600}, +- {0, 0x098E, 0xEC8E}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x6CA0}, +- {0, 0x0990, 0x082D}, +- {0, 0x098E, 0x484A}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x484C}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x484E}, +- {0, 0x0990, 0x060D}, +- {0, 0x098E, 0x4850}, +- {0, 0x0990, 0x080D}, +- {0, 0x098E, 0x4852}, +- {0, 0x0990, 0x0111}, +- {0, 0x098E, 0x4854}, +- {0, 0x0990, 0x146C}, +- {0, 0x098E, 0x4857}, +- {0, 0x0990, 0x00CC}, +- {0, 0x098E, 0x4859}, +- {0, 0x0990, 0x0381}, +- {0, 0x098E, 0x485B}, +- {0, 0x0990, 0x024F}, +- {0, 0x098E, 0x4865}, +- {0, 0x0990, 0x05AE}, +- {0, 0x098E, 0x4867}, +- {0, 0x0990, 0x05D0}, +- {0, 0x098E, 0x486D}, +- {0, 0x0990, 0x07AC}, +- {0, 0x098E, 0xC8A5}, +- {0, 0x0990, 0x001D}, +- {0, 0x098E, 0xC8A6}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0xC8A7}, +- {0, 0x0990, 0x0023}, +- {0, 0x098E, 0xC8A8}, +- {0, 0x0990, 0x0026}, +- {0, 0x098E, 0xC844}, +- {0, 0x0990, 0x0091}, +- {0, 0x098E, 0xC92F}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xC845}, +- {0, 0x0990, 0x0079}, +- {0, 0x098E, 0xC92D}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xC88C}, +- {0, 0x0990, 0x0091}, +- {0, 0x098E, 0xC930}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xC88D}, +- {0, 0x0990, 0x0079}, +- {0, 0x098E, 0xC92E}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xA002}, +- {0, 0x0990, 0x0010}, +- {0, 0x098E, 0xA009}, +- {0, 0x0990, 0x0002}, +- {0, 0x098E, 0xA00A}, +- {0, 0x0990, 0x0003}, +- {0, 0x098E, 0xA00C}, +- {0, 0x0990, 0x000A}, +- {0, 0x098E, 0x4846}, +- {0, 0x0990, 0x0014}, +- {0, 0x098E, 0x68AA}, +- {0, 0x0990, 0x0278}, +- {0, 0x098E, 0x488E}, +- {0, 0x0990, 0x0014}, +- {0, 0x098E, 0x6CAA}, +- {0, 0x0990, 0x0218}, +- {0, 0x098E, 0x8400}, +- {0, 0x0990, 0x0006}, +- {0, 0x098E, 0x8400}, +- {0, 0x0990, 0x0005}, +- {0, 0x3C20, 0x0001}, +- {0, 0x364A, 0x7D2F}, +- {0, 0x364C, 0x79EB}, +- {0, 0x364E, 0x18D2}, +- {0, 0x3650, 0x9F8F}, +- {0, 0x3652, 0xA7D2}, +- {0, 0x368A, 0x460C}, +- {0, 0x368C, 0x14F0}, +- {0, 0x368E, 0x946F}, +- {0, 0x3690, 0xC471}, +- {0, 0x3692, 0x04B1}, +- {0, 0x36CA, 0x0433}, +- {0, 0x36CC, 0x680D}, +- {0, 0x36CE, 0xEEF3}, +- {0, 0x36D0, 0x4850}, +- {0, 0x36D2, 0xF233}, +- {0, 0x370A, 0xB2AF}, +- {0, 0x370C, 0x2CF0}, +- {0, 0x370E, 0x3F10}, +- {0, 0x3710, 0xC673}, +- {0, 0x3712, 0xA972}, +- {0, 0x374A, 0x0590}, +- {0, 0x374C, 0xAFB3}, +- {0, 0x374E, 0x93D7}, +- {0, 0x3750, 0x8D12}, +- {0, 0x3752, 0x2539}, +- {0, 0x3640, 0x0350}, +- {0, 0x3642, 0x322C}, +- {0, 0x3644, 0x77D1}, +- {0, 0x3646, 0xA26F}, +- {0, 0x3648, 0xC872}, +- {0, 0x3680, 0x0C4C}, +- {0, 0x3682, 0x9510}, +- {0, 0x3684, 0x110E}, +- {0, 0x3686, 0x4331}, +- {0, 0x3688, 0xC1CF}, +- {0, 0x36C0, 0x6152}, +- {0, 0x36C2, 0x038E}, +- {0, 0x36C4, 0x9AF4}, +- {0, 0x36C6, 0xE12F}, +- {0, 0x36C8, 0x09F3}, +- {0, 0x3700, 0xC5AF}, +- {0, 0x3702, 0xCA90}, +- {0, 0x3704, 0x5D0F}, +- {0, 0x3706, 0x3293}, +- {0, 0x3708, 0x2B92}, +- {0, 0x3740, 0xC590}, +- {0, 0x3742, 0x8133}, +- {0, 0x3744, 0xE0F6}, +- {0, 0x3746, 0x0254}, +- {0, 0x3748, 0x10B9}, +- {0, 0x3654, 0x7F8F}, +- {0, 0x3656, 0x6F6C}, +- {0, 0x3658, 0x5971}, +- {0, 0x365A, 0x9A0F}, +- {0, 0x365C, 0xA1B2}, +- {0, 0x3694, 0xB00C}, +- {0, 0x3696, 0xEBCF}, +- {0, 0x3698, 0x06AD}, +- {0, 0x369A, 0x4D31}, +- {0, 0x369C, 0x2A4E}, +- {0, 0x36D4, 0x4752}, +- {0, 0x36D6, 0x724D}, +- {0, 0x36D8, 0xAD34}, +- {0, 0x36DA, 0x1350}, +- {0, 0x36DC, 0x4E94}, +- {0, 0x3714, 0xA06E}, +- {0, 0x3716, 0x9152}, +- {0, 0x3718, 0x1F53}, +- {0, 0x371A, 0x3933}, +- {0, 0x371C, 0xBA94}, +- {0, 0x3754, 0x1233}, +- {0, 0x3756, 0xA032}, +- {0, 0x3758, 0xE936}, +- {0, 0x375A, 0xBE34}, +- {0, 0x375C, 0x02D9}, +- {0, 0x365E, 0x7DEF}, +- {0, 0x3660, 0x434B}, +- {0, 0x3662, 0x69F1}, +- {0, 0x3664, 0x8A0F}, +- {0, 0x3666, 0xBDB2}, +- {0, 0x369E, 0x290D}, +- {0, 0x36A0, 0x42CF}, +- {0, 0x36A2, 0xDC6D}, +- {0, 0x36A4, 0x91B1}, +- {0, 0x36A6, 0x9DE9}, +- {0, 0x36DE, 0x70B2}, +- {0, 0x36E0, 0x02AC}, +- {0, 0x36E2, 0x9714}, +- {0, 0x36E4, 0xF3CF}, +- {0, 0x36E6, 0x6BD1}, +- {0, 0x371E, 0xE42E}, +- {0, 0x3720, 0x1D32}, +- {0, 0x3722, 0xCC31}, +- {0, 0x3724, 0xAE94}, +- {0, 0x3726, 0x6413}, +- {0, 0x375E, 0xE290}, +- {0, 0x3760, 0x8F53}, +- {0, 0x3762, 0xF936}, +- {0, 0x3764, 0x4614}, +- {0, 0x3766, 0x1B59}, +- {0, 0x3784, 0x0404}, +- {0, 0x3782, 0x0304}, +- {0, 0x3210, 0x01B8}, +- {0, 0x098E, 0xC913}, +- {0, 0x0990, 0x000A}, +- {0, 0x098E, 0x686B}, +- {0, 0x0990, 0x05DC}, +- {0, 0x098E, 0x686D}, +- {0, 0x0990, 0x0BB8}, +- {0, 0x098E, 0x6C6B}, +- {0, 0x0990, 0x05DC}, +- {0, 0x098E, 0x6C6D}, +- {0, 0x0990, 0x0BB8}, +- {0, 0x098E, 0x3439}, +- {0, 0x0990, 0x05DC}, +- {0, 0x098E, 0x343B}, +- {0, 0x0990, 0x0BB8}, +- {0, 0x098E, 0x4926}, +- {0, 0x0990, 0x0001}, +- {0, 0x098E, 0x4928}, +- {0, 0x0990, 0x0002}, +- {0, 0x098E, 0x492A}, +- {0, 0x0990, 0x0656}, +- {0, 0x098E, 0x4D26}, +- {0, 0x0990, 0x0001}, +- {0, 0x098E, 0x4D28}, +- {0, 0x0990, 0x0002}, +- {0, 0x098E, 0x4D2A}, +- {0, 0x0990, 0x0656}, +- {0, 0x33F4, 0x040B}, +- {0, 0x098E, 0xC916}, +- {0, 0x0990, 0x0014}, +- {0, 0x098E, 0xC919}, +- {0, 0x0990, 0x0028}, +- {0, 0x098E, 0xC917}, +- {0, 0x0990, 0x0004}, +- {0, 0x098E, 0xC918}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xC91A}, +- {0, 0x0990, 0x0001}, +- {0, 0x098E, 0xC91B}, +- {0, 0x0990, 0x0009}, +- {0, 0x326C, 0x0C00}, +- {0, 0x098E, 0x494B}, +- {0, 0x0990, 0x0042}, +- {0, 0x098E, 0x494D}, +- {0, 0x0990, 0x012C}, +- {0, 0x098E, 0xC91E}, +- {0, 0x0990, 0x0012}, +- {0, 0x098E, 0xC91F}, +- {0, 0x0990, 0x000A}, +- {0, 0x098E, 0xC920}, +- {0, 0x0990, 0x0012}, +- {0, 0x098E, 0xC921}, +- {0, 0x0990, 0x000A}, +- {0, 0x098E, 0xC922}, +- {0, 0x0990, 0x0026}, +- {0, 0x098E, 0xC923}, +- {0, 0x0990, 0x001E}, +- {0, 0x098E, 0xC924}, +- {0, 0x0990, 0x0026}, +- {0, 0x098E, 0xC925}, +- {0, 0x0990, 0x0026}, +- {0, 0x098E, 0xBC02}, +- {0, 0x0990, 0x0003}, +- {0, 0x098E, 0xBC05}, +- {0, 0x0990, 0x000E}, +- {0, 0x098E, 0xC950}, +- {0, 0x0990, 0x0064}, +- {0, 0x098E, 0xC94F}, +- {0, 0x0990, 0x0038}, +- {0, 0x098E, 0xC952}, +- {0, 0x0990, 0x0064}, +- {0, 0x098E, 0xC951}, +- {0, 0x0990, 0x0051}, +- {0, 0x098E, 0xC954}, +- {0, 0x0990, 0x0010}, +- {0, 0x098E, 0xC953}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0xC956}, +- {0, 0x0990, 0x0010}, +- {0, 0x098E, 0xC955}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0xC958}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0xC957}, +- {0, 0x0990, 0x0014}, +- {0, 0x098E, 0xC95A}, +- {0, 0x0990, 0x001D}, +- {0, 0x098E, 0xC959}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0xC95C}, +- {0, 0x0990, 0x000C}, +- {0, 0x098E, 0xC95B}, +- {0, 0x0990, 0x0008}, +- {0, 0x098E, 0xC95E}, +- {0, 0x0990, 0x000C}, +- {0, 0x098E, 0xC95D}, +- {0, 0x0990, 0x0008}, +- {0, 0x098E, 0xC95F}, +- {0, 0x0990, 0x0064}, +- {0, 0x098E, 0x48DC}, +- {0, 0x0990, 0x004D}, +- {0, 0x098E, 0x48DE}, +- {0, 0x0990, 0x0096}, +- {0, 0x098E, 0x48E0}, +- {0, 0x0990, 0x001D}, +- {0, 0x098E, 0x48E2}, +- {0, 0x0990, 0x004D}, +- {0, 0x098E, 0x48E4}, +- {0, 0x0990, 0x0096}, +- {0, 0x098E, 0x48E6}, +- {0, 0x0990, 0x001D}, +- {0, 0x098E, 0x48E8}, +- {0, 0x0990, 0x004D}, +- {0, 0x098E, 0x48EA}, +- {0, 0x0990, 0x0096}, +- {0, 0x098E, 0x48EC}, +- {0, 0x0990, 0x001D}, +- {0, 0x098E, 0xDC2A}, +- {0, 0x0990, 0x000B}, +- {0, 0x098E, 0xDC2B}, +- {0, 0x0990, 0x0017}, +- {0, 0x098E, 0xBC0B}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xBC0C}, +- {0, 0x0990, 0x001B}, +- {0, 0x098E, 0xBC0D}, +- {0, 0x0990, 0x002A}, +- {0, 0x098E, 0xBC0E}, +- {0, 0x0990, 0x003E}, +- {0, 0x098E, 0xBC0F}, +- {0, 0x0990, 0x005A}, +- {0, 0x098E, 0xBC10}, +- {0, 0x0990, 0x0070}, +- {0, 0x098E, 0xBC11}, +- {0, 0x0990, 0x0081}, +- {0, 0x098E, 0xBC12}, +- {0, 0x0990, 0x0090}, +- {0, 0x098E, 0xBC13}, +- {0, 0x0990, 0x009E}, +- {0, 0x098E, 0xBC14}, +- {0, 0x0990, 0x00AB}, +- {0, 0x098E, 0xBC15}, +- {0, 0x0990, 0x00B6}, +- {0, 0x098E, 0xBC16}, +- {0, 0x0990, 0x00C1}, +- {0, 0x098E, 0xBC17}, +- {0, 0x0990, 0x00CB}, +- {0, 0x098E, 0xBC18}, +- {0, 0x0990, 0x00D5}, +- {0, 0x098E, 0xBC19}, +- {0, 0x0990, 0x00DE}, +- {0, 0x098E, 0xBC1A}, +- {0, 0x0990, 0x00E7}, +- {0, 0x098E, 0xBC1B}, +- {0, 0x0990, 0x00EF}, +- {0, 0x098E, 0xBC1C}, +- {0, 0x0990, 0x00F7}, +- {0, 0x098E, 0xBC1D}, +- {0, 0x0990, 0x00FF}, +- {0, 0x098E, 0xBC1E}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xBC1F}, +- {0, 0x0990, 0x001B}, +- {0, 0x098E, 0xBC20}, +- {0, 0x0990, 0x002A}, +- {0, 0x098E, 0xBC21}, +- {0, 0x0990, 0x003E}, +- {0, 0x098E, 0xBC22}, +- {0, 0x0990, 0x005A}, +- {0, 0x098E, 0xBC23}, +- {0, 0x0990, 0x0070}, +- {0, 0x098E, 0xBC24}, +- {0, 0x0990, 0x0081}, +- {0, 0x098E, 0xBC25}, +- {0, 0x0990, 0x0090}, +- {0, 0x098E, 0xBC26}, +- {0, 0x0990, 0x009E}, +- {0, 0x098E, 0xBC27}, +- {0, 0x0990, 0x00AB}, +- {0, 0x098E, 0xBC28}, +- {0, 0x0990, 0x00B6}, +- {0, 0x098E, 0xBC29}, +- {0, 0x0990, 0x00C1}, +- {0, 0x098E, 0xBC2A}, +- {0, 0x0990, 0x00CB}, +- {0, 0x098E, 0xBC2B}, +- {0, 0x0990, 0x00D5}, +- {0, 0x098E, 0xBC2C}, +- {0, 0x0990, 0x00DE}, +- {0, 0x098E, 0xBC2D}, +- {0, 0x0990, 0x00E7}, +- {0, 0x098E, 0xBC2E}, +- {0, 0x0990, 0x00EF}, +- {0, 0x098E, 0xBC2F}, +- {0, 0x0990, 0x00F7}, +- {0, 0x098E, 0xBC30}, +- {0, 0x0990, 0x00FF}, +- {0, 0x098E, 0xBC31}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xBC32}, +- {0, 0x0990, 0x000D}, +- {0, 0x098E, 0xBC33}, +- {0, 0x0990, 0x0019}, +- {0, 0x098E, 0xBC34}, +- {0, 0x0990, 0x0030}, +- {0, 0x098E, 0xBC35}, +- {0, 0x0990, 0x0056}, +- {0, 0x098E, 0xBC36}, +- {0, 0x0990, 0x0070}, +- {0, 0x098E, 0xBC37}, +- {0, 0x0990, 0x0081}, +- {0, 0x098E, 0xBC38}, +- {0, 0x0990, 0x0090}, +- {0, 0x098E, 0xBC39}, +- {0, 0x0990, 0x009E}, +- {0, 0x098E, 0xBC3A}, +- {0, 0x0990, 0x00AB}, +- {0, 0x098E, 0xBC3B}, +- {0, 0x0990, 0x00B6}, +- {0, 0x098E, 0xBC3C}, +- {0, 0x0990, 0x00C1}, +- {0, 0x098E, 0xBC3D}, +- {0, 0x0990, 0x00CB}, +- {0, 0x098E, 0xBC3E}, +- {0, 0x0990, 0x00D5}, +- {0, 0x098E, 0xBC3F}, +- {0, 0x0990, 0x00DE}, +- {0, 0x098E, 0xBC40}, +- {0, 0x0990, 0x00E7}, +- {0, 0x098E, 0xBC41}, +- {0, 0x0990, 0x00EF}, +- {0, 0x098E, 0xBC42}, +- {0, 0x0990, 0x00F7}, +- {0, 0x098E, 0xBC43}, +- {0, 0x0990, 0x00FF}, +- {0, 0x098E, 0x6865}, +- {0, 0x0990, 0x00E0}, +- {0, 0x098E, 0x6867}, +- {0, 0x0990, 0x00F4}, +- {0, 0x098E, 0x8400}, +- {0, 0x0990, 0x0006}, +- {0, 0x098E, 0xBC4A}, +- {0, 0x0990, 0x007F}, +- {0, 0x098E, 0xBC4B}, +- {0, 0x0990, 0x007F}, +- {0, 0x098E, 0xBC4C}, +- {0, 0x0990, 0x007F}, +- {0, 0x3542, 0x0010}, +- {0, 0x3544, 0x0030}, +- {0, 0x3546, 0x0040}, +- {0, 0x3548, 0x0080}, +- {0, 0x354A, 0x0100}, +- {0, 0x354C, 0x0200}, +- {0, 0x354E, 0x0300}, +- {0, 0x3550, 0x0010}, +- {0, 0x3552, 0x0030}, +- {0, 0x3554, 0x0040}, +- {0, 0x3556, 0x0080}, +- {0, 0x3558, 0x012C}, +- {0, 0x355A, 0x0320}, +- {0, 0x355C, 0x03E8}, +- {0, 0x3560, 0x0040}, +- {0, 0x3562, 0x0020}, +- {0, 0x3564, 0x0040}, +- {0, 0x3566, 0x0010}, +- {0, 0x3568, 0x0008}, +- {0, 0x356A, 0x0004}, +- {0, 0x356C, 0x0004}, +- {0, 0x356E, 0x0004}, +- {0, 0x098E, 0x3C4D}, +- {0, 0x0990, 0x0DAC}, +- {0, 0x098E, 0x3C4F}, +- {0, 0x0990, 0x148A}, +- {0, 0x098E, 0xC911}, +- {0, 0x0990, 0x00C8}, +- {0, 0x098E, 0xC8F4}, +- {0, 0x0990, 0x0004}, +- {0, 0x098E, 0xC8F5}, +- {0, 0x0990, 0x0002}, +- {0, 0x098E, 0x48F6}, +- {0, 0x0990, 0x3B4D}, +- {0, 0x098E, 0x48F8}, +- {0, 0x0990, 0x6380}, +- {0, 0x098E, 0x48FA}, +- {0, 0x0990, 0x9B18}, +- {0, 0x098E, 0x48FC}, +- {0, 0x0990, 0x5D51}, +- {0, 0x098E, 0x48FE}, +- {0, 0x0990, 0xEDE8}, +- {0, 0x098E, 0x4900}, +- {0, 0x0990, 0xE515}, +- {0, 0x098E, 0x4902}, +- {0, 0x0990, 0xBFF4}, +- {0, 0x098E, 0x4904}, +- {0, 0x0990, 0x001E}, +- {0, 0x098E, 0x4906}, +- {0, 0x0990, 0x0026}, +- {0, 0x098E, 0x4908}, +- {0, 0x0990, 0x0033}, +- {0, 0x098E, 0xE84A}, +- {0, 0x0990, 0x0083}, +- {0, 0x098E, 0xE84D}, +- {0, 0x0990, 0x0083}, +- {0, 0x098E, 0xE84C}, +- {0, 0x0990, 0x0080}, +- {0, 0x098E, 0xE84F}, +- {0, 0x0990, 0x0080}, +- {0, 0x098E, 0x8400}, +- {0, 0x0990, 0x0006}, +- {0, 0x098E, 0x48B0}, +- {0, 0x0990, 0x0180}, +- {0, 0x098E, 0x48B2}, +- {0, 0x0990, 0xFF7A}, +- {0, 0x098E, 0x48B4}, +- {0, 0x0990, 0x0018}, +- {0, 0x098E, 0x48B6}, +- {0, 0x0990, 0xFFCA}, +- {0, 0x098E, 0x48B8}, +- {0, 0x0990, 0x017C}, +- {0, 0x098E, 0x48BA}, +- {0, 0x0990, 0xFFCC}, +- {0, 0x098E, 0x48BC}, +- {0, 0x0990, 0x000C}, +- {0, 0x098E, 0x48BE}, +- {0, 0x0990, 0xFF1F}, +- {0, 0x098E, 0x48C0}, +- {0, 0x0990, 0x01E8}, +- {0, 0x098E, 0x48C2}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0x48C4}, +- {0, 0x0990, 0x0044}, +- {0, 0x098E, 0x48C6}, +- {0, 0x0990, 0x0079}, +- {0, 0x098E, 0x48C8}, +- {0, 0x0990, 0xFFAD}, +- {0, 0x098E, 0x48CA}, +- {0, 0x0990, 0xFFE2}, +- {0, 0x098E, 0x48CC}, +- {0, 0x0990, 0x0033}, +- {0, 0x098E, 0x48CE}, +- {0, 0x0990, 0x002A}, +- {0, 0x098E, 0x48D0}, +- {0, 0x0990, 0xFFAA}, +- {0, 0x098E, 0x48D2}, +- {0, 0x0990, 0x0017}, +- {0, 0x098E, 0x48D4}, +- {0, 0x0990, 0x004B}, +- {0, 0x098E, 0x48D6}, +- {0, 0x0990, 0xFFA5}, +- {0, 0x098E, 0x48D8}, +- {0, 0x0990, 0x0015}, +- {0, 0x098E, 0x48DA}, +- {0, 0x0990, 0xFFE2}, +- {0, 0x35A2, 0x0014}, +- {0, 0x098E, 0xC949}, +- {0, 0x0990, 0x0024}, +- {0, 0x35A4, 0x0596}, +- {0, 0x098E, 0xC94A}, +- {0, 0x0990, 0x0062}, +- {0, 0x098E, 0xC948}, +- {0, 0x0990, 0x0006}, +- {0, 0x098E, 0xC914}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xC915}, +- {0, 0x0990, 0x00FF}, +- {0, 0x098E, 0xE86F}, +- {0, 0x0990, 0x0060}, +- {0, 0x098E, 0xE870}, +- {0, 0x0990, 0x003C}, +- {0, 0x098E, 0xEC6F}, +- {0, 0x0990, 0x0060}, +- {0, 0x098E, 0xEC70}, +- {0, 0x0990, 0x003C}, +- {0, 0x098E, 0xE883}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xEC83}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x8400}, +- {0, 0x0990, 0x0006}, +- {0, 0x098E, 0xE885}, +- {0, 0x0990, 0x001E}, +- {0, 0x098E, 0xE886}, +- {0, 0x0990, 0x00D8}, +- {0, 0x098E, 0xEC85}, +- {0, 0x0990, 0x001E}, +- {0, 0x098E, 0xEC86}, +- {0, 0x0990, 0x00D8}, +- {0, 0x098E, 0xE884}, +- {0, 0x0990, 0x005C}, +- {0, 0x098E, 0xEC84}, +- {0, 0x0990, 0x005C}, +- {0, 0x098E, 0x490A}, +- {0, 0x0990, 0x0666}, +- {0, 0x098E, 0x490C}, +- {0, 0x0990, 0x0140}, +- {0, 0x098E, 0x6857}, +- {0, 0x0990, 0x0014}, +- {0, 0x098E, 0x685C}, +- {0, 0x0990, 0x0005}, +- {0, 0x098E, 0x490E}, +- {0, 0x0990, 0x00A4}, +- {0, 0x098E, 0xB43D}, +- {0, 0x0990, 0x0031}, +- {0, 0x098E, 0xB43E}, +- {0, 0x0990, 0x001B}, +- {0, 0x098E, 0xB43F}, +- {0, 0x0990, 0x0028}, +- {0, 0x098E, 0xB440}, +- {0, 0x0990, 0x0003}, +- {0, 0x098E, 0xB441}, +- {0, 0x0990, 0x00CD}, +- {0, 0x098E, 0xB442}, +- {0, 0x0990, 0x0064}, +- {0, 0x098E, 0xB443}, +- {0, 0x0990, 0x000F}, +- {0, 0x098E, 0xB444}, +- {0, 0x0990, 0x0007}, +- {0, 0x098E, 0x300D}, +- {0, 0x0990, 0x000F}, +- {0, 0x098E, 0x3017}, +- {0, 0x0990, 0x0F0F}, +- {0, 0x098E, 0x8400}, +- {0, 0x0990, 0x0006}, +- {0, 0x098E, 0xE81F}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0x68A0}, +- {0, 0x0990, 0x082E}, +- {0, 0x098E, 0x6CA0}, +- {0, 0x0990, 0x082E}, +- {0, 0x098E, 0x70A0}, +- {0, 0x0990, 0x082E}, +- {0, 0x098E, 0x74A0}, +- {0, 0x0990, 0x082E}, +- {0, 0x3C52, 0x082E}, +- {0, 0x098E, 0x488E}, +- {0, 0x0990, 0x0020}, +- {0, 0x098E, 0xECAC}, +- {0, 0x0990, 0x0000} +-}; +- +-mt9t111_regs def_regs2[] = { +- {100, 0x0018, 0x0028}, +- {0, 0x316C, 0x350F}, +- {0, 0x098E, 0x6817}, +- {0, 0x0990, 0x000C}, +- {0, 0x0034, 0x0000} +-}; +- +-mt9t111_regs pll_regs1[] = { +- {0, 0x0014, 0x2425}, +- {0, 0x0014, 0x2425}, +- {0, 0x0014, 0x2145}, +- {0, 0x0010, 0x0219}, +- {0, 0x0012, 0x0090}, +- {0, 0x002A, 0x79DD}, +- {0, 0x0014, 0x2545}, +- {0, 0x0014, 0x2547}, +- {0, 0x0014, 0x3447}, +- {0, 0x0014, 0x3047} +-}; +- +-mt9t111_regs pll_regs2[] = { +- {0, 0x0014, 0x3046}, +- {0, 0x0022, 0x01E0}, +- {0, 0x001E, 0x0707}, +- {0, 0x3B84, 0x011D} +-}; +- +-mt9t111_regs bayer_pattern_regs[] = { +- {0, 0x098E, 0x6807}, +- {0, 0x0990, 0x0100}, +- {0, 0x098E, 0x6809}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xE88E}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0x6C07}, +- {0, 0x0990, 0x0100}, +- {0, 0x098E, 0x6C09}, +- {0, 0x0990, 0x0000}, +- {0, 0x098E, 0xEC8E}, +- {0, 0x0990, 0x0000} +-}; +- +-#endif +diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h +deleted file mode 100644 +index cd34885..0000000 +--- a/include/media/mt9t111.h ++++ /dev/null +@@ -1,79 +0,0 @@ +-/* +- * include/media/mt9t111.h +- * +- * mt9t111 sensor driver +- * +- * Copyright (C) 2009 Leopard Imaging +- * +- * This file is licensed under the terms of the GNU General Public License +- * version 2. This program is licensed "as is" without any warranty of any +- * kind, whether express or implied. +- */ +- +-#ifndef MT9T111_H +-#define MT9T111_H +- +-/********************************* +- * Defines and Macros and globals +- ********************************/ +- +-#ifdef TRUE +-#undef TRUE +-#endif +- +-#ifdef FALSE +-#undef FALSE +-#endif +- +-#define TRUE 1 +-#define FALSE 0 +- +-#ifdef DEBUG +-#undef DEBUG +-#endif +- +-#ifndef TYPES +-#define TYPES +-#endif +- +-#define MT9T111_I2C_REGISTERED (1) +-#define MT9T111_I2C_UNREGISTERED (0) +- +-/*i2c adress for MT9T111*/ +-#define MT9T111_I2C_ADDR (0x78 >> 1) +- +-#define MT9T111_CLK_MAX (54000000) /* 54MHz */ +-#define MT9T111_CLK_MIN (6000000) /* 6Mhz */ +- +-#define MT9T111_I2C_CONFIG (1) +-#define I2C_ONE_BYTE_TRANSFER (1) +-#define I2C_TWO_BYTE_TRANSFER (2) +-#define I2C_THREE_BYTE_TRANSFER (3) +-#define I2C_FOUR_BYTE_TRANSFER (4) +-#define I2C_TXRX_DATA_MASK (0x00FF) +-#define I2C_TXRX_DATA_MASK_UPPER (0xFF00) +-#define I2C_TXRX_DATA_SHIFT (8) +- +-struct mt9t111_platform_data { +- char *master; +- int (*power_set) (struct v4l2_int_device *s, enum v4l2_power on); +- int (*ifparm) (struct v4l2_ifparm *p); +- int (*priv_data_set) (void *); +- /* Interface control params */ +- bool clk_polarity; +- bool hs_polarity; +- bool vs_polarity; +-}; +- +-/** +- * struct capture_size - image capture size information +- * @width: image width in pixels +- * @height: image height in pixels +- */ +-struct capture_size { +- unsigned long width; +- unsigned long height; +-}; +- +-#endif /*for ifndef MT9T111 */ +- +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0049-V4L-DVB-13670-soc-camera-Add-mt9t112-camera-driver.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0049-V4L-DVB-13670-soc-camera-Add-mt9t112-camera-driver.patch new file mode 100644 index 00000000..b4ca4a6c --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0049-V4L-DVB-13670-soc-camera-Add-mt9t112-camera-driver.patch @@ -0,0 +1,1285 @@ +From 1164e8b10b5237d1cf60c1e9752324b62f30a6bc Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto <morimoto.kuninori@renesas.com> +Date: Fri, 11 Dec 2009 11:53:55 -0300 +Subject: [PATCH 49/75] V4L/DVB (13670): soc-camera: Add mt9t112 camera driver + +create mode 100644 drivers/media/video/mt9t112.c + create mode 100644 include/media/mt9t112.h + +Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> +Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> +Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> +--- + drivers/media/video/Kconfig | 6 + + drivers/media/video/Makefile | 1 + + drivers/media/video/mt9t112.c | 1177 +++++++++++++++++++++++++++++++++++++++ + include/media/mt9t112.h | 30 + + include/media/v4l2-chip-ident.h | 2 + + 5 files changed, 1216 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/video/mt9t112.c + create mode 100644 include/media/mt9t112.h + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index 780b246..7caade9 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -832,6 +832,12 @@ config SOC_CAMERA_MT9T031 + help + This driver supports MT9T031 cameras from Micron. + ++config SOC_CAMERA_MT9T112 ++ tristate "mt9t112 support" ++ depends on SOC_CAMERA && I2C ++ help ++ This driver supports MT9T112 cameras from Aptina. ++ + config SOC_CAMERA_MT9V022 + tristate "mt9v022 support" + depends on SOC_CAMERA && I2C +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index 3828723..61ae13f 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -80,6 +80,7 @@ obj-$(CONFIG_VIDEO_MT9V113) += mt9v113.o + obj-$(CONFIG_SOC_CAMERA_MT9M001) += mt9m001.o + obj-$(CONFIG_SOC_CAMERA_MT9M111) += mt9m111.o + obj-$(CONFIG_SOC_CAMERA_MT9T031) += mt9t031.o ++obj-$(CONFIG_SOC_CAMERA_MT9T112) += mt9t112.o + obj-$(CONFIG_SOC_CAMERA_MT9V022) += mt9v022.o + obj-$(CONFIG_SOC_CAMERA_OV772X) += ov772x.o + obj-$(CONFIG_SOC_CAMERA_OV9640) += ov9640.o +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +new file mode 100644 +index 0000000..fc4dd60 +--- /dev/null ++++ b/drivers/media/video/mt9t112.c +@@ -0,0 +1,1177 @@ ++/* ++ * mt9t112 Camera Driver ++ * ++ * Copyright (C) 2009 Renesas Solutions Corp. ++ * Kuninori Morimoto <morimoto.kuninori@renesas.com> ++ * ++ * Based on ov772x driver, mt9m111 driver, ++ * ++ * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com> ++ * Copyright (C) 2008, Robert Jarzmik <robert.jarzmik@free.fr> ++ * Copyright 2006-7 Jonathan Corbet <corbet@lwn.net> ++ * Copyright (C) 2008 Magnus Damm ++ * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include <linux/delay.h> ++#include <linux/i2c.h> ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/slab.h> ++#include <linux/videodev2.h> ++ ++#include <media/mt9t112.h> ++#include <media/soc_camera.h> ++#include <media/soc_mediabus.h> ++#include <media/v4l2-chip-ident.h> ++#include <media/v4l2-common.h> ++ ++/* you can check PLL/clock info */ ++/* #define EXT_CLOCK 24000000 */ ++ ++/************************************************************************ ++ ++ ++ macro ++ ++ ++************************************************************************/ ++/* ++ * frame size ++ */ ++#define MAX_WIDTH 2048 ++#define MAX_HEIGHT 1536 ++ ++#define VGA_WIDTH 640 ++#define VGA_HEIGHT 480 ++ ++/* ++ * macro of read/write ++ */ ++#define ECHECKER(ret, x) \ ++ do { \ ++ (ret) = (x); \ ++ if ((ret) < 0) \ ++ return (ret); \ ++ } while (0) ++ ++#define mt9t112_reg_write(ret, client, a, b) \ ++ ECHECKER(ret, __mt9t112_reg_write(client, a, b)) ++#define mt9t112_mcu_write(ret, client, a, b) \ ++ ECHECKER(ret, __mt9t112_mcu_write(client, a, b)) ++ ++#define mt9t112_reg_mask_set(ret, client, a, b, c) \ ++ ECHECKER(ret, __mt9t112_reg_mask_set(client, a, b, c)) ++#define mt9t112_mcu_mask_set(ret, client, a, b, c) \ ++ ECHECKER(ret, __mt9t112_mcu_mask_set(client, a, b, c)) ++ ++#define mt9t112_reg_read(ret, client, a) \ ++ ECHECKER(ret, __mt9t112_reg_read(client, a)) ++ ++/* ++ * Logical address ++ */ ++#define _VAR(id, offset, base) (base | (id & 0x1f) << 10 | (offset & 0x3ff)) ++#define VAR(id, offset) _VAR(id, offset, 0x0000) ++#define VAR8(id, offset) _VAR(id, offset, 0x8000) ++ ++/************************************************************************ ++ ++ ++ struct ++ ++ ++************************************************************************/ ++struct mt9t112_frame_size { ++ u16 width; ++ u16 height; ++}; ++ ++struct mt9t112_format { ++ enum v4l2_mbus_pixelcode code; ++ enum v4l2_colorspace colorspace; ++ u16 fmt; ++ u16 order; ++}; ++ ++struct mt9t112_priv { ++ struct v4l2_subdev subdev; ++ struct mt9t112_camera_info *info; ++ struct i2c_client *client; ++ struct soc_camera_device icd; ++ struct mt9t112_frame_size frame; ++ const struct mt9t112_format *format; ++ int model; ++ u32 flags; ++/* for flags */ ++#define INIT_DONE (1<<0) ++}; ++ ++/************************************************************************ ++ ++ ++ supported format ++ ++ ++************************************************************************/ ++ ++static const struct mt9t112_format mt9t112_cfmts[] = { ++ { ++ .code = V4L2_MBUS_FMT_YUYV8_2X8_BE, ++ .colorspace = V4L2_COLORSPACE_JPEG, ++ .fmt = 1, ++ .order = 0, ++ }, { ++ .code = V4L2_MBUS_FMT_YVYU8_2X8_BE, ++ .colorspace = V4L2_COLORSPACE_JPEG, ++ .fmt = 1, ++ .order = 1, ++ }, { ++ .code = V4L2_MBUS_FMT_YUYV8_2X8_LE, ++ .colorspace = V4L2_COLORSPACE_JPEG, ++ .fmt = 1, ++ .order = 2, ++ }, { ++ .code = V4L2_MBUS_FMT_YVYU8_2X8_LE, ++ .colorspace = V4L2_COLORSPACE_JPEG, ++ .fmt = 1, ++ .order = 3, ++ }, { ++ .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, ++ .colorspace = V4L2_COLORSPACE_SRGB, ++ .fmt = 8, ++ .order = 2, ++ }, { ++ .code = V4L2_MBUS_FMT_RGB565_2X8_LE, ++ .colorspace = V4L2_COLORSPACE_SRGB, ++ .fmt = 4, ++ .order = 2, ++ }, ++}; ++ ++/************************************************************************ ++ ++ ++ general function ++ ++ ++************************************************************************/ ++static struct mt9t112_priv *to_mt9t112(const struct i2c_client *client) ++{ ++ return container_of(i2c_get_clientdata(client), ++ struct mt9t112_priv, ++ subdev); ++} ++ ++static int __mt9t112_reg_read(const struct i2c_client *client, u16 command) ++{ ++ struct i2c_msg msg[2]; ++ u8 buf[2]; ++ int ret; ++ ++ command = swab16(command); ++ ++ msg[0].addr = client->addr; ++ msg[0].flags = 0; ++ msg[0].len = 2; ++ msg[0].buf = (u8 *)&command; ++ ++ msg[1].addr = client->addr; ++ msg[1].flags = I2C_M_RD; ++ msg[1].len = 2; ++ msg[1].buf = buf; ++ ++ /* ++ * if return value of this function is < 0, ++ * it mean error. ++ * else, under 16bit is valid data. ++ */ ++ ret = i2c_transfer(client->adapter, msg, 2); ++ if (ret < 0) ++ return ret; ++ ++ memcpy(&ret, buf, 2); ++ return swab16(ret); ++} ++ ++static int __mt9t112_reg_write(const struct i2c_client *client, ++ u16 command, u16 data) ++{ ++ struct i2c_msg msg; ++ u8 buf[4]; ++ int ret; ++ ++ command = swab16(command); ++ data = swab16(data); ++ ++ memcpy(buf + 0, &command, 2); ++ memcpy(buf + 2, &data, 2); ++ ++ msg.addr = client->addr; ++ msg.flags = 0; ++ msg.len = 4; ++ msg.buf = buf; ++ ++ /* ++ * i2c_transfer return message length, ++ * but this function should return 0 if correct case ++ */ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ if (ret >= 0) ++ ret = 0; ++ ++ return ret; ++} ++ ++static int __mt9t112_reg_mask_set(const struct i2c_client *client, ++ u16 command, ++ u16 mask, ++ u16 set) ++{ ++ int val = __mt9t112_reg_read(client, command); ++ if (val < 0) ++ return val; ++ ++ val &= ~mask; ++ val |= set & mask; ++ ++ return __mt9t112_reg_write(client, command, val); ++} ++ ++/* mcu access */ ++static int __mt9t112_mcu_read(const struct i2c_client *client, u16 command) ++{ ++ int ret; ++ ++ ret = __mt9t112_reg_write(client, 0x098E, command); ++ if (ret < 0) ++ return ret; ++ ++ return __mt9t112_reg_read(client, 0x0990); ++} ++ ++static int __mt9t112_mcu_write(const struct i2c_client *client, ++ u16 command, u16 data) ++{ ++ int ret; ++ ++ ret = __mt9t112_reg_write(client, 0x098E, command); ++ if (ret < 0) ++ return ret; ++ ++ return __mt9t112_reg_write(client, 0x0990, data); ++} ++ ++static int __mt9t112_mcu_mask_set(const struct i2c_client *client, ++ u16 command, ++ u16 mask, ++ u16 set) ++{ ++ int val = __mt9t112_mcu_read(client, command); ++ if (val < 0) ++ return val; ++ ++ val &= ~mask; ++ val |= set & mask; ++ ++ return __mt9t112_mcu_write(client, command, val); ++} ++ ++static int mt9t112_reset(const struct i2c_client *client) ++{ ++ int ret; ++ ++ mt9t112_reg_mask_set(ret, client, 0x001a, 0x0001, 0x0001); ++ msleep(1); ++ mt9t112_reg_mask_set(ret, client, 0x001a, 0x0001, 0x0000); ++ ++ return ret; ++} ++ ++#ifndef EXT_CLOCK ++#define CLOCK_INFO(a, b) ++#else ++#define CLOCK_INFO(a, b) mt9t112_clock_info(a, b) ++static int mt9t112_clock_info(const struct i2c_client *client, u32 ext) ++{ ++ int m, n, p1, p2, p3, p4, p5, p6, p7; ++ u32 vco, clk; ++ char *enable; ++ ++ ext /= 1000; /* kbyte order */ ++ ++ mt9t112_reg_read(n, client, 0x0012); ++ p1 = n & 0x000f; ++ n = n >> 4; ++ p2 = n & 0x000f; ++ n = n >> 4; ++ p3 = n & 0x000f; ++ ++ mt9t112_reg_read(n, client, 0x002a); ++ p4 = n & 0x000f; ++ n = n >> 4; ++ p5 = n & 0x000f; ++ n = n >> 4; ++ p6 = n & 0x000f; ++ ++ mt9t112_reg_read(n, client, 0x002c); ++ p7 = n & 0x000f; ++ ++ mt9t112_reg_read(n, client, 0x0010); ++ m = n & 0x00ff; ++ n = (n >> 8) & 0x003f; ++ ++ enable = ((6000 > ext) || (54000 < ext)) ? "X" : ""; ++ dev_info(&client->dev, "EXTCLK : %10u K %s\n", ext, enable); ++ ++ vco = 2 * m * ext / (n+1); ++ enable = ((384000 > vco) || (768000 < vco)) ? "X" : ""; ++ dev_info(&client->dev, "VCO : %10u K %s\n", vco, enable); ++ ++ clk = vco / (p1+1) / (p2+1); ++ enable = (96000 < clk) ? "X" : ""; ++ dev_info(&client->dev, "PIXCLK : %10u K %s\n", clk, enable); ++ ++ clk = vco / (p3+1); ++ enable = (768000 < clk) ? "X" : ""; ++ dev_info(&client->dev, "MIPICLK : %10u K %s\n", clk, enable); ++ ++ clk = vco / (p6+1); ++ enable = (96000 < clk) ? "X" : ""; ++ dev_info(&client->dev, "MCU CLK : %10u K %s\n", clk, enable); ++ ++ clk = vco / (p5+1); ++ enable = (54000 < clk) ? "X" : ""; ++ dev_info(&client->dev, "SOC CLK : %10u K %s\n", clk, enable); ++ ++ clk = vco / (p4+1); ++ enable = (70000 < clk) ? "X" : ""; ++ dev_info(&client->dev, "Sensor CLK : %10u K %s\n", clk, enable); ++ ++ clk = vco / (p7+1); ++ dev_info(&client->dev, "External sensor : %10u K\n", clk); ++ ++ clk = ext / (n+1); ++ enable = ((2000 > clk) || (24000 < clk)) ? "X" : ""; ++ dev_info(&client->dev, "PFD : %10u K %s\n", clk, enable); ++ ++ return 0; ++} ++#endif ++ ++static void mt9t112_frame_check(u32 *width, u32 *height) ++{ ++ if (*width > MAX_WIDTH) ++ *width = MAX_WIDTH; ++ ++ if (*height > MAX_HEIGHT) ++ *height = MAX_HEIGHT; ++} ++ ++static int mt9t112_set_a_frame_size(const struct i2c_client *client, ++ u16 width, ++ u16 height) ++{ ++ int ret; ++ u16 wstart = (MAX_WIDTH - width) / 2; ++ u16 hstart = (MAX_HEIGHT - height) / 2; ++ ++ /* (Context A) Image Width/Height */ ++ mt9t112_mcu_write(ret, client, VAR(26, 0), width); ++ mt9t112_mcu_write(ret, client, VAR(26, 2), height); ++ ++ /* (Context A) Output Width/Height */ ++ mt9t112_mcu_write(ret, client, VAR(18, 43), 8 + width); ++ mt9t112_mcu_write(ret, client, VAR(18, 45), 8 + height); ++ ++ /* (Context A) Start Row/Column */ ++ mt9t112_mcu_write(ret, client, VAR(18, 2), 4 + hstart); ++ mt9t112_mcu_write(ret, client, VAR(18, 4), 4 + wstart); ++ ++ /* (Context A) End Row/Column */ ++ mt9t112_mcu_write(ret, client, VAR(18, 6), 11 + height + hstart); ++ mt9t112_mcu_write(ret, client, VAR(18, 8), 11 + width + wstart); ++ ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); ++ ++ return ret; ++} ++ ++static int mt9t112_set_pll_dividers(const struct i2c_client *client, ++ u8 m, u8 n, ++ u8 p1, u8 p2, u8 p3, ++ u8 p4, u8 p5, u8 p6, ++ u8 p7) ++{ ++ int ret; ++ u16 val; ++ ++ /* N/M */ ++ val = (n << 8) | ++ (m << 0); ++ mt9t112_reg_mask_set(ret, client, 0x0010, 0x3fff, val); ++ ++ /* P1/P2/P3 */ ++ val = ((p3 & 0x0F) << 8) | ++ ((p2 & 0x0F) << 4) | ++ ((p1 & 0x0F) << 0); ++ mt9t112_reg_mask_set(ret, client, 0x0012, 0x0fff, val); ++ ++ /* P4/P5/P6 */ ++ val = (0x7 << 12) | ++ ((p6 & 0x0F) << 8) | ++ ((p5 & 0x0F) << 4) | ++ ((p4 & 0x0F) << 0); ++ mt9t112_reg_mask_set(ret, client, 0x002A, 0x7fff, val); ++ ++ /* P7 */ ++ val = (0x1 << 12) | ++ ((p7 & 0x0F) << 0); ++ mt9t112_reg_mask_set(ret, client, 0x002C, 0x100f, val); ++ ++ return ret; ++} ++ ++static int mt9t112_init_pll(const struct i2c_client *client) ++{ ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ int data, i, ret; ++ ++ mt9t112_reg_mask_set(ret, client, 0x0014, 0x003, 0x0001); ++ ++ /* PLL control: BYPASS PLL = 8517 */ ++ mt9t112_reg_write(ret, client, 0x0014, 0x2145); ++ ++ /* Replace these registers when new timing parameters are generated */ ++ mt9t112_set_pll_dividers(client, ++ priv->info->divider.m, ++ priv->info->divider.n, ++ priv->info->divider.p1, ++ priv->info->divider.p2, ++ priv->info->divider.p3, ++ priv->info->divider.p4, ++ priv->info->divider.p5, ++ priv->info->divider.p6, ++ priv->info->divider.p7); ++ ++ /* ++ * TEST_BYPASS on ++ * PLL_ENABLE on ++ * SEL_LOCK_DET on ++ * TEST_BYPASS off ++ */ ++ mt9t112_reg_write(ret, client, 0x0014, 0x2525); ++ mt9t112_reg_write(ret, client, 0x0014, 0x2527); ++ mt9t112_reg_write(ret, client, 0x0014, 0x3427); ++ mt9t112_reg_write(ret, client, 0x0014, 0x3027); ++ ++ mdelay(10); ++ ++ /* ++ * PLL_BYPASS off ++ * Reference clock count ++ * I2C Master Clock Divider ++ */ ++ mt9t112_reg_write(ret, client, 0x0014, 0x3046); ++ mt9t112_reg_write(ret, client, 0x0022, 0x0190); ++ mt9t112_reg_write(ret, client, 0x3B84, 0x0212); ++ ++ /* External sensor clock is PLL bypass */ ++ mt9t112_reg_write(ret, client, 0x002E, 0x0500); ++ ++ mt9t112_reg_mask_set(ret, client, 0x0018, 0x0002, 0x0002); ++ mt9t112_reg_mask_set(ret, client, 0x3B82, 0x0004, 0x0004); ++ ++ /* MCU disabled */ ++ mt9t112_reg_mask_set(ret, client, 0x0018, 0x0004, 0x0004); ++ ++ /* out of standby */ ++ mt9t112_reg_mask_set(ret, client, 0x0018, 0x0001, 0); ++ ++ mdelay(50); ++ ++ /* ++ * Standby Workaround ++ * Disable Secondary I2C Pads ++ */ ++ mt9t112_reg_write(ret, client, 0x0614, 0x0001); ++ mdelay(1); ++ mt9t112_reg_write(ret, client, 0x0614, 0x0001); ++ mdelay(1); ++ mt9t112_reg_write(ret, client, 0x0614, 0x0001); ++ mdelay(1); ++ mt9t112_reg_write(ret, client, 0x0614, 0x0001); ++ mdelay(1); ++ mt9t112_reg_write(ret, client, 0x0614, 0x0001); ++ mdelay(1); ++ mt9t112_reg_write(ret, client, 0x0614, 0x0001); ++ mdelay(1); ++ ++ /* poll to verify out of standby. Must Poll this bit */ ++ for (i = 0; i < 100; i++) { ++ mt9t112_reg_read(data, client, 0x0018); ++ if (0x4000 & data) ++ break; ++ ++ mdelay(10); ++ } ++ ++ return ret; ++} ++ ++static int mt9t112_init_setting(const struct i2c_client *client) ++{ ++ ++ int ret; ++ ++ /* Adaptive Output Clock (A) */ ++ mt9t112_mcu_mask_set(ret, client, VAR(26, 160), 0x0040, 0x0000); ++ ++ /* Read Mode (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 12), 0x0024); ++ ++ /* Fine Correction (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 15), 0x00CC); ++ ++ /* Fine IT Min (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 17), 0x01f1); ++ ++ /* Fine IT Max Margin (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 19), 0x00fF); ++ ++ /* Base Frame Lines (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 29), 0x032D); ++ ++ /* Min Line Length (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 31), 0x073a); ++ ++ /* Line Length (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 37), 0x07d0); ++ ++ /* Adaptive Output Clock (B) */ ++ mt9t112_mcu_mask_set(ret, client, VAR(27, 160), 0x0040, 0x0000); ++ ++ /* Row Start (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 74), 0x004); ++ ++ /* Column Start (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 76), 0x004); ++ ++ /* Row End (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 78), 0x60B); ++ ++ /* Column End (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 80), 0x80B); ++ ++ /* Fine Correction (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 87), 0x008C); ++ ++ /* Fine IT Min (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 89), 0x01F1); ++ ++ /* Fine IT Max Margin (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 91), 0x00FF); ++ ++ /* Base Frame Lines (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 101), 0x0668); ++ ++ /* Min Line Length (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 103), 0x0AF0); ++ ++ /* Line Length (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 109), 0x0AF0); ++ ++ /* ++ * Flicker Dectection registers ++ * This section should be replaced whenever new Timing file is generated ++ * All the following registers need to be replaced ++ * Following registers are generated from Register Wizard but user can ++ * modify them. For detail see auto flicker detection tuning ++ */ ++ ++ /* FD_FDPERIOD_SELECT */ ++ mt9t112_mcu_write(ret, client, VAR8(8, 5), 0x01); ++ ++ /* PRI_B_CONFIG_FD_ALGO_RUN */ ++ mt9t112_mcu_write(ret, client, VAR(27, 17), 0x0003); ++ ++ /* PRI_A_CONFIG_FD_ALGO_RUN */ ++ mt9t112_mcu_write(ret, client, VAR(26, 17), 0x0003); ++ ++ /* ++ * AFD range detection tuning registers ++ */ ++ ++ /* search_f1_50 */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 165), 0x25); ++ ++ /* search_f2_50 */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 166), 0x28); ++ ++ /* search_f1_60 */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 167), 0x2C); ++ ++ /* search_f2_60 */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 168), 0x2F); ++ ++ /* period_50Hz (A) */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 68), 0xBA); ++ ++ /* secret register by aptina */ ++ /* period_50Hz (A MSB) */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 303), 0x00); ++ ++ /* period_60Hz (A) */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 69), 0x9B); ++ ++ /* secret register by aptina */ ++ /* period_60Hz (A MSB) */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 301), 0x00); ++ ++ /* period_50Hz (B) */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 140), 0x82); ++ ++ /* secret register by aptina */ ++ /* period_50Hz (B) MSB */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 304), 0x00); ++ ++ /* period_60Hz (B) */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 141), 0x6D); ++ ++ /* secret register by aptina */ ++ /* period_60Hz (B) MSB */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 302), 0x00); ++ ++ /* FD Mode */ ++ mt9t112_mcu_write(ret, client, VAR8(8, 2), 0x10); ++ ++ /* Stat_min */ ++ mt9t112_mcu_write(ret, client, VAR8(8, 9), 0x02); ++ ++ /* Stat_max */ ++ mt9t112_mcu_write(ret, client, VAR8(8, 10), 0x03); ++ ++ /* Min_amplitude */ ++ mt9t112_mcu_write(ret, client, VAR8(8, 12), 0x0A); ++ ++ /* RX FIFO Watermark (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 70), 0x0014); ++ ++ /* RX FIFO Watermark (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 142), 0x0014); ++ ++ /* MCLK: 16MHz ++ * PCLK: 73MHz ++ * CorePixCLK: 36.5 MHz ++ */ ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x0044), 133); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x0045), 110); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x008c), 130); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x008d), 108); ++ ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00A5), 27); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00a6), 30); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00a7), 32); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00a8), 35); ++ ++ return ret; ++} ++ ++static int mt9t112_auto_focus_setting(const struct i2c_client *client) ++{ ++ int ret; ++ ++ mt9t112_mcu_write(ret, client, VAR(12, 13), 0x000F); ++ mt9t112_mcu_write(ret, client, VAR(12, 23), 0x0F0F); ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); ++ ++ mt9t112_reg_write(ret, client, 0x0614, 0x0000); ++ ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x05); ++ mt9t112_mcu_write(ret, client, VAR8(12, 2), 0x02); ++ mt9t112_mcu_write(ret, client, VAR(12, 3), 0x0002); ++ mt9t112_mcu_write(ret, client, VAR(17, 3), 0x8001); ++ mt9t112_mcu_write(ret, client, VAR(17, 11), 0x0025); ++ mt9t112_mcu_write(ret, client, VAR(17, 13), 0x0193); ++ mt9t112_mcu_write(ret, client, VAR8(17, 33), 0x18); ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x05); ++ ++ return ret; ++} ++ ++static int mt9t112_auto_focus_trigger(const struct i2c_client *client) ++{ ++ int ret; ++ ++ mt9t112_mcu_write(ret, client, VAR8(12, 25), 0x01); ++ ++ return ret; ++} ++ ++static int mt9t112_init_camera(const struct i2c_client *client) ++{ ++ int ret; ++ ++ ECHECKER(ret, mt9t112_reset(client)); ++ ++ ECHECKER(ret, mt9t112_init_pll(client)); ++ ++ ECHECKER(ret, mt9t112_init_setting(client)); ++ ++ ECHECKER(ret, mt9t112_auto_focus_setting(client)); ++ ++ mt9t112_reg_mask_set(ret, client, 0x0018, 0x0004, 0); ++ ++ /* Analog setting B */ ++ mt9t112_reg_write(ret, client, 0x3084, 0x2409); ++ mt9t112_reg_write(ret, client, 0x3092, 0x0A49); ++ mt9t112_reg_write(ret, client, 0x3094, 0x4949); ++ mt9t112_reg_write(ret, client, 0x3096, 0x4950); ++ ++ /* ++ * Disable adaptive clock ++ * PRI_A_CONFIG_JPEG_OB_TX_CONTROL_VAR ++ * PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR ++ */ ++ mt9t112_mcu_write(ret, client, VAR(26, 160), 0x0A2E); ++ mt9t112_mcu_write(ret, client, VAR(27, 160), 0x0A2E); ++ ++ /* Configure STatus in Status_before_length Format and enable header */ ++ /* PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR */ ++ mt9t112_mcu_write(ret, client, VAR(27, 144), 0x0CB4); ++ ++ /* Enable JPEG in context B */ ++ /* PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR */ ++ mt9t112_mcu_write(ret, client, VAR8(27, 142), 0x01); ++ ++ /* Disable Dac_TXLO */ ++ mt9t112_reg_write(ret, client, 0x316C, 0x350F); ++ ++ /* Set max slew rates */ ++ mt9t112_reg_write(ret, client, 0x1E, 0x777); ++ ++ return ret; ++} ++ ++/************************************************************************ ++ ++ ++ soc_camera_ops ++ ++ ++************************************************************************/ ++static int mt9t112_set_bus_param(struct soc_camera_device *icd, ++ unsigned long flags) ++{ ++ return 0; ++} ++ ++static unsigned long mt9t112_query_bus_param(struct soc_camera_device *icd) ++{ ++ struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ struct soc_camera_link *icl = to_soc_camera_link(icd); ++ unsigned long flags = SOCAM_MASTER | SOCAM_VSYNC_ACTIVE_HIGH | ++ SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_HIGH; ++ ++ flags |= (priv->info->flags & MT9T112_FLAG_PCLK_RISING_EDGE) ? ++ SOCAM_PCLK_SAMPLE_RISING : SOCAM_PCLK_SAMPLE_FALLING; ++ ++ if (priv->info->flags & MT9T112_FLAG_DATAWIDTH_8) ++ flags |= SOCAM_DATAWIDTH_8; ++ else ++ flags |= SOCAM_DATAWIDTH_10; ++ ++ return soc_camera_apply_sensor_flags(icl, flags); ++} ++ ++static struct soc_camera_ops mt9t112_ops = { ++ .set_bus_param = mt9t112_set_bus_param, ++ .query_bus_param = mt9t112_query_bus_param, ++}; ++ ++/************************************************************************ ++ ++ ++ v4l2_subdev_core_ops ++ ++ ++************************************************************************/ ++static int mt9t112_g_chip_ident(struct v4l2_subdev *sd, ++ struct v4l2_dbg_chip_ident *id) ++{ ++ struct i2c_client *client = sd->priv; ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ ++ id->ident = priv->model; ++ id->revision = 0; ++ ++ return 0; ++} ++ ++#ifdef CONFIG_VIDEO_ADV_DEBUG ++static int mt9t112_g_register(struct v4l2_subdev *sd, ++ struct v4l2_dbg_register *reg) ++{ ++ struct i2c_client *client = sd->priv; ++ int ret; ++ ++ reg->size = 2; ++ mt9t112_reg_read(ret, client, reg->reg); ++ ++ reg->val = (__u64)ret; ++ ++ return 0; ++} ++ ++static int mt9t112_s_register(struct v4l2_subdev *sd, ++ struct v4l2_dbg_register *reg) ++{ ++ struct i2c_client *client = sd->priv; ++ int ret; ++ ++ mt9t112_reg_write(ret, client, reg->reg, reg->val); ++ ++ return ret; ++} ++#endif ++ ++static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = { ++ .g_chip_ident = mt9t112_g_chip_ident, ++#ifdef CONFIG_VIDEO_ADV_DEBUG ++ .g_register = mt9t112_g_register, ++ .s_register = mt9t112_s_register, ++#endif ++}; ++ ++ ++/************************************************************************ ++ ++ ++ v4l2_subdev_video_ops ++ ++ ++************************************************************************/ ++static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable) ++{ ++ struct i2c_client *client = sd->priv; ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ int ret = 0; ++ ++ if (!enable) { ++ /* FIXME ++ * ++ * If user selected large output size, ++ * and used it long time, ++ * mt9t112 camera will be very warm. ++ * ++ * But current driver can not stop mt9t112 camera. ++ * So, set small size here to solve this problem. ++ */ ++ mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT); ++ return ret; ++ } ++ ++ if (!(priv->flags & INIT_DONE)) { ++ u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE & ++ priv->info->flags) ? 0x0001 : 0x0000; ++ ++ ECHECKER(ret, mt9t112_init_camera(client)); ++ ++ /* Invert PCLK (Data sampled on falling edge of pixclk) */ ++ mt9t112_reg_write(ret, client, 0x3C20, param); ++ ++ mdelay(5); ++ ++ priv->flags |= INIT_DONE; ++ } ++ ++ mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt); ++ mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order); ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); ++ ++ mt9t112_set_a_frame_size(client, ++ priv->frame.width, ++ priv->frame.height); ++ ++ ECHECKER(ret, mt9t112_auto_focus_trigger(client)); ++ ++ dev_dbg(&client->dev, "format : %d\n", priv->format->code); ++ dev_dbg(&client->dev, "size : %d x %d\n", ++ priv->frame.width, ++ priv->frame.height); ++ ++ CLOCK_INFO(client, EXT_CLOCK); ++ ++ return ret; ++} ++ ++static int mt9t112_set_params(struct i2c_client *client, u32 width, u32 height, ++ enum v4l2_mbus_pixelcode code) ++{ ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ int i; ++ ++ priv->format = NULL; ++ ++ /* ++ * frame size check ++ */ ++ mt9t112_frame_check(&width, &height); ++ ++ /* ++ * get color format ++ */ ++ for (i = 0; i < ARRAY_SIZE(mt9t112_cfmts); i++) ++ if (mt9t112_cfmts[i].code == code) ++ break; ++ ++ if (i == ARRAY_SIZE(mt9t112_cfmts)) ++ return -EINVAL; ++ ++ priv->frame.width = (u16)width; ++ priv->frame.height = (u16)height; ++ ++ priv->format = mt9t112_cfmts + i; ++ ++ return 0; ++} ++ ++static int mt9t112_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) ++{ ++ a->bounds.left = 0; ++ a->bounds.top = 0; ++ a->bounds.width = VGA_WIDTH; ++ a->bounds.height = VGA_HEIGHT; ++ a->defrect = a->bounds; ++ a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ a->pixelaspect.numerator = 1; ++ a->pixelaspect.denominator = 1; ++ ++ return 0; ++} ++ ++static int mt9t112_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) ++{ ++ a->c.left = 0; ++ a->c.top = 0; ++ a->c.width = VGA_WIDTH; ++ a->c.height = VGA_HEIGHT; ++ a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ return 0; ++} ++ ++static int mt9t112_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) ++{ ++ struct i2c_client *client = sd->priv; ++ struct v4l2_rect *rect = &a->c; ++ ++ return mt9t112_set_params(client, rect->width, rect->height, ++ V4L2_MBUS_FMT_YUYV8_2X8_BE); ++} ++ ++static int mt9t112_g_fmt(struct v4l2_subdev *sd, ++ struct v4l2_mbus_framefmt *mf) ++{ ++ struct i2c_client *client = sd->priv; ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ ++ if (!priv->format) { ++ int ret = mt9t112_set_params(client, VGA_WIDTH, VGA_HEIGHT, ++ V4L2_MBUS_FMT_YUYV8_2X8_BE); ++ if (ret < 0) ++ return ret; ++ } ++ ++ mf->width = priv->frame.width; ++ mf->height = priv->frame.height; ++ /* TODO: set colorspace */ ++ mf->code = priv->format->code; ++ mf->field = V4L2_FIELD_NONE; ++ ++ return 0; ++} ++ ++static int mt9t112_s_fmt(struct v4l2_subdev *sd, ++ struct v4l2_mbus_framefmt *mf) ++{ ++ struct i2c_client *client = sd->priv; ++ ++ /* TODO: set colorspace */ ++ return mt9t112_set_params(client, mf->width, mf->height, mf->code); ++} ++ ++static int mt9t112_try_fmt(struct v4l2_subdev *sd, ++ struct v4l2_mbus_framefmt *mf) ++{ ++ mt9t112_frame_check(&mf->width, &mf->height); ++ ++ /* TODO: set colorspace */ ++ mf->field = V4L2_FIELD_NONE; ++ ++ return 0; ++} ++ ++static int mt9t112_enum_fmt(struct v4l2_subdev *sd, int index, ++ enum v4l2_mbus_pixelcode *code) ++{ ++ if ((unsigned int)index >= ARRAY_SIZE(mt9t112_cfmts)) ++ return -EINVAL; ++ ++ *code = mt9t112_cfmts[index].code; ++ return 0; ++} ++ ++static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = { ++ .s_stream = mt9t112_s_stream, ++ .g_mbus_fmt = mt9t112_g_fmt, ++ .s_mbus_fmt = mt9t112_s_fmt, ++ .try_mbus_fmt = mt9t112_try_fmt, ++ .cropcap = mt9t112_cropcap, ++ .g_crop = mt9t112_g_crop, ++ .s_crop = mt9t112_s_crop, ++ .enum_mbus_fmt = mt9t112_enum_fmt, ++}; ++ ++/************************************************************************ ++ ++ ++ i2c driver ++ ++ ++************************************************************************/ ++static struct v4l2_subdev_ops mt9t112_subdev_ops = { ++ .core = &mt9t112_subdev_core_ops, ++ .video = &mt9t112_subdev_video_ops, ++}; ++ ++static int mt9t112_camera_probe(struct soc_camera_device *icd, ++ struct i2c_client *client) ++{ ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ const char *devname; ++ int chipid; ++ ++ /* ++ * We must have a parent by now. And it cannot be a wrong one. ++ * So this entire test is completely redundant. ++ */ ++ if (!icd->dev.parent || ++ to_soc_camera_host(icd->dev.parent)->nr != icd->iface) ++ return -ENODEV; ++ ++ /* ++ * check and show chip ID ++ */ ++ mt9t112_reg_read(chipid, client, 0x0000); ++ ++ switch (chipid) { ++ case 0x2680: ++ devname = "mt9t111"; ++ priv->model = V4L2_IDENT_MT9T111; ++ break; ++ case 0x2682: ++ devname = "mt9t112"; ++ priv->model = V4L2_IDENT_MT9T112; ++ break; ++ default: ++ dev_err(&client->dev, "Product ID error %04x\n", chipid); ++ return -ENODEV; ++ } ++ ++ dev_info(&client->dev, "%s chip ID %04x\n", devname, chipid); ++ ++ return 0; ++} ++ ++static int mt9t112_probe(struct i2c_client *client, ++ const struct i2c_device_id *did) ++{ ++ struct mt9t112_priv *priv; ++ struct soc_camera_device *icd = client->dev.platform_data; ++ struct soc_camera_link *icl; ++ int ret; ++ ++ if (!icd) { ++ dev_err(&client->dev, "mt9t112: missing soc-camera data!\n"); ++ return -EINVAL; ++ } ++ ++ icl = to_soc_camera_link(icd); ++ if (!icl || !icl->priv) ++ return -EINVAL; ++ ++ priv = kzalloc(sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ priv->info = icl->priv; ++ ++ v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops); ++ ++ icd->ops = &mt9t112_ops; ++ ++ ret = mt9t112_camera_probe(icd, client); ++ if (ret) { ++ icd->ops = NULL; ++ i2c_set_clientdata(client, NULL); ++ kfree(priv); ++ } ++ ++ return ret; ++} ++ ++static int mt9t112_remove(struct i2c_client *client) ++{ ++ struct mt9t112_priv *priv = to_mt9t112(client); ++ struct soc_camera_device *icd = client->dev.platform_data; ++ ++ icd->ops = NULL; ++ i2c_set_clientdata(client, NULL); ++ kfree(priv); ++ return 0; ++} ++ ++static const struct i2c_device_id mt9t112_id[] = { ++ { "mt9t112", 0 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, mt9t112_id); ++ ++static struct i2c_driver mt9t112_i2c_driver = { ++ .driver = { ++ .name = "mt9t112", ++ }, ++ .probe = mt9t112_probe, ++ .remove = mt9t112_remove, ++ .id_table = mt9t112_id, ++}; ++ ++/************************************************************************ ++ ++ ++ module function ++ ++ ++************************************************************************/ ++static int __init mt9t112_module_init(void) ++{ ++ return i2c_add_driver(&mt9t112_i2c_driver); ++} ++ ++static void __exit mt9t112_module_exit(void) ++{ ++ i2c_del_driver(&mt9t112_i2c_driver); ++} ++ ++module_init(mt9t112_module_init); ++module_exit(mt9t112_module_exit); ++ ++MODULE_DESCRIPTION("SoC Camera driver for mt9t112"); ++MODULE_AUTHOR("Kuninori Morimoto"); ++MODULE_LICENSE("GPL v2"); +diff --git a/include/media/mt9t112.h b/include/media/mt9t112.h +new file mode 100644 +index 0000000..a43c74a +--- /dev/null ++++ b/include/media/mt9t112.h +@@ -0,0 +1,30 @@ ++/* mt9t112 Camera ++ * ++ * Copyright (C) 2009 Renesas Solutions Corp. ++ * Kuninori Morimoto <morimoto.kuninori@renesas.com> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#ifndef __MT9T112_H__ ++#define __MT9T112_H__ ++ ++#define MT9T112_FLAG_PCLK_RISING_EDGE (1 << 0) ++#define MT9T112_FLAG_DATAWIDTH_8 (1 << 1) /* default width is 10 */ ++ ++struct mt9t112_pll_divider { ++ u8 m, n; ++ u8 p1, p2, p3, p4, p5, p6, p7; ++}; ++ ++/* ++ * mt9t112 camera info ++ */ ++struct mt9t112_camera_info { ++ u32 flags; ++ struct mt9t112_pll_divider divider; ++}; ++ ++#endif /* __MT9T112_H__ */ +diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h +index 91942db..6cc107d 100644 +--- a/include/media/v4l2-chip-ident.h ++++ b/include/media/v4l2-chip-ident.h +@@ -267,6 +267,8 @@ enum { + V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ + V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ + V4L2_IDENT_MT9T031 = 45020, ++ V4L2_IDENT_MT9T111 = 45021, ++ V4L2_IDENT_MT9T112 = 45022, + V4L2_IDENT_MT9V111 = 45031, + V4L2_IDENT_MT9V112 = 45032, + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0050-soc-camera-mt9t112-modify-exiting-conditions-from-st.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0050-soc-camera-mt9t112-modify-exiting-conditions-from-st.patch new file mode 100644 index 00000000..551717dd --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0050-soc-camera-mt9t112-modify-exiting-conditions-from-st.patch @@ -0,0 +1,31 @@ +From eb14ff193fa8cbe52f47349c0aeca2d91ea5cfd8 Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto <morimoto.kuninori@renesas.com> +Date: Tue, 2 Feb 2010 13:17:54 +0900 +Subject: [PATCH 50/75] soc-camera: mt9t112: modify exiting conditions from standby mode + +This polling is needed if camera is in standby mode, but current exiting +condition is inverted. + +Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> +Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> +Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> +--- + drivers/media/video/mt9t112.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index fc4dd60..7438f8d 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -514,7 +514,7 @@ static int mt9t112_init_pll(const struct i2c_client *client) + /* poll to verify out of standby. Must Poll this bit */ + for (i = 0; i < 100; i++) { + mt9t112_reg_read(data, client, 0x0018); +- if (0x4000 & data) ++ if (!(0x4000 & data)) + break; + + mdelay(10); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0051-mt9t112-Migrate-from-soc_camera-to-v4l2-int-device.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0051-mt9t112-Migrate-from-soc_camera-to-v4l2-int-device.patch new file mode 100644 index 00000000..0c3b7af2 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0051-mt9t112-Migrate-from-soc_camera-to-v4l2-int-device.patch @@ -0,0 +1,934 @@ +From bd42ce1ffea1be835f54ac61bb7ea4e0cd99e7aa Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 1 Jul 2010 07:26:38 -0500 +Subject: [PATCH 51/75] mt9t112: Migrate from soc_camera to v4l2-int-device + +This is to use the driver with the old OMAP3 Camera-ISP platform. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/Kconfig | 12 +- + drivers/media/video/Makefile | 2 +- + drivers/media/video/mt9t112.c | 658 +++++++++++++++++++++++------------------ + include/media/mt9t112.h | 13 + + 4 files changed, 391 insertions(+), 294 deletions(-) + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index 7caade9..4c1fb0f 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -354,6 +354,12 @@ config VIDEO_MT9P012 + MT9P012 camera. It is currently working with the TI OMAP3 + camera controller. + ++config VIDEO_MT9T112 ++ tristate "mt9t112 support" ++ depends on I2C && VIDEO_V4L2 ++ help ++ This driver supports MT9T112 cameras from Aptina. ++ + config VIDEO_DW9710 + tristate "Lens driver for DW9710" + depends on I2C && VIDEO_V4L2 +@@ -832,12 +838,6 @@ config SOC_CAMERA_MT9T031 + help + This driver supports MT9T031 cameras from Micron. + +-config SOC_CAMERA_MT9T112 +- tristate "mt9t112 support" +- depends on SOC_CAMERA && I2C +- help +- This driver supports MT9T112 cameras from Aptina. +- + config SOC_CAMERA_MT9V022 + tristate "mt9v022 support" + depends on SOC_CAMERA && I2C +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index 61ae13f..fb7e46c 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -80,7 +80,6 @@ obj-$(CONFIG_VIDEO_MT9V113) += mt9v113.o + obj-$(CONFIG_SOC_CAMERA_MT9M001) += mt9m001.o + obj-$(CONFIG_SOC_CAMERA_MT9M111) += mt9m111.o + obj-$(CONFIG_SOC_CAMERA_MT9T031) += mt9t031.o +-obj-$(CONFIG_SOC_CAMERA_MT9T112) += mt9t112.o + obj-$(CONFIG_SOC_CAMERA_MT9V022) += mt9v022.o + obj-$(CONFIG_SOC_CAMERA_OV772X) += ov772x.o + obj-$(CONFIG_SOC_CAMERA_OV9640) += ov9640.o +@@ -129,6 +128,7 @@ obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o + obj-y += isp/ + obj-$(CONFIG_VIDEO_OMAP3) += omap34xxcam.o + obj-$(CONFIG_VIDEO_MT9P012) += mt9p012.o ++obj-$(CONFIG_VIDEO_MT9T112) += mt9t112.o + obj-$(CONFIG_VIDEO_DW9710) += dw9710.o + obj-$(CONFIG_VIDEO_TPS61059) += tps61059.o + obj-$(CONFIG_VIDEO_OV3640) += ov3640.o +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 7438f8d..6f54394 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -25,10 +25,8 @@ + #include <linux/videodev2.h> + + #include <media/mt9t112.h> +-#include <media/soc_camera.h> +-#include <media/soc_mediabus.h> ++#include <media/v4l2-int-device.h> + #include <media/v4l2-chip-ident.h> +-#include <media/v4l2-common.h> + + /* you can check PLL/clock info */ + /* #define EXT_CLOCK 24000000 */ +@@ -43,8 +41,8 @@ + /* + * frame size + */ +-#define MAX_WIDTH 2048 +-#define MAX_HEIGHT 1536 ++#define MAX_WIDTH 640 /* 2048 */ ++#define MAX_HEIGHT 480 /* 1536 */ + + #define VGA_WIDTH 640 + #define VGA_HEIGHT 480 +@@ -91,20 +89,12 @@ struct mt9t112_frame_size { + u16 height; + }; + +-struct mt9t112_format { +- enum v4l2_mbus_pixelcode code; +- enum v4l2_colorspace colorspace; +- u16 fmt; +- u16 order; +-}; +- + struct mt9t112_priv { +- struct v4l2_subdev subdev; ++ struct mt9t112_platform_data *pdata; ++ struct v4l2_int_device *v4l2_int_device; + struct mt9t112_camera_info *info; + struct i2c_client *client; +- struct soc_camera_device icd; +- struct mt9t112_frame_size frame; +- const struct mt9t112_format *format; ++ struct v4l2_pix_format pix; + int model; + u32 flags; + /* for flags */ +@@ -119,38 +109,42 @@ struct mt9t112_priv { + + ************************************************************************/ + +-static const struct mt9t112_format mt9t112_cfmts[] = { ++const static struct v4l2_fmtdesc mt9t112_formats[] = { ++ { ++ .description = "YUYV (YUV 4:2:2), packed", ++ .pixelformat = V4L2_PIX_FMT_YUYV, ++ }, + { +- .code = V4L2_MBUS_FMT_YUYV8_2X8_BE, +- .colorspace = V4L2_COLORSPACE_JPEG, +- .fmt = 1, +- .order = 0, +- }, { +- .code = V4L2_MBUS_FMT_YVYU8_2X8_BE, +- .colorspace = V4L2_COLORSPACE_JPEG, +- .fmt = 1, +- .order = 1, +- }, { +- .code = V4L2_MBUS_FMT_YUYV8_2X8_LE, +- .colorspace = V4L2_COLORSPACE_JPEG, +- .fmt = 1, +- .order = 2, +- }, { +- .code = V4L2_MBUS_FMT_YVYU8_2X8_LE, +- .colorspace = V4L2_COLORSPACE_JPEG, +- .fmt = 1, +- .order = 3, +- }, { +- .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, +- .colorspace = V4L2_COLORSPACE_SRGB, +- .fmt = 8, +- .order = 2, +- }, { +- .code = V4L2_MBUS_FMT_RGB565_2X8_LE, +- .colorspace = V4L2_COLORSPACE_SRGB, +- .fmt = 4, +- .order = 2, ++ .description = "RGB555, le", ++ .pixelformat = V4L2_PIX_FMT_RGB555, + }, ++ { ++ .description = "RGB565, le", ++ .pixelformat = V4L2_PIX_FMT_RGB565, ++ }, ++}; ++ ++/************************************************************************ ++ ++ ++ supported sizes ++ ++ ++************************************************************************/ ++const static struct mt9t112_frame_size mt9t112_sizes[] = { ++ { 640, 480 }, ++ /* { 2048, 1536} */ ++}; ++ ++/************************************************************************ ++ ++ ++ supported sizes ++ ++ ++************************************************************************/ ++const struct v4l2_fract mt9t112_frameintervals[] = { ++ { .numerator = 1, .denominator = 10 } + }; + + /************************************************************************ +@@ -160,11 +154,32 @@ static const struct mt9t112_format mt9t112_cfmts[] = { + + + ************************************************************************/ +-static struct mt9t112_priv *to_mt9t112(const struct i2c_client *client) ++static u16 mt9t112_pixfmt_to_fmt(u32 pixelformat) + { +- return container_of(i2c_get_clientdata(client), +- struct mt9t112_priv, +- subdev); ++ switch (pixelformat) { ++ case V4L2_PIX_FMT_RGB555: ++ return 8; ++ case V4L2_PIX_FMT_RGB565: ++ return 4; ++ case V4L2_PIX_FMT_YUYV: ++ /* FALLTHROUGH */ ++ default: ++ return 1; ++ } ++} ++ ++static u16 mt9t112_pixfmt_to_order(u32 pixelformat) ++{ ++ switch (pixelformat) { ++ case V4L2_PIX_FMT_RGB555: ++ /* FALLTHROUGH */ ++ case V4L2_PIX_FMT_RGB565: ++ return 2; ++ case V4L2_PIX_FMT_YUYV: ++ /* FALLTHROUGH */ ++ default: ++ return 0; ++ } + } + + static int __mt9t112_reg_read(const struct i2c_client *client, u16 command) +@@ -438,7 +453,7 @@ static int mt9t112_set_pll_dividers(const struct i2c_client *client, + + static int mt9t112_init_pll(const struct i2c_client *client) + { +- struct mt9t112_priv *priv = to_mt9t112(client); ++ struct mt9t112_priv *priv = i2c_get_clientdata(client); + int data, i, ret; + + mt9t112_reg_mask_set(ret, client, 0x0014, 0x003, 0x0001); +@@ -757,167 +772,12 @@ static int mt9t112_init_camera(const struct i2c_client *client) + return ret; + } + +-/************************************************************************ +- +- +- soc_camera_ops +- +- +-************************************************************************/ +-static int mt9t112_set_bus_param(struct soc_camera_device *icd, +- unsigned long flags) +-{ +- return 0; +-} +- +-static unsigned long mt9t112_query_bus_param(struct soc_camera_device *icd) +-{ +- struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); +- struct mt9t112_priv *priv = to_mt9t112(client); +- struct soc_camera_link *icl = to_soc_camera_link(icd); +- unsigned long flags = SOCAM_MASTER | SOCAM_VSYNC_ACTIVE_HIGH | +- SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_HIGH; +- +- flags |= (priv->info->flags & MT9T112_FLAG_PCLK_RISING_EDGE) ? +- SOCAM_PCLK_SAMPLE_RISING : SOCAM_PCLK_SAMPLE_FALLING; +- +- if (priv->info->flags & MT9T112_FLAG_DATAWIDTH_8) +- flags |= SOCAM_DATAWIDTH_8; +- else +- flags |= SOCAM_DATAWIDTH_10; +- +- return soc_camera_apply_sensor_flags(icl, flags); +-} +- +-static struct soc_camera_ops mt9t112_ops = { +- .set_bus_param = mt9t112_set_bus_param, +- .query_bus_param = mt9t112_query_bus_param, +-}; +- +-/************************************************************************ +- +- +- v4l2_subdev_core_ops +- +- +-************************************************************************/ +-static int mt9t112_g_chip_ident(struct v4l2_subdev *sd, +- struct v4l2_dbg_chip_ident *id) +-{ +- struct i2c_client *client = sd->priv; +- struct mt9t112_priv *priv = to_mt9t112(client); +- +- id->ident = priv->model; +- id->revision = 0; +- +- return 0; +-} +- +-#ifdef CONFIG_VIDEO_ADV_DEBUG +-static int mt9t112_g_register(struct v4l2_subdev *sd, +- struct v4l2_dbg_register *reg) +-{ +- struct i2c_client *client = sd->priv; +- int ret; +- +- reg->size = 2; +- mt9t112_reg_read(ret, client, reg->reg); +- +- reg->val = (__u64)ret; +- +- return 0; +-} +- +-static int mt9t112_s_register(struct v4l2_subdev *sd, +- struct v4l2_dbg_register *reg) +-{ +- struct i2c_client *client = sd->priv; +- int ret; +- +- mt9t112_reg_write(ret, client, reg->reg, reg->val); +- +- return ret; +-} +-#endif +- +-static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = { +- .g_chip_ident = mt9t112_g_chip_ident, +-#ifdef CONFIG_VIDEO_ADV_DEBUG +- .g_register = mt9t112_g_register, +- .s_register = mt9t112_s_register, +-#endif +-}; +- +- +-/************************************************************************ +- +- +- v4l2_subdev_video_ops +- +- +-************************************************************************/ +-static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable) +-{ +- struct i2c_client *client = sd->priv; +- struct mt9t112_priv *priv = to_mt9t112(client); +- int ret = 0; +- +- if (!enable) { +- /* FIXME +- * +- * If user selected large output size, +- * and used it long time, +- * mt9t112 camera will be very warm. +- * +- * But current driver can not stop mt9t112 camera. +- * So, set small size here to solve this problem. +- */ +- mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT); +- return ret; +- } +- +- if (!(priv->flags & INIT_DONE)) { +- u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE & +- priv->info->flags) ? 0x0001 : 0x0000; +- +- ECHECKER(ret, mt9t112_init_camera(client)); +- +- /* Invert PCLK (Data sampled on falling edge of pixclk) */ +- mt9t112_reg_write(ret, client, 0x3C20, param); +- +- mdelay(5); +- +- priv->flags |= INIT_DONE; +- } +- +- mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt); +- mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order); +- mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); +- +- mt9t112_set_a_frame_size(client, +- priv->frame.width, +- priv->frame.height); +- +- ECHECKER(ret, mt9t112_auto_focus_trigger(client)); +- +- dev_dbg(&client->dev, "format : %d\n", priv->format->code); +- dev_dbg(&client->dev, "size : %d x %d\n", +- priv->frame.width, +- priv->frame.height); +- +- CLOCK_INFO(client, EXT_CLOCK); +- +- return ret; +-} +- + static int mt9t112_set_params(struct i2c_client *client, u32 width, u32 height, +- enum v4l2_mbus_pixelcode code) ++ u32 pixelformat) + { +- struct mt9t112_priv *priv = to_mt9t112(client); ++ struct mt9t112_priv *priv = i2c_get_clientdata(client); + int i; + +- priv->format = NULL; +- + /* + * frame size check + */ +@@ -926,22 +786,23 @@ static int mt9t112_set_params(struct i2c_client *client, u32 width, u32 height, + /* + * get color format + */ +- for (i = 0; i < ARRAY_SIZE(mt9t112_cfmts); i++) +- if (mt9t112_cfmts[i].code == code) ++ for (i = 0; i < ARRAY_SIZE(mt9t112_formats); i++) ++ if (mt9t112_formats[i].pixelformat == pixelformat) + break; + +- if (i == ARRAY_SIZE(mt9t112_cfmts)) ++ if (i == ARRAY_SIZE(mt9t112_formats)) + return -EINVAL; + +- priv->frame.width = (u16)width; +- priv->frame.height = (u16)height; ++ priv->pix.width = (u16)width; ++ priv->pix.height = (u16)height; + +- priv->format = mt9t112_cfmts + i; ++ priv->pix.pixelformat = pixelformat; + + return 0; + } + +-static int mt9t112_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) ++static int mt9t112_v4l2_int_cropcap(struct v4l2_int_device *s, ++ struct v4l2_cropcap *a) + { + a->bounds.left = 0; + a->bounds.top = 0; +@@ -955,7 +816,8 @@ static int mt9t112_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) + return 0; + } + +-static int mt9t112_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) ++static int mt9t112_v4l2_int_g_crop(struct v4l2_int_device *s, ++ struct v4l2_crop *a) + { + a->c.left = 0; + a->c.top = 0; +@@ -966,77 +828,116 @@ static int mt9t112_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) + return 0; + } + +-static int mt9t112_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) ++static int mt9t112_v4l2_int_s_crop(struct v4l2_int_device *s, ++ struct v4l2_crop *a) + { +- struct i2c_client *client = sd->priv; +- struct v4l2_rect *rect = &a->c; +- +- return mt9t112_set_params(client, rect->width, rect->height, +- V4L2_MBUS_FMT_YUYV8_2X8_BE); ++ if ((a->c.left != 0) || ++ (a->c.top != 0) || ++ (a->c.width != VGA_WIDTH) || ++ (a->c.height != VGA_HEIGHT)) { ++ return -EINVAL; ++ } ++ return 0; + } + +-static int mt9t112_g_fmt(struct v4l2_subdev *sd, +- struct v4l2_mbus_framefmt *mf) ++static int mt9t112_v4l2_int_g_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) + { +- struct i2c_client *client = sd->priv; +- struct mt9t112_priv *priv = to_mt9t112(client); ++ struct mt9t112_priv *priv = s->priv; ++ struct i2c_client *client = priv->client; + +- if (!priv->format) { ++ if ((priv->pix.pixelformat == 0) || ++ (priv->pix.width == 0) || ++ (priv->pix.height == 0)) { + int ret = mt9t112_set_params(client, VGA_WIDTH, VGA_HEIGHT, +- V4L2_MBUS_FMT_YUYV8_2X8_BE); ++ V4L2_PIX_FMT_YUYV); + if (ret < 0) + return ret; + } + +- mf->width = priv->frame.width; +- mf->height = priv->frame.height; ++ f->fmt.pix.width = priv->pix.width; ++ f->fmt.pix.height = priv->pix.height; + /* TODO: set colorspace */ +- mf->code = priv->format->code; +- mf->field = V4L2_FIELD_NONE; ++ f->fmt.pix.pixelformat = priv->pix.pixelformat; ++ f->fmt.pix.field = V4L2_FIELD_NONE; + + return 0; + } + +-static int mt9t112_s_fmt(struct v4l2_subdev *sd, +- struct v4l2_mbus_framefmt *mf) ++ ++static int mt9t112_v4l2_int_s_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) + { +- struct i2c_client *client = sd->priv; ++ struct mt9t112_priv *priv = s->priv; ++ struct i2c_client *client = priv->client; + + /* TODO: set colorspace */ +- return mt9t112_set_params(client, mf->width, mf->height, mf->code); ++ return mt9t112_set_params(client, f->fmt.pix.width, f->fmt.pix.height, ++ f->fmt.pix.pixelformat); + } + +-static int mt9t112_try_fmt(struct v4l2_subdev *sd, +- struct v4l2_mbus_framefmt *mf) ++static int mt9t112_v4l2_int_try_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) + { +- mt9t112_frame_check(&mf->width, &mf->height); ++ mt9t112_frame_check(&f->fmt.pix.width, &f->fmt.pix.height); + + /* TODO: set colorspace */ +- mf->field = V4L2_FIELD_NONE; ++ f->fmt.pix.field = V4L2_FIELD_NONE; + + return 0; + } + +-static int mt9t112_enum_fmt(struct v4l2_subdev *sd, int index, +- enum v4l2_mbus_pixelcode *code) ++static int mt9t112_v4l2_int_enum_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_fmtdesc *fmt) + { +- if ((unsigned int)index >= ARRAY_SIZE(mt9t112_cfmts)) ++ int index = fmt->index; ++ enum v4l2_buf_type type = fmt->type; ++ ++ memset(fmt, 0, sizeof(*fmt)); ++ fmt->index = index; ++ fmt->type = type; ++ ++ switch (fmt->type) { ++ case V4L2_BUF_TYPE_VIDEO_CAPTURE: ++ if (index >= ARRAY_SIZE(mt9t112_formats)) ++ return -EINVAL; ++ break; ++ default: + return -EINVAL; ++ } + +- *code = mt9t112_cfmts[index].code; ++ fmt->flags = mt9t112_formats[index].flags; ++ strlcpy(fmt->description, mt9t112_formats[index].description, ++ sizeof(fmt->description)); ++ fmt->pixelformat = mt9t112_formats[index].pixelformat; + return 0; + } + +-static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = { +- .s_stream = mt9t112_s_stream, +- .g_mbus_fmt = mt9t112_g_fmt, +- .s_mbus_fmt = mt9t112_s_fmt, +- .try_mbus_fmt = mt9t112_try_fmt, +- .cropcap = mt9t112_cropcap, +- .g_crop = mt9t112_g_crop, +- .s_crop = mt9t112_s_crop, +- .enum_mbus_fmt = mt9t112_enum_fmt, +-}; ++static int mt9t112_v4l2_int_s_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ /* TODO: set paramters */ ++ return 0; ++} ++ ++static int mt9t112_v4l2_int_g_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ struct v4l2_captureparm *cparm = &a->parm.capture; ++ ++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; ++ ++ memset(a, 0, sizeof(*a)); ++ a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ cparm->capability = V4L2_CAP_TIMEPERFRAME; ++ /* FIXME: Is 10 fps really the only option? */ ++ cparm->timeperframe.numerator = 1; ++ cparm->timeperframe.denominator = 10; ++ ++ return 0; ++} + + /************************************************************************ + +@@ -1045,27 +946,14 @@ static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = { + + + ************************************************************************/ +-static struct v4l2_subdev_ops mt9t112_subdev_ops = { +- .core = &mt9t112_subdev_core_ops, +- .video = &mt9t112_subdev_video_ops, +-}; + +-static int mt9t112_camera_probe(struct soc_camera_device *icd, +- struct i2c_client *client) ++static int mt9t112_detect(struct i2c_client *client) + { +- struct mt9t112_priv *priv = to_mt9t112(client); ++ struct mt9t112_priv *priv = i2c_get_clientdata(client); + const char *devname; + int chipid; + + /* +- * We must have a parent by now. And it cannot be a wrong one. +- * So this entire test is completely redundant. +- */ +- if (!icd->dev.parent || +- to_soc_camera_host(icd->dev.parent)->nr != icd->iface) +- return -ENODEV; +- +- /* + * check and show chip ID + */ + mt9t112_reg_read(chipid, client, 0x0000); +@@ -1089,37 +977,232 @@ static int mt9t112_camera_probe(struct soc_camera_device *icd, + return 0; + } + ++static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, ++ enum v4l2_power power) ++{ ++ struct mt9t112_priv *priv = s->priv; ++ struct i2c_client *client = priv->client; ++ int ret; ++ ++ switch (power) { ++ case V4L2_POWER_STANDBY: ++ /* FALLTHROUGH */ ++ case V4L2_POWER_OFF: ++ /* FIXME ++ * ++ * If user selected large output size, ++ * and used it long time, ++ * mt9t112 camera will be very warm. ++ * ++ * But current driver can not stop mt9t112 camera. ++ * So, set small size here to solve this problem. ++ */ ++ mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT); ++ ++ ret = priv->pdata->power_set(s, power); ++ if (ret < 0) { ++ dev_err(&client->dev, "Unable to set target board power " ++ "state (OFF/STANDBY)\n"); ++ return ret; ++ } ++ break; ++ case V4L2_POWER_ON: ++ ret = priv->pdata->power_set(s, power); ++ if (ret < 0) { ++ dev_err(&client->dev, "Unable to set target board power " ++ "state (ON)\n"); ++ return ret; ++ } ++ if (!(priv->flags & INIT_DONE)) { ++ u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE & ++ priv->info->flags) ? 0x0001 : 0x0000; ++ ++ ECHECKER(ret, mt9t112_detect(client)); ++ ECHECKER(ret, mt9t112_init_camera(client)); ++ ++ /* Invert PCLK (Data sampled on falling edge of pixclk) */ ++ mt9t112_reg_write(ret, client, 0x3C20, param); ++ ++ mdelay(5); ++ ++ priv->flags |= INIT_DONE; ++ } ++ ++ mt9t112_mcu_write(ret, client, VAR(26, 7), ++ mt9t112_pixfmt_to_fmt(priv->pix.pixelformat)); ++ mt9t112_mcu_write(ret, client, VAR(26, 9), ++ mt9t112_pixfmt_to_order(priv->pix.pixelformat)); ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); ++ ++ mt9t112_set_a_frame_size(client, ++ priv->pix.width, ++ priv->pix.height); ++ ++ ECHECKER(ret, mt9t112_auto_focus_trigger(client)); ++ ++ dev_dbg(&client->dev, "format : %d\n", priv->pix.pixelformat); ++ dev_dbg(&client->dev, "size : %d x %d\n", ++ priv->pix.width, ++ priv->pix.height); ++ ++ CLOCK_INFO(client, EXT_CLOCK); ++ } ++ return 0; ++} ++ ++static int mt9t112_v4l2_int_g_priv(struct v4l2_int_device *s, void *p) ++{ ++ struct mt9t112_priv *priv = s->priv; ++ ++ return priv->pdata->priv_data_set(p); ++} ++ ++static int mt9t112_v4l2_int_g_ifparm(struct v4l2_int_device *s, ++ struct v4l2_ifparm *p) ++{ ++ struct mt9t112_priv *priv = s->priv; ++ int rval; ++ ++ if (p == NULL) ++ return -EINVAL; ++ ++ if (!priv->pdata->ifparm) ++ return -EINVAL; ++ ++ rval = priv->pdata->ifparm(p); ++ if (rval) { ++ v4l_err(priv->client, "g_ifparm.Err[%d]\n", rval); ++ return rval; ++ } ++ ++ p->u.ycbcr.clock_curr = 40 * 1000000; /* temporal value */ ++ ++ return 0; ++} ++ ++static int mt9t112_v4l2_int_enum_framesizes(struct v4l2_int_device *s, ++ struct v4l2_frmsizeenum *frms) ++{ ++ int ifmt; ++ ++ for (ifmt = 0; ifmt < ARRAY_SIZE(mt9t112_formats); ifmt++) ++ if (mt9t112_formats[ifmt].pixelformat == frms->pixel_format) ++ break; ++ ++ if (ifmt == ARRAY_SIZE(mt9t112_formats)) ++ return -EINVAL; ++ ++ /* Do we already reached all discrete framesizes? */ ++ if (frms->index >= ARRAY_SIZE(mt9t112_sizes)) ++ return -EINVAL; ++ ++ frms->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frms->discrete.width = mt9t112_sizes[frms->index].width; ++ frms->discrete.height = mt9t112_sizes[frms->index].height; ++ ++ return 0; ++ ++} ++ ++static int mt9t112_v4l2_int_enum_frameintervals(struct v4l2_int_device *s, ++ struct v4l2_frmivalenum *frmi) ++{ ++ int ifmt; ++ ++ for (ifmt = 0; ifmt < ARRAY_SIZE(mt9t112_formats); ifmt++) ++ if (mt9t112_formats[ifmt].pixelformat == frmi->pixel_format) ++ break; ++ ++ if (ifmt == ARRAY_SIZE(mt9t112_formats)) ++ return -EINVAL; ++ ++ if (frmi->index >= ARRAY_SIZE(mt9t112_frameintervals)) ++ return -EINVAL; ++ ++ frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frmi->discrete.numerator = ++ mt9t112_frameintervals[frmi->index].numerator; ++ frmi->discrete.denominator = ++ mt9t112_frameintervals[frmi->index].denominator; ++ return 0; ++} ++ ++static struct v4l2_int_ioctl_desc mt9t112_ioctl_desc[] = { ++ { .num = vidioc_int_enum_framesizes_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_enum_framesizes }, ++ { .num = vidioc_int_enum_frameintervals_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_enum_frameintervals }, ++ { .num = vidioc_int_s_power_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_s_power }, ++ { .num = vidioc_int_g_priv_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_g_priv }, ++ { .num = vidioc_int_g_ifparm_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_g_ifparm }, ++ { .num = vidioc_int_enum_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_enum_fmt_cap }, ++ { .num = vidioc_int_try_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_try_fmt_cap }, ++ { .num = vidioc_int_g_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_g_fmt_cap }, ++ { .num = vidioc_int_s_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_s_fmt_cap }, ++ { .num = vidioc_int_g_parm_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_g_parm }, ++ { .num = vidioc_int_s_parm_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_s_parm }, ++ { .num = vidioc_int_cropcap_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_cropcap }, ++ { .num = vidioc_int_g_crop_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_g_crop }, ++ { .num = vidioc_int_s_crop_num, ++ .func = (v4l2_int_ioctl_func *)mt9t112_v4l2_int_s_crop }, ++}; ++ ++static struct v4l2_int_slave mt9t112_slave = { ++ .ioctls = mt9t112_ioctl_desc, ++ .num_ioctls = ARRAY_SIZE(mt9t112_ioctl_desc), ++}; ++ + static int mt9t112_probe(struct i2c_client *client, + const struct i2c_device_id *did) + { + struct mt9t112_priv *priv; +- struct soc_camera_device *icd = client->dev.platform_data; +- struct soc_camera_link *icl; ++ struct v4l2_int_device *v4l2_int_device; + int ret; + +- if (!icd) { +- dev_err(&client->dev, "mt9t112: missing soc-camera data!\n"); +- return -EINVAL; ++ if (!client->dev.platform_data) { ++ dev_err(&client->dev, "no platform data?\n"); ++ return -ENODEV; + } + +- icl = to_soc_camera_link(icd); +- if (!icl || !icl->priv) +- return -EINVAL; +- + priv = kzalloc(sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + +- priv->info = icl->priv; ++ v4l2_int_device = kzalloc(sizeof(*v4l2_int_device), GFP_KERNEL); ++ if (!v4l2_int_device) { ++ kfree(priv); ++ return -ENOMEM; ++ } + +- v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops); ++ v4l2_int_device->module = THIS_MODULE; ++ strncpy(v4l2_int_device->name, "mt9t112", sizeof(v4l2_int_device->name)); ++ v4l2_int_device->type = v4l2_int_type_slave; ++ v4l2_int_device->u.slave = &mt9t112_slave; ++ v4l2_int_device->priv = priv; + +- icd->ops = &mt9t112_ops; ++ priv->v4l2_int_device = v4l2_int_device; ++ priv->client = client; ++ priv->pdata = client->dev.platform_data; + +- ret = mt9t112_camera_probe(icd, client); ++ i2c_set_clientdata(client, priv); ++ ++ //ret = mt9t112_detect(client); ++ ++ ret = v4l2_int_device_register(priv->v4l2_int_device); + if (ret) { +- icd->ops = NULL; + i2c_set_clientdata(client, NULL); ++ kfree(v4l2_int_device); + kfree(priv); + } + +@@ -1128,11 +1211,12 @@ static int mt9t112_probe(struct i2c_client *client, + + static int mt9t112_remove(struct i2c_client *client) + { +- struct mt9t112_priv *priv = to_mt9t112(client); +- struct soc_camera_device *icd = client->dev.platform_data; ++ struct mt9t112_priv *priv = i2c_get_clientdata(client); + +- icd->ops = NULL; ++ v4l2_int_device_unregister(priv->v4l2_int_device); + i2c_set_clientdata(client, NULL); ++ ++ kfree(priv->v4l2_int_device); + kfree(priv); + return 0; + } +@@ -1172,6 +1256,6 @@ static void __exit mt9t112_module_exit(void) + module_init(mt9t112_module_init); + module_exit(mt9t112_module_exit); + +-MODULE_DESCRIPTION("SoC Camera driver for mt9t112"); ++MODULE_DESCRIPTION("mt9t112 sensor driver"); + MODULE_AUTHOR("Kuninori Morimoto"); + MODULE_LICENSE("GPL v2"); +diff --git a/include/media/mt9t112.h b/include/media/mt9t112.h +index a43c74a..62caaf5 100644 +--- a/include/media/mt9t112.h ++++ b/include/media/mt9t112.h +@@ -11,6 +11,8 @@ + #ifndef __MT9T112_H__ + #define __MT9T112_H__ + ++#include <media/v4l2-int-device.h> ++ + #define MT9T112_FLAG_PCLK_RISING_EDGE (1 << 0) + #define MT9T112_FLAG_DATAWIDTH_8 (1 << 1) /* default width is 10 */ + +@@ -27,4 +29,15 @@ struct mt9t112_camera_info { + struct mt9t112_pll_divider divider; + }; + ++struct mt9t112_platform_data { ++ char *master; ++ int (*power_set) (struct v4l2_int_device *s, enum v4l2_power on); ++ int (*ifparm) (struct v4l2_ifparm *p); ++ int (*priv_data_set) (void *); ++ /* Interface control params */ ++ bool clk_polarity; ++ bool hs_polarity; ++ bool vs_polarity; ++}; ++ + #endif /* __MT9T112_H__ */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0052-mt9t112-Add-more-info-to-public-header.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0052-mt9t112-Add-more-info-to-public-header.patch new file mode 100644 index 00000000..3aeea03a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0052-mt9t112-Add-more-info-to-public-header.patch @@ -0,0 +1,29 @@ +From d72241c7dc39f0976bcd7d05d43a86935e0deb68 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 1 Jul 2010 07:33:49 -0500 +Subject: [PATCH 52/75] mt9t112: Add more info to public header + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + include/media/mt9t112.h | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/include/media/mt9t112.h b/include/media/mt9t112.h +index 62caaf5..49fa042 100644 +--- a/include/media/mt9t112.h ++++ b/include/media/mt9t112.h +@@ -13,6 +13,11 @@ + + #include <media/v4l2-int-device.h> + ++#define MT9T112_I2C_ADDR (0x78 >> 1) ++ ++#define MT9T112_CLK_MAX (54000000) /* 54MHz */ ++#define MT9T112_CLK_MIN (6000000) /* 6Mhz */ ++ + #define MT9T112_FLAG_PCLK_RISING_EDGE (1 << 0) + #define MT9T112_FLAG_DATAWIDTH_8 (1 << 1) /* default width is 10 */ + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0053-mt9t112-Fix-null-pointer-kernel-bug.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0053-mt9t112-Fix-null-pointer-kernel-bug.patch new file mode 100644 index 00000000..d03795f5 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0053-mt9t112-Fix-null-pointer-kernel-bug.patch @@ -0,0 +1,84 @@ +From 0f6b697fb422f8eb8df539f82df49f0f6f976bc3 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 1 Jul 2010 09:12:37 -0500 +Subject: [PATCH 53/75] mt9t112: Fix null pointer kernel bug + +We were trying to access a null pointer (info) which we weren't +initializing anywhere. + +Fix this. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 34 +++++++++++++++++++++++----------- + 1 files changed, 23 insertions(+), 11 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 6f54394..98a4ea9 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -92,7 +92,7 @@ struct mt9t112_frame_size { + struct mt9t112_priv { + struct mt9t112_platform_data *pdata; + struct v4l2_int_device *v4l2_int_device; +- struct mt9t112_camera_info *info; ++ struct mt9t112_camera_info info; + struct i2c_client *client; + struct v4l2_pix_format pix; + int model; +@@ -463,15 +463,15 @@ static int mt9t112_init_pll(const struct i2c_client *client) + + /* Replace these registers when new timing parameters are generated */ + mt9t112_set_pll_dividers(client, +- priv->info->divider.m, +- priv->info->divider.n, +- priv->info->divider.p1, +- priv->info->divider.p2, +- priv->info->divider.p3, +- priv->info->divider.p4, +- priv->info->divider.p5, +- priv->info->divider.p6, +- priv->info->divider.p7); ++ priv->info.divider.m, ++ priv->info.divider.n, ++ priv->info.divider.p1, ++ priv->info.divider.p2, ++ priv->info.divider.p3, ++ priv->info.divider.p4, ++ priv->info.divider.p5, ++ priv->info.divider.p6, ++ priv->info.divider.p7); + + /* + * TEST_BYPASS on +@@ -1015,7 +1015,7 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + } + if (!(priv->flags & INIT_DONE)) { + u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE & +- priv->info->flags) ? 0x0001 : 0x0000; ++ priv->info.flags) ? 0x0001 : 0x0000; + + ECHECKER(ret, mt9t112_detect(client)); + ECHECKER(ret, mt9t112_init_camera(client)); +@@ -1195,6 +1195,18 @@ static int mt9t112_probe(struct i2c_client *client, + priv->client = client; + priv->pdata = client->dev.platform_data; + ++ /* Revisit: Init Sensor info settings */ ++ priv->info.divider.m = 25; ++ priv->info.divider.n = 2; ++ priv->info.divider.p1 = 0; ++ priv->info.divider.p2 = 9; ++ priv->info.divider.p3 = 0; ++ priv->info.divider.p4 = 13; ++ priv->info.divider.p5 = 13; ++ priv->info.divider.p6 = 9; ++ priv->info.divider.p7 = 0; ++ priv->info.flags = MT9T112_FLAG_PCLK_RISING_EDGE; ++ + i2c_set_clientdata(client, priv); + + //ret = mt9t112_detect(client); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0054-DEBUG-omap3beagle-Add-MT9T112-to-defconfig.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0054-DEBUG-omap3beagle-Add-MT9T112-to-defconfig.patch new file mode 100644 index 00000000..e5ae822d --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0054-DEBUG-omap3beagle-Add-MT9T112-to-defconfig.patch @@ -0,0 +1,26 @@ +From f66312bff0655778847882a26dfb14a54e9b92ca Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 00:55:43 -0500 +Subject: [PATCH 54/75] DEBUG: omap3beagle: Add MT9T112 to defconfig + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/configs/omap3_beagle_cam_defconfig | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/configs/omap3_beagle_cam_defconfig b/arch/arm/configs/omap3_beagle_cam_defconfig +index 0ea8300..80b64db 100644 +--- a/arch/arm/configs/omap3_beagle_cam_defconfig ++++ b/arch/arm/configs/omap3_beagle_cam_defconfig +@@ -1737,7 +1737,7 @@ CONFIG_VIDEO_WM8775=m + CONFIG_VIDEO_MT9V011=m + # CONFIG_VIDEO_TCM825X is not set + CONFIG_VIDEO_MT9P012=m +-CONFIG_VIDEO_MT9T111=y ++CONFIG_VIDEO_MT9T112=y + # CONFIG_VIDEO_DW9710 is not set + # CONFIG_VIDEO_OV3640 is not set + # CONFIG_VIDEO_IMX046 is not set +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0055-omap3beagle-camera-Change-MT9T111-references-to-new-.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0055-omap3beagle-camera-Change-MT9T111-references-to-new-.patch new file mode 100644 index 00000000..1a58dea8 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0055-omap3beagle-camera-Change-MT9T111-references-to-new-.patch @@ -0,0 +1,207 @@ +From fad06fbbfb3e25683672d41c3f5649500d5eda73 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 15:47:23 -0500 +Subject: [PATCH 55/75] omap3beagle: camera: Change MT9T111 references to new MT9T112 driver + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 52 ++++++++++++------------ + arch/arm/mach-omap2/board-omap3beagle.c | 12 +++--- + 2 files changed, 32 insertions(+), 32 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 2e49158..0b4dff7 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -203,29 +203,29 @@ struct mt9v113_platform_data mt9v113_pdata = { + + #endif /* #ifdef CONFIG_VIDEO_MT9V113 */ + +-#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) +-#include <media/mt9t111.h> ++#if defined(CONFIG_VIDEO_MT9T112) || defined(CONFIG_VIDEO_MT9T112_MODULE) ++#include <media/mt9t112.h> + +-#define ISP_MT9T111_MCLK 216000000 ++#define ISP_MT9T112_MCLK 216000000 + + /* Arbitrary memory handling limit */ +-#define MT9T111_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN((2048 * 2) * 1536 * 4) ++#define MT9T112_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN((2048 * 2) * 1536 * 4) + +-static struct isp_interface_config mt9t111_if_config = { ++static struct isp_interface_config mt9t112_if_config = { + .ccdc_par_ser = ISP_PARLL, + .dataline_shift = 0x2, + .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE, + .strobe = 0x0, + .prestrobe = 0x0, + .shutter = 0x0, +- .cam_mclk = ISP_MT9T111_MCLK, ++ .cam_mclk = ISP_MT9T112_MCLK, + .wenlog = ISPCCDC_CFG_WENLOG_AND, + .wait_hs_vs = 2, + .u.par.par_bridge = 0x3, + .u.par.par_clk_pol = 0x0, + }; + +-static struct v4l2_ifparm mt9t111_ifparm_s = { ++static struct v4l2_ifparm mt9t112_ifparm_s = { + .if_type = V4L2_IF_TYPE_RAW, + .u = { + .raw = { +@@ -235,47 +235,47 @@ static struct v4l2_ifparm mt9t111_ifparm_s = { + .latch_clk_inv = 0, + .nobt_hs_inv = 0, /* active high */ + .nobt_vs_inv = 0, /* active high */ +- .clock_min = MT9T111_CLK_MIN, +- .clock_max = MT9T111_CLK_MAX, ++ .clock_min = MT9T112_CLK_MIN, ++ .clock_max = MT9T112_CLK_MAX, + }, + }, + }; + + /** +- * @brief mt9t111_ifparm - Returns the mt9t111 interface parameters ++ * @brief mt9t112_ifparm - Returns the mt9t112 interface parameters + * + * @param p - pointer to v4l2_ifparm structure + * + * @return result of operation - 0 is success + */ +-static int mt9t111_ifparm(struct v4l2_ifparm *p) ++static int mt9t112_ifparm(struct v4l2_ifparm *p) + { + if (p == NULL) + return -EINVAL; + +- *p = mt9t111_ifparm_s; ++ *p = mt9t112_ifparm_s; + return 0; + } + + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +-static struct omap34xxcam_hw_config mt9t111_hwc = { ++static struct omap34xxcam_hw_config mt9t112_hwc = { + .dev_index = 0, + .dev_minor = 0, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, + .u.sensor.sensor_isp = 0, +- .u.sensor.capture_mem = MT9T111_BIGGEST_FRAME_BYTE_SIZE, ++ .u.sensor.capture_mem = MT9T112_BIGGEST_FRAME_BYTE_SIZE, + .u.sensor.ival_default = { 1, 10 }, + }; + #endif + + /** +- * @brief mt9t111_set_prv_data - Returns mt9t111 omap34xx driver private data ++ * @brief mt9t112_set_prv_data - Returns mt9t112 omap34xx driver private data + * + * @param priv - pointer to omap34xxcam_hw_config structure + * + * @return result of operation - 0 is success + */ +-static int mt9t111_set_prv_data(void *priv) ++static int mt9t112_set_prv_data(void *priv) + { + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + struct omap34xxcam_hw_config *hwc = priv; +@@ -283,7 +283,7 @@ static int mt9t111_set_prv_data(void *priv) + if (priv == NULL) + return -EINVAL; + +- *hwc = mt9t111_hwc; ++ *hwc = mt9t112_hwc; + return 0; + #else + return -EINVAL; +@@ -291,13 +291,13 @@ static int mt9t111_set_prv_data(void *priv) + } + + /** +- * @brief mt9t111_power_set - Power-on or power-off TVP5146 device ++ * @brief mt9t112_power_set - Power-on or power-off TVP5146 device + * + * @param power - enum, Power on/off, resume/standby + * + * @return result of operation - 0 is success + */ +-static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) ++static int mt9t112_power_set(struct v4l2_int_device *s, enum v4l2_power power) + { + struct omap34xxcam_videodev *vdev = s->u.slave->master->priv; + +@@ -314,7 +314,7 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + + case V4L2_POWER_ON: + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +- isp_configure_interface(vdev->cam->isp, &mt9t111_if_config); ++ isp_configure_interface(vdev->cam->isp, &mt9t112_if_config); + #endif + + /* Set RESET_BAR to 0 */ +@@ -331,7 +331,7 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + mdelay(50); + + /* Enable EXTCLK */ +- isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); ++ isp_set_xclk(vdev->cam->isp, MT9T112_CLK_MIN, CAM_USE_XCLKA); + + /* + * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): +@@ -359,14 +359,14 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) + return 0; + } + +-struct mt9t111_platform_data mt9t111_pdata = { ++struct mt9t112_platform_data mt9t112_pdata = { + .master = "omap34xxcam", +- .power_set = mt9t111_power_set, +- .priv_data_set = mt9t111_set_prv_data, +- .ifparm = mt9t111_ifparm, ++ .power_set = mt9t112_power_set, ++ .priv_data_set = mt9t112_set_prv_data, ++ .ifparm = mt9t112_ifparm, + }; + +-#endif /* #ifdef CONFIG_VIDEO_MT9T111 */ ++#endif /* #ifdef CONFIG_VIDEO_MT9T112 */ + + static int beagle_cam_probe(struct platform_device *pdev) + { +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 0e7e8b2..7c9e40a 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -77,10 +77,10 @@ static struct omap_opp * _omap37x_l3_rate_table = NULL; + extern struct mt9v113_platform_data mt9v113_pdata; + #endif + +-#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++#if defined(CONFIG_VIDEO_MT9T112) || defined(CONFIG_VIDEO_MT9T112_MODULE) + #include <media/v4l2-int-device.h> +-#include <media/mt9t111.h> +-extern struct mt9t111_platform_data mt9t111_pdata; ++#include <media/mt9t112.h> ++extern struct mt9t112_platform_data mt9t112_pdata; + #endif + + #define GPMC_CS0_BASE 0x60 +@@ -602,10 +602,10 @@ static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { + .platform_data = &mt9v113_pdata, + }, + #endif +-#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE) ++#if defined(CONFIG_VIDEO_MT9T112) || defined(CONFIG_VIDEO_MT9T112_MODULE) + { +- I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR), +- .platform_data = &mt9t111_pdata, ++ I2C_BOARD_INFO("mt9t112", MT9T112_I2C_ADDR), ++ .platform_data = &mt9t112_pdata, + }, + #endif + }; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0056-omap34xxcam-Fix-multi-pixel-format-negotiation.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0056-omap34xxcam-Fix-multi-pixel-format-negotiation.patch new file mode 100644 index 00000000..9c041c75 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0056-omap34xxcam-Fix-multi-pixel-format-negotiation.patch @@ -0,0 +1,26 @@ +From 13238be1e612ab4113413cf21e83307ea9e18f1e Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 1 Jul 2010 13:57:26 -0500 +Subject: [PATCH 56/75] omap34xxcam: Fix multi pixel format negotiation + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/omap34xxcam.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/media/video/omap34xxcam.c b/drivers/media/video/omap34xxcam.c +index 2e8153b..051c6a7 100644 +--- a/drivers/media/video/omap34xxcam.c ++++ b/drivers/media/video/omap34xxcam.c +@@ -544,7 +544,7 @@ static int try_pix_parm(struct omap34xxcam_videodev *vdev, + pix_tmp_out.height = pix_tmp_in.height; + rval = isp_try_fmt_cap(isp, &pix_tmp_in, &pix_tmp_out); + if (rval) +- return rval; ++ break; + + dev_dbg(&vdev->vfd->dev, "this w %d\th %d\tfmt %8.8x\t" + "-> w %d\th %d\t fmt %8.8x" +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0057-SQUASH-omap3beagle-camera-Bring-back-mt9t111-support.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0057-SQUASH-omap3beagle-camera-Bring-back-mt9t111-support.patch new file mode 100644 index 00000000..4ee6758c --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0057-SQUASH-omap3beagle-camera-Bring-back-mt9t111-support.patch @@ -0,0 +1,43 @@ +From 535b7f5333636f7e42f6bea67ed9f298afe0fe3c Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 17:53:07 -0500 +Subject: [PATCH 57/75] SQUASH: omap3beagle: camera: Bring back mt9t111 support + +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 0b4dff7..3118026 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -221,14 +221,14 @@ static struct isp_interface_config mt9t112_if_config = { + .cam_mclk = ISP_MT9T112_MCLK, + .wenlog = ISPCCDC_CFG_WENLOG_AND, + .wait_hs_vs = 2, +- .u.par.par_bridge = 0x3, ++ .u.par.par_bridge = 0x2, + .u.par.par_clk_pol = 0x0, + }; + + static struct v4l2_ifparm mt9t112_ifparm_s = { +- .if_type = V4L2_IF_TYPE_RAW, ++ .if_type = V4L2_IF_TYPE_YCbCr, + .u = { +- .raw = { ++ .ycbcr = { + .frame_start_on_rising_vs = 1, + .bt_sync_correct = 0, + .swap = 0, +@@ -262,7 +262,7 @@ static struct omap34xxcam_hw_config mt9t112_hwc = { + .dev_index = 0, + .dev_minor = 0, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, +- .u.sensor.sensor_isp = 0, ++ .u.sensor.sensor_isp = 1, + .u.sensor.capture_mem = MT9T112_BIGGEST_FRAME_BYTE_SIZE, + .u.sensor.ival_default = { 1, 10 }, + }; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0058-mt9t112-Do-init_camera-every-powerup.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0058-mt9t112-Do-init_camera-every-powerup.patch new file mode 100644 index 00000000..66c4e173 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0058-mt9t112-Do-init_camera-every-powerup.patch @@ -0,0 +1,57 @@ +From 52bfcc9b6bcb30cf81589c483f1344c568be7300 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 17:53:44 -0500 +Subject: [PATCH 58/75] mt9t112: Do init_camera every powerup + +This is because we want to ensure we always come from a known state. + +Probably this could be revisited later for optimization. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 17 ++++++++--------- + 1 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 98a4ea9..eebc2b5 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -982,6 +982,8 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + { + struct mt9t112_priv *priv = s->priv; + struct i2c_client *client = priv->client; ++ u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE & ++ priv->info.flags) ? 0x0001 : 0x0000; + int ret; + + switch (power) { +@@ -1014,20 +1016,17 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + return ret; + } + if (!(priv->flags & INIT_DONE)) { +- u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE & +- priv->info.flags) ? 0x0001 : 0x0000; +- + ECHECKER(ret, mt9t112_detect(client)); +- ECHECKER(ret, mt9t112_init_camera(client)); +- +- /* Invert PCLK (Data sampled on falling edge of pixclk) */ +- mt9t112_reg_write(ret, client, 0x3C20, param); +- +- mdelay(5); + + priv->flags |= INIT_DONE; + } + ++ ECHECKER(ret, mt9t112_init_camera(client)); ++ ++ /* Invert PCLK (Data sampled on falling edge of pixclk) */ ++ mt9t112_reg_write(ret, client, 0x3C20, param); ++ ++ mdelay(5); + mt9t112_mcu_write(ret, client, VAR(26, 7), + mt9t112_pixfmt_to_fmt(priv->pix.pixelformat)); + mt9t112_mcu_write(ret, client, VAR(26, 9), +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0059-omap3beagle-camera-Switch-flag-for-no-sensor-ISP.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0059-omap3beagle-camera-Switch-flag-for-no-sensor-ISP.patch new file mode 100644 index 00000000..9c856742 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0059-omap3beagle-camera-Switch-flag-for-no-sensor-ISP.patch @@ -0,0 +1,26 @@ +From 1865b5a5f27a7de1e12d52a096e435e5dd177a48 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 18:15:32 -0500 +Subject: [PATCH 59/75] omap3beagle: camera: Switch flag for no sensor ISP + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 3118026..75622bf 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -262,7 +262,7 @@ static struct omap34xxcam_hw_config mt9t112_hwc = { + .dev_index = 0, + .dev_minor = 0, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, +- .u.sensor.sensor_isp = 1, ++ .u.sensor.sensor_isp = 0, + .u.sensor.capture_mem = MT9T112_BIGGEST_FRAME_BYTE_SIZE, + .u.sensor.ival_default = { 1, 10 }, + }; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0060-mt9t112-Add-back-3MP-basesize.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0060-mt9t112-Add-back-3MP-basesize.patch new file mode 100644 index 00000000..32b825bf --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0060-mt9t112-Add-back-3MP-basesize.patch @@ -0,0 +1,37 @@ +From 9cfb19dd4093463361f279276e67d2c61e0f7d5e Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 18:33:00 -0500 +Subject: [PATCH 60/75] mt9t112: Add back 3MP basesize + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index eebc2b5..46d1bd6 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -41,8 +41,8 @@ + /* + * frame size + */ +-#define MAX_WIDTH 640 /* 2048 */ +-#define MAX_HEIGHT 480 /* 1536 */ ++#define MAX_WIDTH 2048 ++#define MAX_HEIGHT 1536 + + #define VGA_WIDTH 640 + #define VGA_HEIGHT 480 +@@ -133,7 +133,7 @@ const static struct v4l2_fmtdesc mt9t112_formats[] = { + ************************************************************************/ + const static struct mt9t112_frame_size mt9t112_sizes[] = { + { 640, 480 }, +- /* { 2048, 1536} */ ++ { 2048, 1536} + }; + + /************************************************************************ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0061-mt9t112-Prepare-for-24MHz-EXTCLK-and-30-fps.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0061-mt9t112-Prepare-for-24MHz-EXTCLK-and-30-fps.patch new file mode 100644 index 00000000..af30cb73 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0061-mt9t112-Prepare-for-24MHz-EXTCLK-and-30-fps.patch @@ -0,0 +1,63 @@ +From 8da9ec7ae90f238bd9b245bc80a1c6559df61f59 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 23:41:32 -0500 +Subject: [PATCH 61/75] mt9t112: Prepare for 24MHz EXTCLK and 30 fps + +Set Aptina recommended values to get 30 FPS with VGA, which +are achievable given the new PLL divider settings, considering +an input of 24MHz in the master clock. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 18 +++++++++--------- + 1 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 46d1bd6..44234e4 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -144,7 +144,7 @@ const static struct mt9t112_frame_size mt9t112_sizes[] = { + + ************************************************************************/ + const struct v4l2_fract mt9t112_frameintervals[] = { +- { .numerator = 1, .denominator = 10 } ++ { .numerator = 1, .denominator = 30 } + }; + + /************************************************************************ +@@ -932,9 +932,9 @@ static int mt9t112_v4l2_int_g_parm(struct v4l2_int_device *s, + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + cparm->capability = V4L2_CAP_TIMEPERFRAME; +- /* FIXME: Is 10 fps really the only option? */ ++ /* FIXME: Is 30 fps really the only option? */ + cparm->timeperframe.numerator = 1; +- cparm->timeperframe.denominator = 10; ++ cparm->timeperframe.denominator = 30; + + return 0; + } +@@ -1195,14 +1195,14 @@ static int mt9t112_probe(struct i2c_client *client, + priv->pdata = client->dev.platform_data; + + /* Revisit: Init Sensor info settings */ +- priv->info.divider.m = 25; +- priv->info.divider.n = 2; ++ priv->info.divider.m = 24; ++ priv->info.divider.n = 1; + priv->info.divider.p1 = 0; +- priv->info.divider.p2 = 9; ++ priv->info.divider.p2 = 8; + priv->info.divider.p3 = 0; +- priv->info.divider.p4 = 13; +- priv->info.divider.p5 = 13; +- priv->info.divider.p6 = 9; ++ priv->info.divider.p4 = 11; ++ priv->info.divider.p5 = 11; ++ priv->info.divider.p6 = 8; + priv->info.divider.p7 = 0; + priv->info.flags = MT9T112_FLAG_PCLK_RISING_EDGE; + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0062-omap3beagle-camera-Prepare-24MHz-xclk-for-mt9t112.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0062-omap3beagle-camera-Prepare-24MHz-xclk-for-mt9t112.patch new file mode 100644 index 00000000..2550430c --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0062-omap3beagle-camera-Prepare-24MHz-xclk-for-mt9t112.patch @@ -0,0 +1,62 @@ +From b00bc4caeb798661983eca4f548f0f69301bfb32 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 15 Jul 2010 23:43:20 -0500 +Subject: [PATCH 62/75] omap3beagle: camera: Prepare 24MHz xclk for mt9t112 + +Adjust calculations of timings based on # of EXTCLK cycles. + +Also, set default requested framerate to 30 fps. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 16 ++++++++-------- + 1 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 75622bf..520e1d8 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -264,7 +264,7 @@ static struct omap34xxcam_hw_config mt9t112_hwc = { + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, + .u.sensor.sensor_isp = 0, + .u.sensor.capture_mem = MT9T112_BIGGEST_FRAME_BYTE_SIZE, +- .u.sensor.ival_default = { 1, 10 }, ++ .u.sensor.ival_default = { 1, 30 }, + }; + #endif + +@@ -331,24 +331,24 @@ static int mt9t112_power_set(struct v4l2_int_device *s, enum v4l2_power power) + mdelay(50); + + /* Enable EXTCLK */ +- isp_set_xclk(vdev->cam->isp, MT9T112_CLK_MIN, CAM_USE_XCLKA); ++ isp_set_xclk(vdev->cam->isp, 24000000, CAM_USE_XCLKA); + + /* +- * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): +- * ((1000000 * 70) / 6000000) = aprox 12 us. ++ * Wait at least 70 CLK cycles (w/EXTCLK = 24MHz): ++ * ((1000000 * 70) / 24000000) = aprox 2.91 us. + */ + +- udelay(12); ++ udelay(3); + + /* Set RESET_BAR to 1 */ + gpio_set_value(LEOPARD_RESET_GPIO, 1); + + /* +- * Wait at least 100 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): +- * ((1000000 * 100) / 6000000) = aprox 17 us. ++ * Wait at least 100 CLK cycles (w/EXTCLK = 24MHz): ++ * ((1000000 * 100) / 24000000) = aprox 4.16 us. + */ + +- udelay(17); ++ udelay(5); + + break; + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0063-mt9t112-Correct-register-settings-for-mt9t111-sensor.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0063-mt9t112-Correct-register-settings-for-mt9t111-sensor.patch new file mode 100644 index 00000000..7f5261fb --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0063-mt9t112-Correct-register-settings-for-mt9t111-sensor.patch @@ -0,0 +1,109 @@ +From fa6380a53783b185189c372dd5e9d17f46c5c4d7 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 16 Jul 2010 07:52:06 -0500 +Subject: [PATCH 63/75] mt9t112: Correct register settings for mt9t111 sensor + +This now matches with Aptina's recommended values. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 46 ++++++++++++++++++++++++++++------------ + 1 files changed, 32 insertions(+), 14 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 44234e4..ac295dd 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -44,6 +44,9 @@ + #define MAX_WIDTH 2048 + #define MAX_HEIGHT 1536 + ++#define MAX_WIDTH_PREV 1024 ++#define MAX_HEIGHT_PREV 768 ++ + #define VGA_WIDTH 640 + #define VGA_HEIGHT 480 + +@@ -392,24 +395,39 @@ static int mt9t112_set_a_frame_size(const struct i2c_client *client, + u16 height) + { + int ret; +- u16 wstart = (MAX_WIDTH - width) / 2; +- u16 hstart = (MAX_HEIGHT - height) / 2; ++ u16 wstart, hstart, wend, hend; ++ u16 max_width = MAX_WIDTH_PREV, max_height = MAX_HEIGHT_PREV; ++ ++ if ((width > max_width) || (height > max_height)) { ++ /* Capture case */ ++ max_width = MAX_WIDTH; ++ max_height = MAX_HEIGHT; ++ hstart = 4; ++ wstart = 4; ++ hend = 1547; ++ wend = 2059; ++ } else { ++ hstart = 0; ++ wstart = 0; ++ hend = 1549; ++ wend = 2061; ++ } + + /* (Context A) Image Width/Height */ + mt9t112_mcu_write(ret, client, VAR(26, 0), width); + mt9t112_mcu_write(ret, client, VAR(26, 2), height); + + /* (Context A) Output Width/Height */ +- mt9t112_mcu_write(ret, client, VAR(18, 43), 8 + width); +- mt9t112_mcu_write(ret, client, VAR(18, 45), 8 + height); ++ mt9t112_mcu_write(ret, client, VAR(18, 43), 8 + max_width); ++ mt9t112_mcu_write(ret, client, VAR(18, 45), 8 + max_height); + + /* (Context A) Start Row/Column */ +- mt9t112_mcu_write(ret, client, VAR(18, 2), 4 + hstart); +- mt9t112_mcu_write(ret, client, VAR(18, 4), 4 + wstart); ++ mt9t112_mcu_write(ret, client, VAR(18, 2), hstart); ++ mt9t112_mcu_write(ret, client, VAR(18, 4), wstart); + + /* (Context A) End Row/Column */ +- mt9t112_mcu_write(ret, client, VAR(18, 6), 11 + height + hstart); +- mt9t112_mcu_write(ret, client, VAR(18, 8), 11 + width + wstart); ++ mt9t112_mcu_write(ret, client, VAR(18, 6), hend); ++ mt9t112_mcu_write(ret, client, VAR(18, 8), wend); + + mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); + +@@ -547,25 +565,25 @@ static int mt9t112_init_setting(const struct i2c_client *client) + mt9t112_mcu_mask_set(ret, client, VAR(26, 160), 0x0040, 0x0000); + + /* Read Mode (A) */ +- mt9t112_mcu_write(ret, client, VAR(18, 12), 0x0024); ++ mt9t112_mcu_write(ret, client, VAR(18, 12), 0x046C); + + /* Fine Correction (A) */ + mt9t112_mcu_write(ret, client, VAR(18, 15), 0x00CC); + + /* Fine IT Min (A) */ +- mt9t112_mcu_write(ret, client, VAR(18, 17), 0x01f1); ++ mt9t112_mcu_write(ret, client, VAR(18, 17), 0x0381); + + /* Fine IT Max Margin (A) */ +- mt9t112_mcu_write(ret, client, VAR(18, 19), 0x00fF); ++ mt9t112_mcu_write(ret, client, VAR(18, 19), 0x024F); + + /* Base Frame Lines (A) */ +- mt9t112_mcu_write(ret, client, VAR(18, 29), 0x032D); ++ mt9t112_mcu_write(ret, client, VAR(18, 29), 0x0378); + + /* Min Line Length (A) */ +- mt9t112_mcu_write(ret, client, VAR(18, 31), 0x073a); ++ mt9t112_mcu_write(ret, client, VAR(18, 31), 0x05D0); + + /* Line Length (A) */ +- mt9t112_mcu_write(ret, client, VAR(18, 37), 0x07d0); ++ mt9t112_mcu_write(ret, client, VAR(18, 37), 0x07AC); + + /* Adaptive Output Clock (B) */ + mt9t112_mcu_mask_set(ret, client, VAR(27, 160), 0x0040, 0x0000); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch new file mode 100644 index 00000000..b3506dc2 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch @@ -0,0 +1,188 @@ +From 2c8e7e157de32ebc5c8d60bf642c2f29f607c3d0 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Fri, 16 Jul 2010 17:09:10 -0500 +Subject: [PATCH 64/75] mt9t112: Remove "smart" size selection + +This code is broken, as it doesn't really adjust all other +settings, but output size to desired size. It isn't really +toggling everything that needs, and giving the false impression +of good size flexibility. + +So, meanwhile, let's put fixed init settings for the contexts, +and toggle between them (implemented in other patch). + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 105 ++++++++++++++++------------------------- + 1 files changed, 41 insertions(+), 64 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index ac295dd..ee991ef 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -390,50 +390,6 @@ static void mt9t112_frame_check(u32 *width, u32 *height) + *height = MAX_HEIGHT; + } + +-static int mt9t112_set_a_frame_size(const struct i2c_client *client, +- u16 width, +- u16 height) +-{ +- int ret; +- u16 wstart, hstart, wend, hend; +- u16 max_width = MAX_WIDTH_PREV, max_height = MAX_HEIGHT_PREV; +- +- if ((width > max_width) || (height > max_height)) { +- /* Capture case */ +- max_width = MAX_WIDTH; +- max_height = MAX_HEIGHT; +- hstart = 4; +- wstart = 4; +- hend = 1547; +- wend = 2059; +- } else { +- hstart = 0; +- wstart = 0; +- hend = 1549; +- wend = 2061; +- } +- +- /* (Context A) Image Width/Height */ +- mt9t112_mcu_write(ret, client, VAR(26, 0), width); +- mt9t112_mcu_write(ret, client, VAR(26, 2), height); +- +- /* (Context A) Output Width/Height */ +- mt9t112_mcu_write(ret, client, VAR(18, 43), 8 + max_width); +- mt9t112_mcu_write(ret, client, VAR(18, 45), 8 + max_height); +- +- /* (Context A) Start Row/Column */ +- mt9t112_mcu_write(ret, client, VAR(18, 2), hstart); +- mt9t112_mcu_write(ret, client, VAR(18, 4), wstart); +- +- /* (Context A) End Row/Column */ +- mt9t112_mcu_write(ret, client, VAR(18, 6), hend); +- mt9t112_mcu_write(ret, client, VAR(18, 8), wend); +- +- mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); +- +- return ret; +-} +- + static int mt9t112_set_pll_dividers(const struct i2c_client *client, + u8 m, u8 n, + u8 p1, u8 p2, u8 p3, +@@ -561,9 +517,27 @@ static int mt9t112_init_setting(const struct i2c_client *client) + + int ret; + ++ /* Output Width (A) */ ++ mt9t112_mcu_write(ret, client, VAR(26, 0), 640); ++ ++ /* Output Height (A) */ ++ mt9t112_mcu_write(ret, client, VAR(26, 2), 480); ++ + /* Adaptive Output Clock (A) */ + mt9t112_mcu_mask_set(ret, client, VAR(26, 160), 0x0040, 0x0000); + ++ /* Row Start (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 2), 0); ++ ++ /* Column Start (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 4), 0); ++ ++ /* Row End (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 6), 1549); ++ ++ /* Column End (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 8), 2061); ++ + /* Read Mode (A) */ + mt9t112_mcu_write(ret, client, VAR(18, 12), 0x046C); + +@@ -585,6 +559,18 @@ static int mt9t112_init_setting(const struct i2c_client *client) + /* Line Length (A) */ + mt9t112_mcu_write(ret, client, VAR(18, 37), 0x07AC); + ++ /* Context Width (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 43), 8 + 1024); ++ ++ /* Context Height (A) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 45), 8 + 768); ++ ++ /* Output Width (B) */ ++ mt9t112_mcu_write(ret, client, VAR(27, 0), 2048); ++ ++ /* Output Hieght (B) */ ++ mt9t112_mcu_write(ret, client, VAR(27, 2), 1536); ++ + /* Adaptive Output Clock (B) */ + mt9t112_mcu_mask_set(ret, client, VAR(27, 160), 0x0040, 0x0000); + +@@ -610,13 +596,19 @@ static int mt9t112_init_setting(const struct i2c_client *client) + mt9t112_mcu_write(ret, client, VAR(18, 91), 0x00FF); + + /* Base Frame Lines (B) */ +- mt9t112_mcu_write(ret, client, VAR(18, 101), 0x0668); ++ mt9t112_mcu_write(ret, client, VAR(18, 101), 0x066C); + + /* Min Line Length (B) */ +- mt9t112_mcu_write(ret, client, VAR(18, 103), 0x0AF0); ++ mt9t112_mcu_write(ret, client, VAR(18, 103), 0x0378); + + /* Line Length (B) */ +- mt9t112_mcu_write(ret, client, VAR(18, 109), 0x0AF0); ++ mt9t112_mcu_write(ret, client, VAR(18, 109), 0x0CB1); ++ ++ /* Context Width (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 115), 8 + 2048); ++ ++ /* Context Height (B) */ ++ mt9t112_mcu_write(ret, client, VAR(18, 117), 8 + 1536); + + /* + * Flicker Dectection registers +@@ -692,10 +684,10 @@ static int mt9t112_init_setting(const struct i2c_client *client) + mt9t112_mcu_write(ret, client, VAR8(8, 12), 0x0A); + + /* RX FIFO Watermark (A) */ +- mt9t112_mcu_write(ret, client, VAR(18, 70), 0x0014); ++ mt9t112_mcu_write(ret, client, VAR(18, 70), 0x0080); + + /* RX FIFO Watermark (B) */ +- mt9t112_mcu_write(ret, client, VAR(18, 142), 0x0014); ++ mt9t112_mcu_write(ret, client, VAR(18, 142), 0x0080); + + /* MCLK: 16MHz + * PCLK: 73MHz +@@ -1008,17 +1000,6 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + case V4L2_POWER_STANDBY: + /* FALLTHROUGH */ + case V4L2_POWER_OFF: +- /* FIXME +- * +- * If user selected large output size, +- * and used it long time, +- * mt9t112 camera will be very warm. +- * +- * But current driver can not stop mt9t112 camera. +- * So, set small size here to solve this problem. +- */ +- mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT); +- + ret = priv->pdata->power_set(s, power); + if (ret < 0) { + dev_err(&client->dev, "Unable to set target board power " +@@ -1051,10 +1032,6 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + mt9t112_pixfmt_to_order(priv->pix.pixelformat)); + mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); + +- mt9t112_set_a_frame_size(client, +- priv->pix.width, +- priv->pix.height); +- + ECHECKER(ret, mt9t112_auto_focus_trigger(client)); + + dev_dbg(&client->dev, "format : %d\n", priv->pix.pixelformat); +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0065-rtl8192su-remove-bogus-Kconfig-depend-on-PCI-and-add.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0065-rtl8192su-remove-bogus-Kconfig-depend-on-PCI-and-add.patch new file mode 100644 index 00000000..72697f74 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0065-rtl8192su-remove-bogus-Kconfig-depend-on-PCI-and-add.patch @@ -0,0 +1,38 @@ +From 132469e10e712ff4b386fb78a4c78343f151ebc4 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Sun, 18 Jul 2010 11:25:12 +0200 +Subject: [PATCH 65/75] rtl8192su: remove bogus Kconfig depend on PCI and add another product ID + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + drivers/staging/rtl8192su/Kconfig | 2 +- + drivers/staging/rtl8192su/r8192U_core.c | 1 + + 2 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/drivers/staging/rtl8192su/Kconfig b/drivers/staging/rtl8192su/Kconfig +index 123fa6d..9888927 100644 +--- a/drivers/staging/rtl8192su/Kconfig ++++ b/drivers/staging/rtl8192su/Kconfig +@@ -1,6 +1,6 @@ + config RTL8192SU + tristate "RealTek RTL8192SU Wireless LAN NIC driver" +- depends on PCI && WLAN && USB ++ depends on WLAN && USB + depends on WIRELESS_EXT + default N + ---help--- +diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c +index 66274d7..48e4c29 100644 +--- a/drivers/staging/rtl8192su/r8192U_core.c ++++ b/drivers/staging/rtl8192su/r8192U_core.c +@@ -112,6 +112,7 @@ u32 rt_global_debug_component = \ + + static struct usb_device_id rtl8192_usb_id_tbl[] = { + /* Realtek */ ++ {USB_DEVICE(0x0bda, 0x8171)}, + {USB_DEVICE(0x0bda, 0x8192)}, + {USB_DEVICE(0x0bda, 0x8709)}, + /* Corega */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0066-mt9t112-Add-Context-selection-to-configuration.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0066-mt9t112-Add-Context-selection-to-configuration.patch new file mode 100644 index 00000000..0afb340d --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0066-mt9t112-Add-Context-selection-to-configuration.patch @@ -0,0 +1,96 @@ +From a1066fd19c56f96201b877b394247db9c41c3c18 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Sun, 18 Jul 2010 01:12:41 -0500 +Subject: [PATCH 66/75] mt9t112: Add Context selection to configuration + +Thsi makes always start at least with preview mode +(context A), and then, if needed, transition to capture +mode (context B) + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 54 +++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 54 insertions(+), 0 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index ee991ef..ec7514f 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -73,6 +73,9 @@ + #define mt9t112_reg_read(ret, client, a) \ + ECHECKER(ret, __mt9t112_reg_read(client, a)) + ++#define mt9t112_mcu_read(ret, client, a) \ ++ ECHECKER(ret, __mt9t112_mcu_read(client, a)) ++ + /* + * Logical address + */ +@@ -737,6 +740,50 @@ static int mt9t112_auto_focus_trigger(const struct i2c_client *client) + return ret; + } + ++static int mt9t112_goto_preview(const struct i2c_client *client) ++{ ++ int ret, trycount = 0; ++ ++ /* Is it already in preview mode? */ ++ mt9t112_mcu_read(ret, client, VAR8(1, 1)); ++ if (ret == 0x3) ++ return 0; ++ ++ /* Go to preview mode */ ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 1); ++ do { ++ mt9t112_mcu_read(ret, client, VAR8(1, 1)); ++ mdelay(1); ++ } while ((ret != 0x3) && (++trycount < 100)); ++ ++ if (trycount >= 100) ++ return -EBUSY; ++ ++ return 0; ++} ++ ++static int mt9t112_goto_capture(const struct i2c_client *client) ++{ ++ int ret, trycount = 0; ++ ++ /* Is it already in capture mode? */ ++ mt9t112_mcu_read(ret, client, VAR8(1, 1)); ++ if (ret == 0x7) ++ return 0; ++ ++ /* Go to capture mode */ ++ mt9t112_mcu_write(ret, client, VAR8(1, 0), 2); ++ do { ++ mt9t112_mcu_read(ret, client, VAR8(1, 1)); ++ mdelay(1); ++ } while ((ret != 0x7) && (++trycount < 100)); ++ ++ if (trycount >= 100) ++ return -EBUSY; ++ ++ return 0; ++} ++ + static int mt9t112_init_camera(const struct i2c_client *client) + { + int ret; +@@ -1034,6 +1081,13 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + + ECHECKER(ret, mt9t112_auto_focus_trigger(client)); + ++ ECHECKER(ret, mt9t112_goto_preview(client)); ++ ++ if ((priv->pix.width == MAX_WIDTH) && ++ (priv->pix.height == MAX_HEIGHT)) { ++ ECHECKER(ret, mt9t112_goto_capture(client)); ++ } ++ + dev_dbg(&client->dev, "format : %d\n", priv->pix.pixelformat); + dev_dbg(&client->dev, "size : %d x %d\n", + priv->pix.width, +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0067-mt9t112-Disable-JPEG-in-Context-B.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0067-mt9t112-Disable-JPEG-in-Context-B.patch new file mode 100644 index 00000000..954e0761 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0067-mt9t112-Disable-JPEG-in-Context-B.patch @@ -0,0 +1,32 @@ +From b1196ec5f007cef5cd3342ed3dbf3415bf721bd4 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Sun, 18 Jul 2010 01:45:29 -0500 +Subject: [PATCH 67/75] mt9t112: Disable JPEG in Context B + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 8 -------- + 1 files changed, 0 insertions(+), 8 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index ec7514f..18d7ce5 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -812,14 +812,6 @@ static int mt9t112_init_camera(const struct i2c_client *client) + mt9t112_mcu_write(ret, client, VAR(26, 160), 0x0A2E); + mt9t112_mcu_write(ret, client, VAR(27, 160), 0x0A2E); + +- /* Configure STatus in Status_before_length Format and enable header */ +- /* PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR */ +- mt9t112_mcu_write(ret, client, VAR(27, 144), 0x0CB4); +- +- /* Enable JPEG in context B */ +- /* PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR */ +- mt9t112_mcu_write(ret, client, VAR8(27, 142), 0x01); +- + /* Disable Dac_TXLO */ + mt9t112_reg_write(ret, client, 0x316C, 0x350F); + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0068-mt9t112-Make-context-B-stream-unlimited-frames.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0068-mt9t112-Make-context-B-stream-unlimited-frames.patch new file mode 100644 index 00000000..6025dc29 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0068-mt9t112-Make-context-B-stream-unlimited-frames.patch @@ -0,0 +1,30 @@ +From 362f211f85aa5e0f7519fca599428e03b05cb05f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Sun, 18 Jul 2010 01:47:41 -0500 +Subject: [PATCH 68/75] mt9t112: Make context B stream unlimited frames + +Context A does this by default, so, only context B needs +to be configured like this. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 18d7ce5..3c516b4 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -771,6 +771,9 @@ static int mt9t112_goto_capture(const struct i2c_client *client) + if (ret == 0x7) + return 0; + ++ /* Num Frames Run (B) */ ++ mt9t112_mcu_write(ret, client, VAR(27, 5), 0); ++ + /* Go to capture mode */ + mt9t112_mcu_write(ret, client, VAR8(1, 0), 2); + do { +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch new file mode 100644 index 00000000..07c2e201 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch @@ -0,0 +1,58 @@ +From bf70e34844f0a3984d4ca48614fa39896ce5ca5f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 19 Jul 2010 12:31:47 -0500 +Subject: [PATCH 69/75] mt9t112: Fix pll p-dividers abstraction + +Previously, it wasn't clear that the values needed to be filled +were (val - 1). Fix that. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 16 +++++++++------- + 1 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 3c516b4..c1a9b41 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -393,6 +393,8 @@ static void mt9t112_frame_check(u32 *width, u32 *height) + *height = MAX_HEIGHT; + } + ++#define PLL_ADJ(x) ((x != 0) ? x - 1 : 0) ++ + static int mt9t112_set_pll_dividers(const struct i2c_client *client, + u8 m, u8 n, + u8 p1, u8 p2, u8 p3, +@@ -408,21 +410,21 @@ static int mt9t112_set_pll_dividers(const struct i2c_client *client, + mt9t112_reg_mask_set(ret, client, 0x0010, 0x3fff, val); + + /* P1/P2/P3 */ +- val = ((p3 & 0x0F) << 8) | +- ((p2 & 0x0F) << 4) | +- ((p1 & 0x0F) << 0); ++ val = ((PLL_ADJ(p3) & 0x0F) << 8) | ++ ((PLL_ADJ(p2) & 0x0F) << 4) | ++ ((PLL_ADJ(p1) & 0x0F) << 0); + mt9t112_reg_mask_set(ret, client, 0x0012, 0x0fff, val); + + /* P4/P5/P6 */ + val = (0x7 << 12) | +- ((p6 & 0x0F) << 8) | +- ((p5 & 0x0F) << 4) | +- ((p4 & 0x0F) << 0); ++ ((PLL_ADJ(p6) & 0x0F) << 8) | ++ ((PLL_ADJ(p5) & 0x0F) << 4) | ++ ((PLL_ADJ(p4) & 0x0F) << 0); + mt9t112_reg_mask_set(ret, client, 0x002A, 0x7fff, val); + + /* P7 */ + val = (0x1 << 12) | +- ((p7 & 0x0F) << 0); ++ ((PLL_ADJ(p7) & 0x0F) << 0); + mt9t112_reg_mask_set(ret, client, 0x002C, 0x100f, val); + + return ret; +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0070-mt9t112-Adjust-50-60Hz-flickering-settings.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0070-mt9t112-Adjust-50-60Hz-flickering-settings.patch new file mode 100644 index 00000000..e9d4fe87 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0070-mt9t112-Adjust-50-60Hz-flickering-settings.patch @@ -0,0 +1,51 @@ +From aa90dfe987d42500ff2306baf66f526509fdfae0 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 19 Jul 2010 17:30:29 -0500 +Subject: [PATCH 70/75] mt9t112: Adjust 50/60Hz flickering settings + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 24 ++++++++++++++---------- + 1 files changed, 14 insertions(+), 10 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index c1a9b41..8528417 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -694,19 +694,23 @@ static int mt9t112_init_setting(const struct i2c_client *client) + /* RX FIFO Watermark (B) */ + mt9t112_mcu_write(ret, client, VAR(18, 142), 0x0080); + +- /* MCLK: 16MHz ++ /* MCLK: 24MHz + * PCLK: 73MHz + * CorePixCLK: 36.5 MHz + */ +- mt9t112_mcu_write(ret, client, VAR8(18, 0x0044), 133); +- mt9t112_mcu_write(ret, client, VAR8(18, 0x0045), 110); +- mt9t112_mcu_write(ret, client, VAR8(18, 0x008c), 130); +- mt9t112_mcu_write(ret, client, VAR8(18, 0x008d), 108); +- +- mt9t112_mcu_write(ret, client, VAR8(18, 0x00A5), 27); +- mt9t112_mcu_write(ret, client, VAR8(18, 0x00a6), 30); +- mt9t112_mcu_write(ret, client, VAR8(18, 0x00a7), 32); +- mt9t112_mcu_write(ret, client, VAR8(18, 0x00a8), 35); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x0044), 11); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x012F), 1); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x0045), 222); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x012D), 0); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x008c), 161); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x0130), 0); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x008d), 134); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x012E), 0); ++ ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00A5), 36); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00a6), 38); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00a7), 43); ++ mt9t112_mcu_write(ret, client, VAR8(18, 0x00a8), 45); + + return ret; + } +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0071-mt9t112-Trigger-autofocus-at-the-end-of-context-swit.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0071-mt9t112-Trigger-autofocus-at-the-end-of-context-swit.patch new file mode 100644 index 00000000..10ba57db --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0071-mt9t112-Trigger-autofocus-at-the-end-of-context-swit.patch @@ -0,0 +1,35 @@ +From 18589703f191cee2568324b475ae479dd7f3b779 Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Mon, 19 Jul 2010 17:45:38 -0500 +Subject: [PATCH 71/75] mt9t112: Trigger autofocus at the end of context switch + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9t112.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c +index 8528417..0769f66 100644 +--- a/drivers/media/video/mt9t112.c ++++ b/drivers/media/video/mt9t112.c +@@ -1080,8 +1080,6 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + mt9t112_pixfmt_to_order(priv->pix.pixelformat)); + mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06); + +- ECHECKER(ret, mt9t112_auto_focus_trigger(client)); +- + ECHECKER(ret, mt9t112_goto_preview(client)); + + if ((priv->pix.width == MAX_WIDTH) && +@@ -1089,6 +1087,8 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s, + ECHECKER(ret, mt9t112_goto_capture(client)); + } + ++ ECHECKER(ret, mt9t112_auto_focus_trigger(client)); ++ + dev_dbg(&client->dev, "format : %d\n", priv->pix.pixelformat); + dev_dbg(&client->dev, "size : %d x %d\n", + priv->pix.width, +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0072-omap3beagle-camera-Fix-dual-sensor-registration.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0072-omap3beagle-camera-Fix-dual-sensor-registration.patch new file mode 100644 index 00000000..409c08fb --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0072-omap3beagle-camera-Fix-dual-sensor-registration.patch @@ -0,0 +1,43 @@ +From 838aed68f8efa16e9915795ddb968157d40fca6b Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 22 Jul 2010 11:03:33 -0500 +Subject: [PATCH 72/75] omap3beagle: camera: Fix dual sensor registration + +dev_index should be different, which represents an internal index +in the master camera driver. + +Also, make device video nodes be alloted with the "first free", by setting +dev_minor to -1. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 520e1d8..c0218e3 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -107,7 +107,7 @@ static int mt9v113_ifparm(struct v4l2_ifparm *p) + + static struct omap34xxcam_hw_config mt9v113_hwc = { + .dev_index = 0, +- .dev_minor = 0, ++ .dev_minor = -1, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, + .u.sensor.sensor_isp = 1, + .u.sensor.capture_mem = MT9V113_MAX_FRAME_SIZE * 2, +@@ -259,8 +259,8 @@ static int mt9t112_ifparm(struct v4l2_ifparm *p) + + #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + static struct omap34xxcam_hw_config mt9t112_hwc = { +- .dev_index = 0, +- .dev_minor = 0, ++ .dev_index = 1, ++ .dev_minor = -1, + .dev_type = OMAP34XXCAM_SLAVE_SENSOR, + .u.sensor.sensor_isp = 0, + .u.sensor.capture_mem = MT9T112_BIGGEST_FRAME_BYTE_SIZE, +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0073-mt9v113-Fix-State-variable-handling.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0073-mt9v113-Fix-State-variable-handling.patch new file mode 100644 index 00000000..9bd006e1 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0073-mt9v113-Fix-State-variable-handling.patch @@ -0,0 +1,68 @@ +From e3d5c3eb67e2ef91e08b0fcd26778b8505268a8a Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 22 Jul 2010 13:29:16 -0500 +Subject: [PATCH 73/75] mt9v113: Fix State variable handling + +State variable was misused, and was running detection all the +time the sensor was powered back on. + +Reason? power off code was putting it to "not detected" always. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + drivers/media/video/mt9v113.c | 23 ++++++++++++++--------- + 1 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/drivers/media/video/mt9v113.c b/drivers/media/video/mt9v113.c +index 6714240..37e3e19 100644 +--- a/drivers/media/video/mt9v113.c ++++ b/drivers/media/video/mt9v113.c +@@ -1251,7 +1251,6 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + /* Disable mux for mt9v113 data path */ + if (decoder->pdata->power_set) + err |= decoder->pdata->power_set(s, on); +- decoder->state = STATE_NOT_DETECTED; + break; + + case V4L2_POWER_STANDBY: +@@ -1260,23 +1259,29 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) + break; + + case V4L2_POWER_ON: +- /* Enable mux for mt9v113 data path */ +- if (decoder->state == STATE_NOT_DETECTED) { +- +- if (decoder->pdata->power_set) +- err = decoder->pdata->power_set(s, on); ++ if (decoder->pdata->power_set) { ++ err = decoder->pdata->power_set(s, on); ++ if (err) ++ return err; ++ } + ++ if (decoder->state == STATE_NOT_DETECTED) { + /* Detect the sensor is not already detected */ +- err |= mt9v113_detect(decoder); ++ err = mt9v113_detect(decoder); + if (err) { + v4l_err(decoder->client, + "Unable to detect decoder\n"); ++ WARN_ON(1); + return err; + } + } + /* Only VGA mode for now */ +- err |= mt9v113_configure(decoder); +- err |= mt9v113_vga_mode(decoder); ++ err = mt9v113_configure(decoder); ++ if (err) ++ return err; ++ err = mt9v113_vga_mode(decoder); ++ if (err) ++ return err; + break; + + default: +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0074-Move-sensor-rest-to-after-applying-power.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0074-Move-sensor-rest-to-after-applying-power.patch new file mode 100644 index 00000000..24fb458a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0074-Move-sensor-rest-to-after-applying-power.patch @@ -0,0 +1,65 @@ +From f68eb83d33624b83b4ddd77daf3966de686ffaf0 Mon Sep 17 00:00:00 2001 +From: Steve Kipisz <s-kipisz2@ti.com> +Date: Thu, 5 Aug 2010 10:51:11 -0500 +Subject: [PATCH 74/75] Move sensor rest to after applying power. + +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 12 ++++++++---- + 1 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index c0218e3..110c2c9 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -160,8 +160,6 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + case V4L2_POWER_ON: + + isp_configure_interface(vdev->cam->isp, &mt9v113_if_config); +- /* Set RESET_BAR to 0 */ +- gpio_set_value(LEOPARD_RESET_GPIO, 0); + + /* turn on VDD */ + regulator_enable(cam_1v8_reg); +@@ -170,6 +168,9 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + regulator_enable(cam_2v8_reg); + mdelay(50); + ++ /* Set RESET_BAR to 0 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 0); ++ + /* Enable EXTCLK */ + isp_set_xclk(vdev->cam->isp, MT9V113_CLK_MIN*2, CAM_USE_XCLKA); + /* +@@ -177,8 +178,10 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + * ((1000000 * 70) / 6000000) = aprox 12 us. + */ + udelay(12); ++ + /* Set RESET_BAR to 1 */ + gpio_set_value(LEOPARD_RESET_GPIO, 1); ++ + /* + * Wait at least 100 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): + * ((1000000 * 100) / 6000000) = aprox 17 us. +@@ -317,8 +320,6 @@ static int mt9t112_power_set(struct v4l2_int_device *s, enum v4l2_power power) + isp_configure_interface(vdev->cam->isp, &mt9t112_if_config); + #endif + +- /* Set RESET_BAR to 0 */ +- gpio_set_value(LEOPARD_RESET_GPIO, 0); + + /* turn on VDD */ + regulator_enable(cam_1v8_reg); +@@ -330,6 +331,9 @@ static int mt9t112_power_set(struct v4l2_int_device *s, enum v4l2_power power) + + mdelay(50); + ++ /* Set RESET_BAR to 0 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 0); ++ + /* Enable EXTCLK */ + isp_set_xclk(vdev->cam->isp, 24000000, CAM_USE_XCLKA); + +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0075-omap3beagle-Add-camera-bootarg.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0075-omap3beagle-Add-camera-bootarg.patch new file mode 100644 index 00000000..066bbb48 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0075-omap3beagle-Add-camera-bootarg.patch @@ -0,0 +1,108 @@ +From d15c09a8ed5441dd843257b6a4396dd058a2e68f Mon Sep 17 00:00:00 2001 +From: Sergio Aguirre <saaguirre@ti.com> +Date: Thu, 22 Jul 2010 15:38:43 -0500 +Subject: [PATCH 75/75] omap3beagle: Add camera bootarg + +This adds a new 'camera' bootarg, with (so far) 2 new possible types: +- lbcmvga: Leopard Board Camera Module: MT9V113 VGA +- lbcm3m1: Leopard Board Camera Module: MT9T111 3MP + +Also, cleans up a little bit the current i2c2 bus init code. + +Signed-off-by: Sergio Aguirre <saaguirre@ti.com> +--- + arch/arm/mach-omap2/board-omap3beagle.c | 42 +++++++++++++++++++++++++------ + 1 files changed, 34 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 7c9e40a..1e8b77b 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -89,6 +89,7 @@ extern struct mt9t112_platform_data mt9t112_pdata; + #define NAND_BLOCK_SIZE SZ_128K + + char expansionboard_name[16]; ++char cameraboard_name[16]; + + #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) + +@@ -595,13 +596,16 @@ static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = { + static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {}; + #endif + +-static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { ++static struct i2c_board_info __initdata beagle_lbcmvga_i2c2_boardinfo[] = { + #if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE) + { + I2C_BOARD_INFO("mt9v113", MT9V113_I2C_ADDR), + .platform_data = &mt9v113_pdata, + }, + #endif ++}; ++ ++static struct i2c_board_info __initdata beagle_lbcm3m1_i2c2_boardinfo[] = { + #if defined(CONFIG_VIDEO_MT9T112) || defined(CONFIG_VIDEO_MT9T112_MODULE) + { + I2C_BOARD_INFO("mt9t112", MT9T112_I2C_ADDR), +@@ -614,15 +618,27 @@ static int __init omap3_beagle_i2c_init(void) + { + omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo, + ARRAY_SIZE(beagle_i2c1_boardinfo)); +- if(!strcmp(expansionboard_name, "zippy") || !strcmp(expansionboard_name, "zippy2")) +- { +- printk(KERN_INFO "Beagle expansionboard: registering i2c2 bus for zippy/zippy2\n"); ++ ++ if (!strcmp(expansionboard_name, "zippy") || ++ !strcmp(expansionboard_name, "zippy2")) { ++ printk(KERN_INFO "Beagle expansionboard:" ++ " registering i2c2 bus for zippy/zippy2\n"); + omap_register_i2c_bus(2, 400, beagle_zippy_i2c2_boardinfo, + ARRAY_SIZE(beagle_zippy_i2c2_boardinfo)); +- } else +- { +- omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, +- ARRAY_SIZE(beagle_i2c2_boardinfo)); ++ } else { ++ if (!strcmp(cameraboard_name, "lbcmvga")) { ++ printk(KERN_INFO "Beagle cameraboard:" ++ " registering i2c2 bus for lbcmvga\n"); ++ omap_register_i2c_bus(2, 400, beagle_lbcmvga_i2c2_boardinfo, ++ ARRAY_SIZE(beagle_lbcmvga_i2c2_boardinfo)); ++ } else if (!strcmp(cameraboard_name, "lbcm3m1")) { ++ printk(KERN_INFO "Beagle cameraboard:" ++ " registering i2c2 bus for lbcm3m1\n"); ++ omap_register_i2c_bus(2, 400, beagle_lbcm3m1_i2c2_boardinfo, ++ ARRAY_SIZE(beagle_lbcm3m1_i2c2_boardinfo)); ++ } else { ++ omap_register_i2c_bus(2, 400, NULL, 0); ++ } + } + /* Bus 3 is attached to the DVI port where devices like the pico DLP + * projector don't work reliably with 400kHz */ +@@ -825,6 +841,15 @@ static int __init expansionboard_setup(char *str) + return 0; + } + ++static int __init cameraboard_setup(char *str) ++{ ++ if (!str) ++ return -EINVAL; ++ strncpy(cameraboard_name, str, 16); ++ printk(KERN_INFO "Beagle cameraboard: %s\n", cameraboard_name); ++ return 0; ++} ++ + static void __init omap3_beagle_init(void) + { + omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +@@ -910,6 +935,7 @@ static void __init omap3_beagle_map_io(void) + } + + early_param("buddy", expansionboard_setup); ++early_param("camera", cameraboard_setup); + + MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/5m03/0001-mt9p031-import-driver-from-https-github.com-Aptina-B.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/5m03/0001-mt9p031-import-driver-from-https-github.com-Aptina-B.patch new file mode 100644 index 00000000..ee728b9d --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/5m03/0001-mt9p031-import-driver-from-https-github.com-Aptina-B.patch @@ -0,0 +1,1547 @@ +From eefcf5de4689fbd00119d7a7df75244ca6ca1187 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Sun, 1 May 2011 16:40:54 +0200 +Subject: [PATCH 1/2] mt9p031: import driver from https://github.com/Aptina/BeagleBoard-xM/tree/master/Angstrom/MT9P031 + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + drivers/media/video/Kconfig | 6 + + drivers/media/video/Makefile | 1 + + drivers/media/video/mt9p031.c | 1445 +++++++++++++++++++++++++++++++++++++++ + include/media/mt9p031.h | 30 + + include/media/v4l2-chip-ident.h | 1 + + 5 files changed, 1483 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/video/mt9p031.c + create mode 100644 include/media/mt9p031.h + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index 4c1fb0f..59f1133 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -832,6 +832,12 @@ config SOC_CAMERA_MT9M111 + help + This driver supports MT9M111 and MT9M112 cameras from Micron + ++config SOC_CAMERA_MT9P031 ++ tristate "mt9p031 support" ++ depends on SOC_CAMERA && I2C ++ help ++ This driver supports MT9P031 cameras from Micron. ++ + config SOC_CAMERA_MT9T031 + tristate "mt9t031 support" + depends on SOC_CAMERA && I2C +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index fb7e46c..f3110e7 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -79,6 +79,7 @@ obj-$(CONFIG_VIDEO_MT9V113) += mt9v113.o + + obj-$(CONFIG_SOC_CAMERA_MT9M001) += mt9m001.o + obj-$(CONFIG_SOC_CAMERA_MT9M111) += mt9m111.o ++obj-$(CONFIG_SOC_CAMERA_MT9P031) += mt9p031.o + obj-$(CONFIG_SOC_CAMERA_MT9T031) += mt9t031.o + obj-$(CONFIG_SOC_CAMERA_MT9V022) += mt9v022.o + obj-$(CONFIG_SOC_CAMERA_OV772X) += ov772x.o +diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c +new file mode 100644 +index 0000000..3047e43 +--- /dev/null ++++ b/drivers/media/video/mt9p031.c +@@ -0,0 +1,1445 @@ ++/* ++ * drivers/media/video/mt9p031.c ++ * ++ * Aptina mt9p031 sensor driver ++ * ++ * ++ * Copyright (C) 2010 Aptina Imaging ++ * ++ * ++ * Leverage mt9p012.c ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ */ ++ ++ ++#include <linux/delay.h> ++#include <linux/i2c.h> ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/slab.h> ++#include <linux/kernel.h> ++#include <linux/videodev2.h> ++#include <linux/sysfs.h> ++ ++#include <media/mt9p031.h> ++#include <media/v4l2-int-device.h> ++#include <media/v4l2-chip-ident.h> ++ ++#define MT9P031_DEBUG ++ ++#ifdef MT9P031_DEBUG ++#define DPRINTK_DRIVER(format, ...) \ ++ printk(KERN_INFO "_MT9P031_DRIVER: " format, ## __VA_ARGS__) ++#else ++#define DPRINTK_DRIVER(format, ...) ++#endif ++/************************************************************************ ++ macro ++************************************************************************/ ++// Macro to configure I2c level shifter. Use only for MT9P031 Headboards from Aptina; not required for Leopard Imaging or elsewise. ++#define MT9P031_HEADBOARD ++ ++#define MT9P031_CHIP_ID 0x1801 ++#define MT9P031_MAX_HEIGHT 1944 ++#define MT9P031_MAX_WIDTH 2592 ++#define MT9P031_MIN_HEIGHT 2 ++#define MT9P031_MIN_WIDTH 2 ++ ++#define VGA_HEIGHT 480 ++#define VGA_WIDTH 640 ++ ++#define MT9P031_NORMAL_OPERATION_MODE (0x1F82) //write ++#define MT9P031_OUTPUT_CTRL_CHIP_UNSELECT (0x1F80) ++#define MT9P031_OUTPUT_CTRL_HALT (0x1F83) ++ ++/* FPS Capabilities */ ++#define MT9P031_MIN_FPS 10 ++#define MT9P031_DEF_FPS 30 ++#define MT9P031_MAX_FPS 50 ++ ++#define MT9P031_XCLK_NOM_1 12000000 ++#define MT9P031_XCLK_NOM_2 24000000 ++ ++/* Analog gain values */ ++#define MT9P031_EV_MIN_GAIN 0 ++#define MT9P031_EV_MAX_GAIN 47 ++#define MT9P031_EV_DEF_GAIN 24 ++#define MT9P031_EV_GAIN_STEP 1 ++ ++/* Exposure time values */ ++#define MT9P031_MIN_EXPOSURE 15000 ++#define MT9P031_MAX_EXPOSURE 128000 ++#define MT9P031_DEF_EXPOSURE 33000 ++#define MT9P031_EXPOSURE_STEP 100 ++#define Q12 4096 ++/************************************************************************ ++ Register Address ++************************************************************************/ ++ ++#define REG_MT9P031_CHIP_VERSION 0x00 ++#define REG_MT9P031_ROWSTART 0x01 ++#define REG_MT9P031_COLSTART 0x02 ++#define REG_MT9P031_HEIGHT 0x03 ++#define REG_MT9P031_WIDTH 0x04 ++#define REG_MT9P031_HBLANK 0x05 ++#define REG_MT9P031_VBLANK 0x06 ++#define REG_MT9P031_OUT_CTRL 0x07 ++#define REG_MT9P031_SHUTTER_WIDTH_U 0x08 ++#define REG_MT9P031_SHUTTER_WIDTH_L 0x09 ++#define REG_MT9P031_PCLK_CTRL 0x0a ++#define REG_MT9P031_RESTART 0x0b ++#define REG_MT9P031_SHUTTER_DELAY 0x0c ++#define REG_MT9P031_RESET 0x0d ++ ++#define REG_MT9P031_PLL_CTRL 0x10 ++#define REG_MT9P031_PLL_CONF1 0x11 ++#define REG_MT9P031_PLL_CONF2 0x12 ++ ++#define REG_MT9P031_READ_MODE1 0x1e ++#define REG_MT9P031_READ_MODE2 0x20 ++#define REG_MT9P031_ROW_ADDR_MODE 0x22 ++#define REG_MT9P031_COL_ADDR_MODE 0x23 ++#define REG_MT9P031_GREEN_1_GAIN 0x2b ++#define REG_MT9P031_BLUE_GAIN 0x2c ++#define REG_MT9P031_RED_GAIN 0x2d ++#define REG_MT9P031_GREEN_2_GAIN 0x2e ++#define REG_MT9P031_GLOBAL_GAIN 0x35 ++#define REG_MT9P031_CHIP_VERSION_ALT 0x0FF ++ ++/************************************************************************ ++ struct ++************************************************************************/ ++struct mt9p031_frame_size { ++ u16 width; ++ u16 height; ++}; ++ ++struct mt9p031_priv { ++ struct mt9p031_platform_data *pdata; ++ struct v4l2_int_device *v4l2_int_device; ++ struct i2c_client *client; ++ struct v4l2_pix_format pix; ++ struct v4l2_fract timeperframe; ++ unsigned long xclk_current; ++ int fps; ++ int scaler; ++ int ver; ++ int model; ++ u32 flags; ++/* for flags */ ++#define INIT_DONE (1<<0) ++}; ++ ++struct mt9p031_priv sysPriv; ++ ++static const struct v4l2_fmtdesc mt9p031_formats[] = { ++ { ++ .description = "Bayer (sRGB) 10 bit", ++ .pixelformat = V4L2_PIX_FMT_SRGGB10, ++ }, ++}; ++ ++static const unsigned int mt9p031_num_formats = ARRAY_SIZE(mt9p031_formats); ++ ++/***********************Minimum Horizontal blanking*********************/ ++int hb_min[4][4] = { ++ { 450, 430, 0, 420 }, ++ { 796, 776, 0, 766 }, ++ { 0, 0, 0, 0 }, ++ { 1488, 1468, 0, 1458 }, ++}; ++ ++/**************************supported sizes******************************/ ++const static struct mt9p031_frame_size mt9p031_sizes[] = { ++ { 640, 480 }, ++ { 1280, 720 }, ++ { 1920, 1080 }, ++ { 2048, 1536 }, //3MP ++ { 2592, 1944 }, //5MP ++}; ++ ++ ++struct mt9p031_format_params { ++ int width; ++ int height; ++ int row_start; ++ int col_start; ++ int row_size; ++ int col_size; ++ int hblank; ++ int vblank; ++ int integ_time; ++ int row_addr_mode; ++ int col_addr_mode; ++ int read_mode_2_config; ++ int shutter_width_hi; ++ int shutter_delay; ++ int row_bin; ++ int col_bin; ++}; ++ ++enum mt9p031_image_size { ++ VGA_BIN_30FPS, ++ HDV_720P_30FPS, ++ //HDV_720P_60FPS, ++ //HDV_720P_60FPS_LVB, ++ HDV_1080P_30FPS, ++ MT9P031_THREE_MP, ++ MT9P031_FIVE_MP, ++}; ++ ++enum mt9p031_image_size mt9p031_current_format; ++ ++const struct mt9p031_format_params mt9p031_supported_formats[] = { ++ { 640, 480, 64, 24, 1919, 2559, 0, 0, 0x0296, 0x0033, 0x0033, 0x0060, 0, 0, 3, 3 }, // VGA_BIN_30FPS ++ { 1280, 720, 64, 24, 1439, 2559, 0, 0, 0x0296, 0x0011, 0x0011, 0x0060, 0, 0, 1, 1 }, // 720P_HD_30FPS ++ //{ 1280, 720, 0x0040, 0x0018, 0x059F, 0x09FF, 0, 0, 0x0296, 0x0011, 0x0011, 0x0060, 0, 0, 1, 1 }, // 720P_HD_60FPS ++ //{ 1280, 720, 0x0040, 0x0018, 0x059F, 0x09FF, 0, 0x02D0, 0x0296, 0x0011, 0x0011, 0x0060, 0, 0, 1, 1 }, // 720P_HD_60FPS_LVB ++ { 1920, 1080, 431, 335, 1079, 1919, 0, 0x0037, 0x01AC, 0, 0, 0x0040, 0, 0, 0, 0 }, // 1080P_30FPS ++ { 2048, 1536, 431, 335, 1535, 2047, 0, 0x0037, 0x01AC, 0, 0, 0x0040, 0, 0, 0, 0 }, // 3MP CAPTURE ++ { 2592, 1944, 431, 335, 1943, 2591, 0, 0x0037, 0x01AC, 0, 0, 0x0040, 0, 0, 0, 0 }, // 5MP CAPTURE ++}; ++ ++ ++const struct v4l2_fract mt9p031_frameintervals[] = { ++ { .numerator = 1, .denominator = 10 }, ++ { .numerator = 1, .denominator = 20 }, ++ { .numerator = 1, .denominator = 30 }, ++ { .numerator = 1, .denominator = 40 }, ++ { .numerator = 1, .denominator = 50 }, ++}; ++ ++ ++const u16 MT9P031_EV_GAIN_TBL[48] = { ++ /* Gain x1 */ ++ 8, 9, 10, 11, 12, 13, 14, 15, ++ /* Gain x2 */ ++ 16, 17, 18, 19, 20, 21, 22, 23, ++ /* Gain x3 */ ++ 24, 25, 26, 27, 28, 29, 30, 31, ++ /* Gain x4 */ ++ 32, 33, 34, 35, ++ /* Gain x5 */ ++ 81, 82, 83, ++ /* Gain x6 */ ++ 84, 85, 86, 87, 88, 89, 90, 91, ++ /* Gain x7 */ ++ 92, 93, 94, 95, 96, 97, 98, 99, ++ /* Gain x8 */ ++ 100, ++}; ++ ++#ifdef MT9P031_HEADBOARD ++/** ++ * mt9p031_config_PCA9543A - configure on-board I2c level-shifter PCA9543A of MT9P031 Headboards from Aptina ++ * @client: pointer to i2c client ++ * Configures the level shifter to enable channel 0 ++ */ ++static int mt9p031_config_PCA9543A(const struct i2c_client *client) ++{ ++ struct i2c_msg msg; ++ int ret; ++ u8 buf; ++ buf = 0x21; ++ ++ msg.addr = (0xE6 >> 1); //slave address of PCA9543A ++ msg.flags = 0; ++ msg.len = 1; ++ msg.buf = &buf; ++ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ ++ return 0; ++ ++} ++#endif //MT9P031_HEADBOARD ++ ++/** ++ * mt9p031_reg_read - read resgiter value ++ * @client: pointer to i2c client ++ * @command: register address ++ */ ++static int mt9p031_reg_read(const struct i2c_client *client, u16 command, u16 *val) ++{ ++ struct i2c_msg msg[2]; ++ u8 buf[2]; ++ int ret; ++ ++ // 8-bit/ byte addressable register ++ buf[0] = command & 0xff; ++ ++ msg[0].addr = client->addr; ++ msg[0].flags = 0; ++ msg[0].len = 1; ++ msg[0].buf = buf ; ++ ret = i2c_transfer(client->adapter, &msg[0], 1); ++ ++ if(ret >= 0) { ++ msg[1].addr = client->addr; ++ msg[1].flags = I2C_M_RD; //1 ++ msg[1].len = 2; ++ msg[1].buf = buf; ++ ret = i2c_transfer(client->adapter, &msg[1], 1); ++ } ++ /* ++ * if return value of this function is < 0, ++ * it mean error. ++ * else, under 16bit is valid data. ++ */ ++ if(ret >= 0) { ++ *val = 0; ++ *val = buf[1] + (buf[0] << 8); ++ return 0; ++ } ++ ++ v4l_err(client, "read from offset 0x%x error %d", command, ret); ++ return ret; ++} ++ ++/** ++ * mt9p031_reg_write - read resgiter value ++ * @client: pointer to i2c client ++ * @command: register address ++ * @data: value to be written ++ */ ++static int mt9p031_reg_write(const struct i2c_client *client, ++ u16 command, u16 data) ++{ ++ struct i2c_msg msg; ++ u8 buf[3]; ++ int ret; ++ ++ // 8-bit/ byte addressable register ++ ++ buf[0] = command & 0xff; ++ data = swab16(data); ++ memcpy(buf + 1, &data, 2); ++ ++ msg.addr = client->addr; ++ msg.flags = 0; ++ msg.len = 3; ++ msg.buf = buf; ++ ++ /* ++ * i2c_transfer return message length, ++ * but this function should return 0 if correct case ++ */ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ if (ret >= 0) ++ ret = 0; ++ ++ return ret; ++} ++ ++/** ++ * struct vcontrol - Video controls ++ * @v4l2_queryctrl: V4L2 VIDIOC_QUERYCTRL ioctl structure ++ * @current_value: current value of this control ++ */ ++static struct vcontrol { ++ struct v4l2_queryctrl qc; ++ int current_value; ++} mt9p031_video_control[] = { ++ { ++ { ++ .id = V4L2_CID_EXPOSURE, ++ .type = V4L2_CTRL_TYPE_INTEGER, ++ .name = "Exposure", ++ .minimum = MT9P031_MIN_EXPOSURE, ++ .maximum = MT9P031_MAX_EXPOSURE, ++ .step = MT9P031_EXPOSURE_STEP, ++ .default_value = MT9P031_DEF_EXPOSURE, ++ }, ++ .current_value = MT9P031_DEF_EXPOSURE, ++ }, ++ { ++ { ++ .id = V4L2_CID_GAIN, ++ .type = V4L2_CTRL_TYPE_INTEGER, ++ .name = "Analog Gain", ++ .minimum = MT9P031_EV_MIN_GAIN, ++ .maximum = MT9P031_EV_MAX_GAIN, ++ .step = MT9P031_EV_GAIN_STEP, ++ .default_value = MT9P031_EV_DEF_GAIN, ++ }, ++ .current_value = MT9P031_EV_DEF_GAIN, ++ }, ++}; ++ ++/** ++ * find_vctrl - Finds the requested ID in the video control structure array ++ * @id: ID of control to search the video control array for ++ * ++ * Returns the index of the requested ID from the control structure array ++ */ ++static int ++find_vctrl(int id) ++{ ++ int i; ++ ++ if (id < V4L2_CID_BASE) ++ return -EDOM; ++ ++ for (i = (ARRAY_SIZE(mt9p031_video_control) - 1); i >= 0; i--) ++ if (mt9p031_video_control[i].qc.id == id) ++ break; ++ if (i < 0) ++ i = -EINVAL; ++ return i; ++} ++ ++/** ++ * mt9p031_calc_size - Find the best match for a requested image capture size ++ * @width: requested image width in pixels ++ * @height: requested image height in pixels ++ * ++ * Find the best match for a requested image capture size. The best match ++ * is chosen as the nearest match that has the same number or fewer pixels ++ * as the requested size, or the smallest image size if the requested size ++ * has fewer pixels than the smallest image. ++ */ ++static enum mt9p031_image_size mt9p031_calc_size(unsigned int width, ++ unsigned int height) ++{ ++ enum mt9p031_image_size isize; ++ unsigned long pixels = width * height; ++ ++ for (isize = VGA_BIN_30FPS; isize <= MT9P031_FIVE_MP; isize++) { ++ if (mt9p031_sizes[isize].height * ++ mt9p031_sizes[isize].width >= pixels) { ++ ++ return isize; ++ } ++ } ++ ++ return MT9P031_FIVE_MP; ++} ++ ++/** ++ * mt9p031_find_isize - Find the best match for a requested image capture size ++ * @width: requested image width in pixels ++ * @height: requested image height in pixels ++ * ++ * Find the best match for a requested image capture size. The best match ++ * is chosen as the nearest match that has the same number or fewer pixels ++ * as the requested size, or the smallest image size if the requested size ++ * has fewer pixels than the smallest image. ++ */ ++static enum mt9p031_image_size mt9p031_find_isize(unsigned int width) ++{ ++ enum mt9p031_image_size isize; ++ ++ for (isize = VGA_BIN_30FPS; isize <= MT9P031_FIVE_MP; isize++) { ++ if (mt9p031_sizes[isize].width >= width) ++ break; ++ } ++ ++ return isize; ++} ++ ++/** ++ * mt9p031_calc_xclk - Calculate the required xclk frequency ++ * @c: i2c client driver structure ++ * ++ * Given the image capture format in pix, the nominal frame period in ++ * timeperframe, calculate and return the required xclk frequency ++ */ ++static unsigned long mt9p031_calc_xclk(struct i2c_client *c) ++{ ++ struct mt9p031_priv *priv = i2c_get_clientdata(c); ++ struct v4l2_fract *timeperframe = &priv->timeperframe; ++ ++ if (timeperframe->numerator == 0 || ++ timeperframe->denominator == 0) { ++ /* supply a default nominal_timeperframe */ ++ timeperframe->numerator = 1; ++ timeperframe->denominator = MT9P031_DEF_FPS; ++ } ++ ++ priv->fps = timeperframe->denominator / timeperframe->numerator; ++ if (priv->fps < MT9P031_MIN_FPS) ++ priv->fps = MT9P031_MIN_FPS; ++ else if (priv->fps > MT9P031_MAX_FPS) ++ priv->fps = MT9P031_MAX_FPS; ++ ++ timeperframe->numerator = 1; ++ timeperframe->denominator = priv->fps; ++ ++ return MT9P031_XCLK_NOM_1; ++} ++ ++/** ++ * mt9p031_set_params - sets register settings according to resolution ++ * @client: pointer to standard i2c client ++ * @width: width as queried by ioctl ++ * @height: height as queried by ioctl ++ */ ++static int mt9p031_set_params(struct i2c_client *client, u32 width, u32 height) ++{ ++ struct mt9p031_priv *priv = i2c_get_clientdata(client); ++ struct v4l2_pix_format *pix = &priv->pix; ++ int ret; ++ enum mt9p031_image_size i; ++ ++ i = mt9p031_find_isize(pix->width); ++ priv->pix.width = mt9p031_supported_formats[i].width; ++ priv->pix.height = mt9p031_supported_formats[i].height; ++ ++ ret = mt9p031_reg_write(client, REG_MT9P031_ROWSTART, mt9p031_supported_formats[i].row_start); //ROW_WINDOW_START_REG ++ ret |= mt9p031_reg_write(client, REG_MT9P031_COLSTART, mt9p031_supported_formats[i].col_start); //COL_WINDOW_START_REG ++ ret |= mt9p031_reg_write(client, REG_MT9P031_HEIGHT, mt9p031_supported_formats[i].row_size); //ROW_WINDOW_SIZE_REG=1439 ++ ret |= mt9p031_reg_write(client, REG_MT9P031_WIDTH, mt9p031_supported_formats[i].col_size); //COL_WINDOW_SIZE_REG=2559 ++ ret |= mt9p031_reg_write(client, REG_MT9P031_HBLANK, mt9p031_supported_formats[i].hblank); //HORZ_BLANK=0 ++ ret |= mt9p031_reg_write(client, REG_MT9P031_VBLANK, mt9p031_supported_formats[i].vblank); //VERT_BLANK_REG=720 ++ ret |= mt9p031_reg_write(client, REG_MT9P031_SHUTTER_WIDTH_L, 0x0400); //SHUTTER_WIDTH_LOW (INTEG_TIME_REG = 1024) ++ ret |= mt9p031_reg_write(client, REG_MT9P031_ROW_ADDR_MODE, mt9p031_supported_formats[i].row_addr_mode); //ROW_MODE, ROW_SKIP=1, ROW_BIN=1 ++ ret |= mt9p031_reg_write(client, REG_MT9P031_COL_ADDR_MODE, mt9p031_supported_formats[i].col_addr_mode); //COL_MODE, COL_SKIP=1, COL_BIN=1 ++ ret |= mt9p031_reg_write(client, REG_MT9P031_READ_MODE2, mt9p031_supported_formats[i].read_mode_2_config); //READ_MODE_2, COL_SUM ++ ret |= mt9p031_reg_write(client, REG_MT9P031_SHUTTER_WIDTH_U, mt9p031_supported_formats[i].shutter_width_hi); //SHUTTER_WIDTH_HI ++ ret |= mt9p031_reg_write(client, REG_MT9P031_SHUTTER_WIDTH_L, mt9p031_supported_formats[i].integ_time); //SHUTTER_WIDTH_LOW (INTEG_TIME_REG) ++ ret |= mt9p031_reg_write(client, REG_MT9P031_SHUTTER_DELAY, mt9p031_supported_formats[i].shutter_delay); //SHUTTER_DELAY_REG ++ ++ return ret; ++} ++ ++/** ++ * mt9p031_init_camera - initialize camera settings ++ * @client: pointer to i2c client ++ * Initialize camera settings ++ */ ++static int mt9p031_init_camera(const struct i2c_client *client) ++{ ++ int ret; ++ struct mt9p031_priv *priv = i2c_get_clientdata(client); ++ struct v4l2_pix_format *pix = &priv->pix; ++ ++ ret = mt9p031_reg_write(client, REG_MT9P031_PLL_CTRL, 0x0051); //PLL_CTRL; power up pll ++ ret |= mt9p031_reg_write(client, REG_MT9P031_PLL_CONF1, 0x1801); //PLL_CONFIG_1: m=24, n=1 ++ ret |= mt9p031_reg_write(client, REG_MT9P031_PLL_CONF2, 0x0002); //PLL_CONFIG_2: p1=2, p2=0 ++ mdelay(10); //wait 10 ms for VCO to lock ++ ret |= mt9p031_reg_write(client, REG_MT9P031_PLL_CTRL, 0x0053); //PLL_CONTROL; use PLL ++ mdelay(200); ++ ++ ret |= mt9p031_set_params(priv->client, pix->width, pix->height); ++ ++ ret |= mt9p031_reg_write(client, REG_MT9P031_RESET, 0x0001); //High ++ ret |= mt9p031_reg_write(client, REG_MT9P031_RESET, 0x0000); //Low ++ mdelay(100); ++ ++ ret |= mt9p031_reg_write(client, REG_MT9P031_GREEN_1_GAIN, 0x0051); //Green1_gain_reg ++ ret |= mt9p031_reg_write(client, REG_MT9P031_BLUE_GAIN, 0x0051); //Blue_gain_reg ++ ret |= mt9p031_reg_write(client, REG_MT9P031_RED_GAIN, 0x0051); //Red_gain_reg ++ ret |= mt9p031_reg_write(client, REG_MT9P031_GREEN_2_GAIN, 0x0051); //Green2_gain_reg ++ ret |= mt9p031_reg_write(client, REG_MT9P031_GLOBAL_GAIN, 0x0008); //Analog Gain ++ ret |= mt9p031_reg_write(client, REG_MT9P031_READ_MODE1, 0x0006); //Read_mode_1 //disable AB ++ ret |= mt9p031_reg_write(client, REG_MT9P031_OUT_CTRL, 0x1F8E); //Enable parll fifo data ++ ++ return ret>= 0 ? 0 : -EIO; ++} ++ ++/************************************************************************ ++ i2c driver ++************************************************************************/ ++/** ++ * mt9p031_detect - Detect if an mt9p031 is present, and if so which revision ++ * @client: pointer to the i2c client driver structure ++ * ++ * Returns a negative error number if no device is detected ++ */ ++static int mt9p031_detect(struct i2c_client *client) ++{ ++ struct mt9p031_priv *priv = i2c_get_clientdata(client); ++ const char *devname; ++ u16 chipid; ++ ++ if (!client) ++ return -ENODEV; ++ /* ++ * Set Normal Mode ++ */ ++ if(mt9p031_reg_write(client, REG_MT9P031_OUT_CTRL, MT9P031_NORMAL_OPERATION_MODE)) ++ return -ENODEV; ++ /* ++ * check and show chip ID ++ */ ++ if(mt9p031_reg_read(client, REG_MT9P031_CHIP_VERSION, &chipid)) ++ return -ENODEV; ++ ++ if(chipid == MT9P031_CHIP_ID) { ++ devname = "mt9p031"; ++ priv->model = V4L2_IDENT_MT9P031; ++ dev_info(&client->dev, "%s chip ID %04x\n", devname, chipid); ++ return 0; ++ } ++ ++ dev_err(&client->dev, "Product ID error %04x\n", chipid); ++ return -ENODEV; ++} ++ ++/** ++ * mt9p031_set_exposure_time - sets exposure time per input value ++ * @exp_time: exposure time to be set on device ++ * @client: pointer to standard i2c client ++ * @lvc: pointer to V4L2 exposure entry in video_controls array ++ * ++ * If the requested exposure time is within the allowed limits, the HW ++ * is configured to use the new exposure time, and the video_controls ++ * array is updated with the new current value. ++ * The function returns 0 upon success. Otherwise an error code is ++ * returned. ++ */ ++static int mt9p031_set_exposure_time(u32 exp_time, struct i2c_client *client, ++ struct vcontrol *lvc) ++{ ++ int ret = 0, i, shutter_width, so_p, t_pix_clk, sd_p, shutter_delay; ++ int sw_l ,sw_u ,W ,h_blanking, t_row; ++ ++ if(exp_time < MT9P031_MIN_EXPOSURE) ++ exp_time = MT9P031_MIN_EXPOSURE; ++ else if(exp_time > MT9P031_MAX_EXPOSURE) ++ exp_time = MT9P031_MAX_EXPOSURE; ++ ++ shutter_delay = mt9p031_supported_formats[mt9p031_current_format].shutter_delay; ++ sd_p = min(shutter_delay + 1, 1504); ++ so_p = 208 * (mt9p031_supported_formats[mt9p031_current_format].row_bin + 1) + 98 + sd_p - 94; ++ t_pix_clk = (Q12/96 ); ++ h_blanking = mt9p031_supported_formats[mt9p031_current_format].hblank + 1; ++ W = 2 * (int)((mt9p031_supported_formats[mt9p031_current_format].row_size + 1) / (2 * (mt9p031_supported_formats[mt9p031_current_format].row_bin + 1)) + 1); ++ t_row = 2 * t_pix_clk * max(W/2 + max(h_blanking, hb_min[mt9p031_supported_formats[mt9p031_current_format].row_bin][mt9p031_supported_formats[mt9p031_current_format].col_bin]), ++ (41 + 346 * (mt9p031_supported_formats[mt9p031_current_format].row_bin + 1) + 99))/Q12; ++ ++ shutter_width = (exp_time + 2*so_p*t_pix_clk) / t_row; ++ ++ if (shutter_width< 3) { ++ sd_p = 1232 > shutter_delay ? 1232 : shutter_delay; ++ so_p = 208 * (mt9p031_supported_formats[mt9p031_current_format].row_bin + 1) + 98 + sd_p - 94; ++ shutter_width = ((exp_time*Q12 + 2*so_p*t_pix_clk) / (t_row * Q12)); ++ } ++ ++ if (shutter_width < 1) ++ shutter_width = 1; ++ sw_l = shutter_width& 0xffff; ++ sw_u = (shutter_width)>> 16; ++ ret = mt9p031_reg_write(client, REG_MT9P031_SHUTTER_WIDTH_L,sw_l); ++ mdelay(1); ++ ret = mt9p031_reg_write(client, REG_MT9P031_SHUTTER_WIDTH_U,sw_u); ++ ++ if (ret) ++ dev_err(&client->dev, "Error setting exposure time %d\n", ++ ret); ++ else{ ++ i = find_vctrl(V4L2_CID_EXPOSURE); ++ if (i >= 0) { ++ lvc = &mt9p031_video_control[i]; ++ lvc->current_value = exp_time; ++ } ++ } ++ ++ return ret; ++} ++ ++/** ++ * mt9p031_set_gain - sets sensor analog gain per input value ++ * @lineargain: analog gain value index to be set on device ++ * @client: pointer to standard i2c client ++ * @lvc: pointer to V4L2 analog gain entry in video_controls array ++ * ++ * If the requested analog gain is within the allowed limits, the HW ++ * is configured to use the new gain value, and the video_controls ++ * array is updated with the new current value. ++ * The function returns 0 upon success. Otherwise an error code is ++ * returned. ++ */ ++int mt9p031_set_gain(u16 lineargain, struct i2c_client *client, ++ struct vcontrol *lvc) ++{ ++ int ret= 0, i; ++ u16 reg_gain = 0; ++ ++ if (lineargain < MT9P031_EV_MIN_GAIN) { ++ lineargain = MT9P031_EV_MIN_GAIN; ++ v4l_err(client, "Gain out of legal range."); ++ } ++ if (lineargain > MT9P031_EV_MAX_GAIN) { ++ lineargain = MT9P031_EV_MAX_GAIN; ++ v4l_err(client, "Gain out of legal range."); ++ } ++ ++ reg_gain = MT9P031_EV_GAIN_TBL[lineargain]; ++ ret = mt9p031_reg_write(client, REG_MT9P031_GLOBAL_GAIN, ++ reg_gain); ++ ++ if (ret) { ++ dev_err(&client->dev, "Error setting gain.%d", ret); ++ return ret; ++ } ++ else { ++ i = find_vctrl(V4L2_CID_GAIN); ++ if (i >= 0) { ++ lvc = &mt9p031_video_control[i]; ++ lvc->current_value = lineargain; ++ } ++ } ++ ++ return ret; ++} ++ ++/************************************************************************ ++ v4l2_ioctls ++************************************************************************/ ++ ++/** ++ * mt9p031_v4l2_int_s_power - V4L2 sensor interface handler for vidioc_int_s_power_num ++ * @s: pointer to standard V4L2 device structure ++ * @on: power state to which device is to be set ++ * ++ * Sets devices power state to requrested state, if possible. ++ */ ++static int mt9p031_v4l2_int_s_power(struct v4l2_int_device *s, ++ enum v4l2_power power) ++{ ++ struct mt9p031_priv *priv = s->priv; ++ struct i2c_client *client = priv->client; ++ ++ int ret; ++ ++ switch (power) { ++ case V4L2_POWER_STANDBY: ++ /* FALLTHROUGH */ ++ case V4L2_POWER_OFF: ++ ret = priv->pdata->power_set(s, power); ++ if (ret < 0) { ++ dev_err(&client->dev, "Unable to set target board power " ++ "state (OFF/STANDBY)\n"); ++ return ret; ++ } ++ break; ++ case V4L2_POWER_ON: ++ ret = priv->pdata->power_set(s, power); ++ ++ if (ret < 0) { ++ dev_err(&client->dev, "Unable to set target board power " ++ "state (ON)\n"); ++ return ret; ++ } ++ if (!(priv->flags & INIT_DONE)) { ++ ret = mt9p031_detect(client); ++ if (ret < 0) { ++ dev_err(&client->dev, "Unable to detect sensor\n"); ++ return ret; ++ } ++ priv->flags |= INIT_DONE; ++ } ++ ++ ret = mt9p031_init_camera(client); ++ if (ret < 0) { ++ dev_err(&client->dev, "Unable to initialize sensor\n"); ++ return ret; ++ } ++ } ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_s_ctrl - V4L2 sensor interface handler for VIDIOC_S_CTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @vc: standard V4L2 VIDIOC_S_CTRL ioctl structure ++ * ++ * If the requested control is supported, sets the control's current ++ * value in HW (and updates the video_control[] array). Otherwise, ++ * returns -EINVAL if the control is not supported. ++ */ ++static int mt9p031_v4l2_s_ctrl(struct v4l2_int_device *s, ++ struct v4l2_control *vc) ++{ ++ int retval = -EINVAL; ++ int i; ++ struct vcontrol *lvc; ++ struct mt9p031_priv *priv = s->priv; ++ struct i2c_client *client = priv->client; ++ ++ i = find_vctrl(vc->id); ++ if (i < 0) ++ return -EINVAL; ++ lvc = &mt9p031_video_control[i]; ++ ++ switch (vc->id) { ++ case V4L2_CID_EXPOSURE: ++ retval = mt9p031_set_exposure_time(vc->value, client, lvc); ++ break; ++ case V4L2_CID_GAIN: ++ retval = mt9p031_set_gain(vc->value, client, lvc); ++ break; ++ } ++ ++ return retval; ++} ++ ++/** ++ * mt9p031_v4l2_g_ctrl - V4L2 sensor interface handler for VIDIOC_G_CTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @vc: standard V4L2 VIDIOC_G_CTRL ioctl structure ++ * ++ * If the requested control is supported, returns the control's current ++ * value from the video_control[] array. Otherwise, returns -EINVAL ++ * if the control is not supported. ++ */ ++static int mt9p031_v4l2_g_ctrl(struct v4l2_int_device *s, ++ struct v4l2_control *vc) ++{ ++ struct vcontrol *lvc; ++ int i; ++ ++ i = find_vctrl(vc->id); ++ if (i < 0) ++ return -EINVAL; ++ lvc = &mt9p031_video_control[i]; ++ ++ switch (vc->id) { ++ case V4L2_CID_EXPOSURE: ++ vc->value = lvc->current_value; ++ break; ++ case V4L2_CID_GAIN: ++ vc->value = lvc->current_value; ++ break; ++ } ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_queryctrl - V4L2 sensor interface handler for VIDIOC_QUERYCTRL ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @qc: standard V4L2 VIDIOC_QUERYCTRL ioctl structure ++ * ++ * If the requested control is supported, returns the control information ++ * from the video_control[] array. Otherwise, returns -EINVAL if the ++ * control is not supported. ++ */ ++static int mt9p031_v4l2_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qc) ++{ ++ int i; ++ ++ i = find_vctrl(qc->id); ++ if (i == -EINVAL) ++ qc->flags = V4L2_CTRL_FLAG_DISABLED; ++ ++ if (i < 0) ++ return -EINVAL; ++ ++ *qc = mt9p031_video_control[i].qc; ++ return 0; ++} ++ ++ ++/** ++ * mt9p031_v4l2_int_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure ++ * ++ * Implement the VIDIOC_ENUM_FMT ioctl for the CAPTURE buffer type. ++ */ ++static int mt9p031_v4l2_int_enum_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_fmtdesc *fmt) ++{ ++ int index = fmt->index; ++ enum v4l2_buf_type type = fmt->type; ++ ++ memset(fmt, 0, sizeof(*fmt)); ++ fmt->index = index; ++ fmt->type = type; ++ ++ switch (fmt->type) { ++ case V4L2_BUF_TYPE_VIDEO_CAPTURE: ++ if (index >= ARRAY_SIZE(mt9p031_formats)) ++ return -EINVAL; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ strlcpy(fmt->description, mt9p031_formats[index].description, ++ sizeof(fmt->description)); ++ fmt->pixelformat = mt9p031_formats[index].pixelformat; ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_int_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure ++ * ++ * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This ++ * ioctl is used to negotiate the image capture size and pixel format ++ * without actually making it take effect. ++ */ ++static int mt9p031_v4l2_int_try_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ enum mt9p031_image_size isize; ++ int ifmt; ++ struct v4l2_pix_format *pix = &f->fmt.pix; ++ struct mt9p031_priv *priv = s->priv; ++ struct v4l2_pix_format *pix2 = &priv->pix; ++ ++ isize = mt9p031_calc_size(pix->width, pix->height); ++ mt9p031_current_format = isize; ++ ++ pix->width = mt9p031_sizes[isize].width; ++ pix->height = mt9p031_sizes[isize].height; ++ for (ifmt = 0; ifmt < mt9p031_num_formats; ifmt++) { ++ if (pix->pixelformat == mt9p031_formats[ifmt].pixelformat) ++ break; ++ } ++ if (ifmt == mt9p031_num_formats) ++ ifmt = 0; ++ pix->pixelformat = mt9p031_formats[ifmt].pixelformat; ++ pix->field = V4L2_FIELD_NONE; ++ pix->bytesperline = pix->width * 2; ++ pix->sizeimage = pix->bytesperline * pix->height; ++ pix->priv = 0; ++ pix->colorspace = V4L2_COLORSPACE_SRGB; ++ ++ *pix2 = *pix; ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_int_s_fmt_cap - V4L2 sensor interface handler for VIDIOC_S_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure ++ * ++ * If the requested format is supported, configures the HW to use that ++ * format, returns error code if format not supported or HW can't be ++ * correctly configured. ++ */ ++static int mt9p031_v4l2_int_s_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ struct mt9p031_priv *priv = s->priv; ++ struct v4l2_pix_format *pix = &f->fmt.pix; ++ int rval; ++ ++ rval = mt9p031_v4l2_int_try_fmt_cap(s, f); ++ if (!rval) ++ priv->pix = *pix; ++ ++ return rval; ++} ++ ++/** ++ * mt9p031_v4l2_int_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 v4l2_format structure ++ * ++ * Returns the sensor's current pixel format in the v4l2_format ++ * parameter. ++ */ ++static int mt9p031_v4l2_int_g_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ struct mt9p031_priv *priv = s->priv; ++ ++ f->fmt.pix.width = priv->pix.width; ++ f->fmt.pix.height = priv->pix.height; ++ f->fmt.pix.pixelformat = V4L2_COLORSPACE_SRGB; ++ f->fmt.pix.pixelformat = priv->pix.pixelformat; ++ f->fmt.pix.field = V4L2_FIELD_NONE; ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_int_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure ++ * ++ * Configures the sensor to use the input parameters, if possible. If ++ * not possible, reverts to the old parameters and returns the ++ * appropriate error code. ++ */ ++ ++ ++static int mt9p031_v4l2_int_s_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ struct mt9p031_priv *priv = s->priv; ++ struct i2c_client *client = priv->client; ++ struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe; ++ ++ priv->timeperframe = *timeperframe; ++ priv->xclk_current = mt9p031_calc_xclk(client); ++ *timeperframe = priv->timeperframe; ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_int_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure ++ * ++ * Returns the sensor's video CAPTURE parameters. ++ */ ++static int mt9p031_v4l2_int_g_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ struct mt9p031_priv *priv = s->priv; ++ struct v4l2_captureparm *cparm = &a->parm.capture; ++ ++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; ++ ++ memset(a, 0, sizeof(*a)); ++ a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ cparm->capability = V4L2_CAP_TIMEPERFRAME; ++ cparm->timeperframe.numerator = 1; ++ cparm->timeperframe = priv->timeperframe; ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_int_g_priv - V4L2 sensor interface handler for vidioc_int_g_priv_num ++ * @s: pointer to standard V4L2 device structure ++ * @p: void pointer to hold sensor's private data address ++ * ++ * Returns device's (sensor's) private data area address in p parameter ++ */ ++static int mt9p031_v4l2_int_g_priv(struct v4l2_int_device *s, void *p) ++{ ++ struct mt9p031_priv *priv = s->priv; ++ ++ return priv->pdata->priv_data_set(p); ++} ++ ++/** ++ * mt9p031_v4l2_int_g_ifparm - V4L2 sensor interface handler for vidioc_int_g_priv_num ++ * @s: pointer to standard V4L2 device structure ++ * @p: void pointer to hold sensor's ifparm ++ * ++ * Returns device's (sensor's) ifparm in p parameter ++ */ ++static int mt9p031_v4l2_int_g_ifparm(struct v4l2_int_device *s, ++ struct v4l2_ifparm *p) ++{ ++ struct mt9p031_priv *priv = s->priv; ++ int rval; ++ ++ if (p == NULL) ++ return -EINVAL; ++ ++ if (!priv->pdata->ifparm) ++ return -EINVAL; ++ ++ rval = priv->pdata->ifparm(p); ++ if (rval) { ++ v4l_err(priv->client, "g_ifparm.Err[%d]\n", rval); ++ return rval; ++ } ++ ++ return 0; ++} ++ ++/** ++ * mt9p031_v4l2_int_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes ++ * @s: pointer to standard V4L2 device structure ++ * @frms: pointer to standard V4L2 framesizes enumeration structure ++ * ++ * Returns possible framesizes depending on choosen pixel format ++ */ ++static int mt9p031_v4l2_int_enum_framesizes(struct v4l2_int_device *s, ++ struct v4l2_frmsizeenum *frms) ++{ ++ int ifmt; ++ ++ for (ifmt = 0; ifmt < ARRAY_SIZE(mt9p031_formats); ifmt++) ++ if (mt9p031_formats[ifmt].pixelformat == frms->pixel_format) ++ break; ++ ++ if (ifmt == ARRAY_SIZE(mt9p031_formats)) ++ return -EINVAL; ++ ++ /* Do we already reached all discrete framesizes? */ ++ if (frms->index >= ARRAY_SIZE(mt9p031_sizes)) ++ return -EINVAL; ++ ++ frms->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frms->discrete.width = mt9p031_sizes[frms->index].width; ++ frms->discrete.height = mt9p031_sizes[frms->index].height; ++ ++ return 0; ++} ++ ++static int mt9p031_v4l2_int_enum_frameintervals(struct v4l2_int_device *s, ++ struct v4l2_frmivalenum *frmi) ++{ ++ int ifmt; ++ int max_size; ++ ++ for (ifmt = 0; ifmt < ARRAY_SIZE(mt9p031_formats); ifmt++) ++ if (mt9p031_formats[ifmt].pixelformat == frmi->pixel_format) ++ break; ++ ++ if (ifmt == ARRAY_SIZE(mt9p031_formats)) ++ return -EINVAL; ++ ++ max_size = ARRAY_SIZE(mt9p031_sizes); ++ ++ for(ifmt = 0; ifmt < max_size; ifmt++) { ++ if(frmi->width <= mt9p031_sizes[ifmt].width) { ++ frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frmi->discrete.numerator = ++ mt9p031_frameintervals[frmi->index].numerator; ++ frmi->discrete.denominator = ++ mt9p031_frameintervals[frmi->index].denominator; ++ ++ if(frmi->discrete.denominator <= mt9p031_frameintervals[max_size - ifmt - 1].denominator) ++ return 0; ++ else ++ return -EINVAL; ++ } ++ } ++ ++ return 0; ++} ++ ++static struct v4l2_int_ioctl_desc mt9p031_ioctl_desc[] = { ++ { .num = vidioc_int_enum_framesizes_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_enum_framesizes }, ++ { .num = vidioc_int_enum_frameintervals_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_enum_frameintervals }, ++ { .num = vidioc_int_s_power_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_s_power }, ++ { .num = vidioc_int_g_priv_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_g_priv }, ++ { .num = vidioc_int_g_ifparm_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_g_ifparm }, ++ { .num = vidioc_int_enum_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_enum_fmt_cap }, ++ { .num = vidioc_int_try_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_try_fmt_cap }, ++ { .num = vidioc_int_g_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_g_fmt_cap }, ++ { .num = vidioc_int_s_fmt_cap_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_s_fmt_cap }, ++ { .num = vidioc_int_g_parm_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_g_parm }, ++ { .num = vidioc_int_s_parm_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_int_s_parm }, ++ { .num = vidioc_int_g_ctrl_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_g_ctrl }, ++ { .num = vidioc_int_s_ctrl_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_s_ctrl }, ++ { .num = vidioc_int_queryctrl_num, ++ .func = (v4l2_int_ioctl_func *)mt9p031_v4l2_queryctrl }, ++}; ++ ++#ifdef MT9P031_DEBUG ++/** ++ * --------------------------------------------------------------------------------- ++ * Sysfs ++ * --------------------------------------------------------------------------------- ++ */ ++ ++/* Basic register read write support */ ++static u16 mt9p031_attr_basic_addr = 0x0000; ++ ++static ssize_t ++mt9p031_basic_reg_addr_show( struct device *dev, struct device_attribute *attr, char *buf) ++{ ++ return sprintf(buf, "0x%x\n", mt9p031_attr_basic_addr); ++} ++ ++static ssize_t ++mt9p031_basic_reg_addr_store( struct device *dev, struct device_attribute *attr, const char *buf, size_t n) ++{ ++ u16 val; ++ sscanf(buf, "%hx", &val); ++ mt9p031_attr_basic_addr = (u16) val; ++ return n; ++} ++ ++static DEVICE_ATTR( basic_reg_addr, S_IRUGO|S_IWUSR, mt9p031_basic_reg_addr_show, mt9p031_basic_reg_addr_store); ++ ++ ++static ssize_t ++mt9p031_basic_reg_val_show( struct device *dev, struct device_attribute *attr, char *buf) ++{ ++ u16 val; ++ int ret; ++ ret = mt9p031_reg_read(sysPriv.client, mt9p031_attr_basic_addr, &val); ++ if(ret < 0){ ++ printk(KERN_INFO "mt9p031: Basic register read failed"); ++ return 1; // nothing processed ++ } else { ++ return sprintf(buf, "0x%x\n", val); ++ } ++} ++ ++static ssize_t ++mt9p031_basic_reg_val_store( struct device *dev, struct device_attribute *attr, const char *buf, size_t n) ++{ ++ u32 val; ++ sscanf(buf, "%x", &val); ++ ++ if (mt9p031_reg_write(sysPriv.client, mt9p031_attr_basic_addr, (u16)val)) { ++ printk(KERN_INFO "mt9p031: Basic regiser write failed"); ++ return n; // nothing processed ++ } else { ++ return n; ++ } ++} ++static DEVICE_ATTR( basic_reg_val, S_IRUGO|S_IWUSR, mt9p031_basic_reg_val_show, mt9p031_basic_reg_val_store); ++ ++ ++/* Exposure time access support */ ++static ssize_t ++mt9p031_exposure_val_show( struct device *dev, struct device_attribute *attr, char *buf) ++{ ++ u32 val; ++ struct vcontrol *lvc; ++ int i = find_vctrl(V4L2_CID_EXPOSURE); ++ if (i < 0) ++ return -EINVAL; ++ lvc = &mt9p031_video_control[i]; ++ val = lvc->current_value; ++ ++ if(val < 0){ ++ printk(KERN_INFO "mt9p031: Exposure value read failed"); ++ return 1; // nothing processed ++ } else { ++ return sprintf(buf, "%d\n", val); ++ } ++} ++ ++ ++static ssize_t ++mt9p031_exposure_val_store( struct device *dev, struct device_attribute *attr, const char *buf, size_t n) ++{ ++ u32 val; ++ struct i2c_client *client; ++ struct vcontrol *lvc; ++ ++ sscanf(buf, "%d", &val); ++ client = sysPriv.client; ++ ++ lvc = &mt9p031_video_control[V4L2_CID_EXPOSURE]; ++ ++ if (mt9p031_set_exposure_time((u32)val, client, lvc)) { ++ printk(KERN_INFO "mt9p031: Exposure write failed"); ++ return n; // nothing processed ++ } else { ++ return n; ++ } ++} ++ ++static DEVICE_ATTR( exposure_val, S_IRUGO|S_IWUSR, mt9p031_exposure_val_show, mt9p031_exposure_val_store); ++ ++ ++/* Global Gain access support */ ++static ssize_t ++mt9p031_gain_val_show( struct device *dev, struct device_attribute *attr, char *buf) ++{ ++ u16 val; ++ struct vcontrol *lvc; ++ ++ int i = find_vctrl(V4L2_CID_GAIN); ++ if (i < 0) ++ return -EINVAL; ++ lvc = &mt9p031_video_control[i]; ++ val = lvc->current_value; ++ ++ if(val < 0){ ++ printk(KERN_INFO "mt9p031: Global Gain value read failed"); ++ return 1; // nothing processed ++ } else { ++ return sprintf(buf, "%d\n", val); ++ } ++} ++ ++static ssize_t ++mt9p031_gain_val_store( struct device *dev, struct device_attribute *attr, const char *buf, size_t n) ++{ ++ u16 val; ++ struct i2c_client *client; ++ struct vcontrol *lvc; ++ ++ sscanf(buf, "%hd", &val); ++ client = sysPriv.client; ++ ++ lvc = &mt9p031_video_control[V4L2_CID_GAIN]; ++ ++ if (mt9p031_set_gain(val, client, lvc)) { ++ printk(KERN_INFO "mt9p031: Global gain write failed"); ++ return n; // nothing processed ++ } else { ++ return n; ++ } ++} ++ ++static DEVICE_ATTR( gain_val, S_IRUGO|S_IWUSR, mt9p031_gain_val_show, mt9p031_gain_val_store); ++ ++ ++static struct attribute *mt9p031_sysfs_attr[] = { ++ &dev_attr_basic_reg_addr.attr, ++ &dev_attr_basic_reg_val.attr, ++ &dev_attr_exposure_val.attr, ++ &dev_attr_gain_val.attr, ++}; ++ ++static int mt9p031_sysfs_add(struct kobject *kobj) ++{ ++ int i = ARRAY_SIZE(mt9p031_sysfs_attr); ++ int rval = 0; ++ ++ do { ++ rval = sysfs_create_file(kobj, mt9p031_sysfs_attr[--i]); ++ } while((i > 0) && (rval == 0)); ++ return rval; ++} ++ ++static int mt9p031_sysfs_rm(struct kobject *kobj) ++{ ++ int i = ARRAY_SIZE(mt9p031_sysfs_attr); ++ int rval = 0; ++ ++ do { ++ sysfs_remove_file(kobj, mt9p031_sysfs_attr[--i]); ++ } while(i > 0); ++ return rval; ++} ++#endif //MT9P031_DEBUG ++ ++static struct v4l2_int_slave mt9p031_slave = { ++ .ioctls = mt9p031_ioctl_desc, ++ .num_ioctls = ARRAY_SIZE(mt9p031_ioctl_desc), ++}; ++ ++static int mt9p031_probe(struct i2c_client *client, ++ const struct i2c_device_id *did) ++{ ++ struct mt9p031_priv *priv; ++ struct v4l2_int_device *v4l2_int_device; ++ int ret; ++ if (!client->dev.platform_data) { ++ dev_err(&client->dev, "no platform data?\n"); ++ return -ENODEV; ++ } ++ ++ priv = kzalloc(sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ v4l2_int_device = kzalloc(sizeof(*v4l2_int_device), GFP_KERNEL); ++ if (!v4l2_int_device) { ++ kfree(priv); ++ return -ENOMEM; ++ } ++ ++#ifdef MT9P031_HEADBOARD ++ mt9p031_config_PCA9543A(client); //configure i2c level shifter on mt9p031 head-board, no need for Leopard module ++ mdelay(10); ++#endif //MT9P031_HEADBOARD ++ ++ v4l2_int_device->module = THIS_MODULE; ++ strncpy(v4l2_int_device->name, "mt9p031", sizeof(v4l2_int_device->name)); ++ ++ v4l2_int_device->type = v4l2_int_type_slave; ++ v4l2_int_device->u.slave = &mt9p031_slave; ++ ++ v4l2_int_device->priv = priv; ++ ++ priv->v4l2_int_device = v4l2_int_device; ++ priv->client = client; ++ priv->pdata = client->dev.platform_data; ++ ++ priv->pdata->flags = MT9P031_FLAG_PCLK_RISING_EDGE; ++ ++ /* Setting Pixel Values */ ++ priv->pix.width = mt9p031_sizes[0].width; ++ priv->pix.height = mt9p031_sizes[0].height; ++ priv->pix.pixelformat = mt9p031_formats[0].pixelformat; ++ ++ i2c_set_clientdata(client, priv); ++ ++ sysPriv.client = priv->client; ++ ++ ret = v4l2_int_device_register(priv->v4l2_int_device); ++ if (ret) { ++ i2c_set_clientdata(client, NULL); ++ kfree(v4l2_int_device); ++ kfree(priv); ++ } ++ ++#ifdef MT9P031_DEBUG ++ mt9p031_sysfs_add(&client->dev.kobj); ++#endif //MT9P031_DEBUG ++ return ret; ++} ++ ++static int mt9p031_remove(struct i2c_client *client) ++{ ++ struct mt9p031_priv *priv = i2c_get_clientdata(client); ++ ++ v4l2_int_device_unregister(priv->v4l2_int_device); ++ i2c_set_clientdata(client, NULL); ++ mt9p031_sysfs_rm(&client->dev.kobj); ++ ++ kfree(priv->v4l2_int_device); ++ kfree(priv); ++ return 0; ++} ++ ++static const struct i2c_device_id mt9p031_id[] = { ++ { "mt9p031", 0 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, mt9p031_id); ++ ++static struct i2c_driver mt9p031_i2c_driver = { ++ .driver = { ++ .name = "mt9p031", ++ }, ++ .probe = mt9p031_probe, ++ .remove = mt9p031_remove, ++ .id_table = mt9p031_id, ++}; ++ ++/************************************************************************ ++ module function ++************************************************************************/ ++static int __init mt9p031_module_init(void) ++{ ++ return i2c_add_driver(&mt9p031_i2c_driver); ++} ++ ++static void __exit mt9p031_module_exit(void) ++{ ++ i2c_del_driver(&mt9p031_i2c_driver); ++} ++ ++module_init(mt9p031_module_init); ++module_exit(mt9p031_module_exit); ++ ++MODULE_DESCRIPTION("mt9p031 sensor driver"); ++MODULE_AUTHOR("Aptina"); ++MODULE_LICENSE("GPL v2"); ++ +diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h +new file mode 100644 +index 0000000..d119589 +--- /dev/null ++++ b/include/media/mt9p031.h +@@ -0,0 +1,30 @@ ++/* mt9p031 Camera ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#ifndef __MT9P031_H__ ++#define __MT9P031_H__ ++ ++#include <media/v4l2-int-device.h> ++ ++#define MT9P031_I2C_ADDR 0x48 //(0x90 >> 1) ++ ++#define MT9P031_CLK_MAX (27000000) /* 27MHz */ ++#define MT9P031_CLK_MIN (6000000) /* 6Mhz */ ++ ++#define MT9P031_FLAG_PCLK_RISING_EDGE (1 << 0) ++#define MT9P031_FLAG_DATAWIDTH_8 (1 << 1) /* default width is 10 */ ++ ++struct mt9p031_platform_data { ++ char *master; ++ int (*power_set) (struct v4l2_int_device *s, enum v4l2_power on); ++ int (*ifparm) (struct v4l2_ifparm *p); ++ int (*priv_data_set) (void *); ++ u32 (*set_xclk) (struct v4l2_int_device *s, u32 xclkfreq); ++ u32 flags; ++}; ++ ++#endif /* __MT9P031_H__ */ +diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h +index 6cc107d..7599bf1 100644 +--- a/include/media/v4l2-chip-ident.h ++++ b/include/media/v4l2-chip-ident.h +@@ -271,6 +271,7 @@ enum { + V4L2_IDENT_MT9T112 = 45022, + V4L2_IDENT_MT9V111 = 45031, + V4L2_IDENT_MT9V112 = 45032, ++ V4L2_IDENT_MT9P031 = 6145, + + /* HV7131R CMOS sensor: just ident 46000 */ + V4L2_IDENT_HV7131R = 46000, +-- +1.6.6.1 + diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/5m03/0002-board-omap3beagle-import-li5m03-driver-from-https-gi.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/5m03/0002-board-omap3beagle-import-li5m03-driver-from-https-gi.patch new file mode 100644 index 00000000..2b45f197 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/5m03/0002-board-omap3beagle-import-li5m03-driver-from-https-gi.patch @@ -0,0 +1,294 @@ +From 675ad06f53fbb0c7f398aaff8c3508196dfeb9bc Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Sun, 1 May 2011 16:41:57 +0200 +Subject: [PATCH 2/2] board-omap3beagle: import li5m03 driver from https://github.com/Aptina/BeagleBoard-xM/tree/master/Angstrom/MT9P031 + +Properly hook it into the board file and some more updates + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + arch/arm/mach-omap2/board-omap3beagle-camera.c | 186 +++++++++++++++++++++++- + arch/arm/mach-omap2/board-omap3beagle.c | 20 +++ + 2 files changed, 198 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c +index 110c2c9..97f0e7a 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c ++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c +@@ -160,6 +160,8 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + case V4L2_POWER_ON: + + isp_configure_interface(vdev->cam->isp, &mt9v113_if_config); ++ /* Set RESET_BAR to 0 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 0); + + /* turn on VDD */ + regulator_enable(cam_1v8_reg); +@@ -168,9 +170,6 @@ static int mt9v113_power_set(struct v4l2_int_device *s, enum v4l2_power power) + regulator_enable(cam_2v8_reg); + mdelay(50); + +- /* Set RESET_BAR to 0 */ +- gpio_set_value(LEOPARD_RESET_GPIO, 0); +- + /* Enable EXTCLK */ + isp_set_xclk(vdev->cam->isp, MT9V113_CLK_MIN*2, CAM_USE_XCLKA); + /* +@@ -294,7 +293,7 @@ static int mt9t112_set_prv_data(void *priv) + } + + /** +- * @brief mt9t112_power_set - Power-on or power-off TVP5146 device ++ * @brief mt9t112_power_set - Power-on or power-off MT9T112 device + * + * @param power - enum, Power on/off, resume/standby + * +@@ -320,6 +319,8 @@ static int mt9t112_power_set(struct v4l2_int_device *s, enum v4l2_power power) + isp_configure_interface(vdev->cam->isp, &mt9t112_if_config); + #endif + ++ /* Set RESET_BAR to 0 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 0); + + /* turn on VDD */ + regulator_enable(cam_1v8_reg); +@@ -331,11 +332,8 @@ static int mt9t112_power_set(struct v4l2_int_device *s, enum v4l2_power power) + + mdelay(50); + +- /* Set RESET_BAR to 0 */ +- gpio_set_value(LEOPARD_RESET_GPIO, 0); +- + /* Enable EXTCLK */ +- isp_set_xclk(vdev->cam->isp, 24000000, CAM_USE_XCLKA); ++ isp_set_xclk(vdev->cam->isp, 12000000, CAM_USE_XCLKA); + + /* + * Wait at least 70 CLK cycles (w/EXTCLK = 24MHz): +@@ -372,6 +370,178 @@ struct mt9t112_platform_data mt9t112_pdata = { + + #endif /* #ifdef CONFIG_VIDEO_MT9T112 */ + ++#if defined(CONFIG_SOC_CAMERA_MT9P031) || defined(CONFIG_SOC_CAMERA_MT9P031_MODULE) ++#include <media/mt9p031.h> ++ ++#define ISP_MT9P031_MCLK 216000000 ++ ++/* Arbitrary memory handling limit */ ++#define MT9P031_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN((2592 * 1944) * 2 * 4 ) ++ ++static struct isp_interface_config mt9p031_if_config = { ++ .ccdc_par_ser = ISP_PARLL, ++ .dataline_shift = 0x1, ++ .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE, ++ .strobe = 0x0, ++ .prestrobe = 0x0, ++ .shutter = 0x0, ++ .cam_mclk = ISP_MT9P031_MCLK, ++ .wenlog = ISPCCDC_CFG_WENLOG_AND, ++ .wait_hs_vs = 2, ++ .u.par.par_bridge = 0x0, ++ .u.par.par_clk_pol = 0x0, ++}; ++ ++static struct v4l2_ifparm mt9p031_ifparm_s = { ++ .if_type = V4L2_IF_TYPE_RAW, ++ .u = { ++ .raw = { ++ .frame_start_on_rising_vs = 1, ++ .bt_sync_correct = 0, ++ .swap = 0, ++ .latch_clk_inv = 0, ++ .nobt_hs_inv = 0, /* active high */ ++ .nobt_vs_inv = 0, /* active high */ ++ .clock_min = MT9P031_CLK_MIN, ++ .clock_max = MT9P031_CLK_MAX, ++ }, ++ }, ++}; ++ ++/** ++ * @brief mt9p031_ifparm - Returns the mt9p031 interface parameters ++ * ++ * @param p - pointer to v4l2_ifparm structure ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9p031_ifparm(struct v4l2_ifparm *p) ++{ ++ if (p == NULL) ++ return -EINVAL; ++ ++ *p = mt9p031_ifparm_s; ++ return 0; ++} ++ ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++static struct omap34xxcam_hw_config mt9p031_hwc = { ++ .dev_index = 1, ++ .dev_minor = -1, ++ .dev_type = OMAP34XXCAM_SLAVE_SENSOR, ++ .u.sensor.sensor_isp = 0, ++ .u.sensor.capture_mem = MT9P031_BIGGEST_FRAME_BYTE_SIZE, ++ .u.sensor.ival_default = { 1, 30 }, ++}; ++#endif ++ ++/** ++ * @brief mt9p031_set_prv_data - Returns mt9p031 omap34xx driver private data ++ * ++ * @param priv - pointer to omap34xxcam_hw_config structure ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9p031_set_prv_data(void *priv) ++{ ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++ struct omap34xxcam_hw_config *hwc = priv; ++ ++ if (priv == NULL) ++ return -EINVAL; ++ ++ *hwc = mt9p031_hwc; ++ return 0; ++#else ++ return -EINVAL; ++#endif ++} ++ ++/** ++ * @brief mt9p031_power_set - Power-on or power-off mt9p031 device ++ * ++ * @param power - enum, Power on/off, resume/standby ++ * ++ * @return result of operation - 0 is success ++ */ ++static int mt9p031_power_set(struct v4l2_int_device *s, enum v4l2_power power) ++{ ++ struct omap34xxcam_videodev *vdev = s->u.slave->master->priv; ++ switch (power) { ++ case V4L2_POWER_OFF: ++ case V4L2_POWER_STANDBY: ++ isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA); ++ ++ if (regulator_is_enabled(cam_1v8_reg)) ++ regulator_disable(cam_1v8_reg); ++ if (regulator_is_enabled(cam_2v8_reg)) ++ regulator_disable(cam_2v8_reg); ++ break; ++ ++ case V4L2_POWER_ON: ++#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) ++ isp_configure_interface(vdev->cam->isp, &mt9p031_if_config); ++#endif ++ ++ /* Set RESET_BAR to 0 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 0); ++ ++ /* turn on VDD */ ++ regulator_enable(cam_1v8_reg); ++ ++ mdelay(1); ++ ++ /* turn on VDD_IO */ ++ regulator_enable(cam_2v8_reg); ++ ++ mdelay(50); ++ ++ /* Enable EXTCLK */ ++ isp_set_xclk(vdev->cam->isp, 24000000, CAM_USE_XCLKA); //works for 36MHz too; try at lower freq ++ ++ /* ++ * Wait at least 70 CLK cycles (w/EXTCLK = 24MHz): ++ * ((1000000 * 70) / 24000000) = aprox 2.91 us. ++ */ ++ ++ udelay(3); ++ ++ /* Set RESET_BAR to 1 */ ++ gpio_set_value(LEOPARD_RESET_GPIO, 1); ++ ++ /* ++ * Wait at least 100 CLK cycles (w/EXTCLK = 24MHz): ++ * ((1000000 * 100) / 24000000) = aprox 4.16 us. ++ */ ++ ++ udelay(5); ++ ++ break; ++ ++ default: ++ return -ENODEV; ++ break; ++ } ++ return 0; ++} ++ ++static u32 mt9p031_set_xclk(struct v4l2_int_device *s, u32 xclkfreq) ++{ ++ struct omap34xxcam_videodev *vdev = s->u.slave->master->priv; ++ return isp_set_xclk(vdev->cam->isp, xclkfreq, 0); ++} ++ ++ ++struct mt9p031_platform_data mt9p031_pdata = { ++ .master = "omap34xxcam", ++ .power_set = mt9p031_power_set, ++ .set_xclk = mt9p031_set_xclk, ++ .priv_data_set = mt9p031_set_prv_data, ++ .ifparm = mt9p031_ifparm, ++}; ++ ++#endif /* #ifdef CONFIG_SOC_CAMERA_MT9P031 */ ++ + static int beagle_cam_probe(struct platform_device *pdev) + { + cam_1v8_reg = regulator_get(&pdev->dev, "cam_1v8"); +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 2677b41..e561431 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -83,6 +83,12 @@ extern struct mt9v113_platform_data mt9v113_pdata; + extern struct mt9t112_platform_data mt9t112_pdata; + #endif + ++#if defined(CONFIG_SOC_CAMERA_MT9P031) || defined(CONFIG_SOC_CAMERA_MT9P031_MODULE) ++#include <media/v4l2-int-device.h> ++#include <media/mt9p031.h> ++extern struct mt9p031_platform_data mt9p031_pdata; ++#endif ++ + #define GPMC_CS0_BASE 0x60 + #define GPMC_CS_SIZE 0x30 + +@@ -614,6 +620,15 @@ static struct i2c_board_info __initdata beagle_lbcm3m1_i2c2_boardinfo[] = { + #endif + }; + ++static struct i2c_board_info __initdata beagle_lbcm5m03_i2c2_boardinfo[] = { ++#if defined(CONFIG_SOC_CAMERA_MT9P031) || defined(CONFIG_SOC_CAMERA_MT9P031_MODULE) ++ { ++ I2C_BOARD_INFO("mt9p031", MT9P031_I2C_ADDR), ++ .platform_data = &mt9p031_pdata, ++ }, ++#endif ++}; ++ + static int __init omap3_beagle_i2c_init(void) + { + omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo, +@@ -636,6 +651,11 @@ static int __init omap3_beagle_i2c_init(void) + " registering i2c2 bus for lbcm3m1\n"); + omap_register_i2c_bus(2, 400, beagle_lbcm3m1_i2c2_boardinfo, + ARRAY_SIZE(beagle_lbcm3m1_i2c2_boardinfo)); ++ } else if (!strcmp(cameraboard_name, "lbcm5m03")) { ++ printk(KERN_INFO "Beagle cameraboard:" ++ " registering i2c2 bus for lbcm5m03\n"); ++ omap_register_i2c_bus(2, 400, beagle_lbcm5m03_i2c2_boardinfo, ++ ARRAY_SIZE(beagle_lbcm5m03_i2c2_boardinfo)); + } else { + omap_register_i2c_bus(2, 400, NULL, 0); + } +-- +1.6.6.1 + |