summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorKrupal Divvela <kdivvela@nvidia.com>2012-02-06 11:21:22 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-02-17 07:45:37 -0800
commit94d7f846868c87748f3ab17cbc8d100f5bf0d896 (patch)
treee04375fed87a97699706354d5ebca0dcfcce97f5 /drivers/media
parentfa554fc5842695970f5568a129a61bafaf7c998a (diff)
media: video: ov14810: Add new 720p mode
Add a new 1280x720@120 fps - 4lane mode to ov14810 sensor. Bug 935663 Change-Id: I3e8e552071e41bf6932582ae3a0b2467b380eecd Signed-off-by: Krupal Divvela <kdivvela@nvidia.com> Reviewed-on: http://git-master/r/84041 Reviewed-by: Amit Arora <amita@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/tegra/ov14810.c152
1 files changed, 150 insertions, 2 deletions
diff --git a/drivers/media/video/tegra/ov14810.c b/drivers/media/video/tegra/ov14810.c
index d8563edc73b6..2efd283b32b5 100644
--- a/drivers/media/video/tegra/ov14810.c
+++ b/drivers/media/video/tegra/ov14810.c
@@ -715,12 +715,147 @@ static struct ov14810_reg mode_4416x3312[] = {
{OV14810_TABLE_END, 0x0000}
};
+static struct ov14810_reg mode_1280x720[] = {
+ {0x0103, 0x01},
+ {OV14810_TABLE_WAIT_MS, 20},
+
+ {0x3003, 0x0a},
+ {0x3004, 0x00},
+ {0x3005, 0xa7},
+ {0x3006, 0x80},
+ {0x3007, 0x08},
+
+ {0x3018, 0x04},
+ {0x301b, 0xe0},
+ {0x301c, 0xf8},
+ {0x3020, 0x01},
+ {0x3106, 0x05},
+ {0x3600, 0x2d},
+ {0x3601, 0x1f},
+ {0x3609, 0x00},
+ {0x360a, 0x2e},
+ {0x360f, 0x24},
+ {0x3611, 0x6c},
+ {0x3613, 0x84},
+ {0x3702, 0x20},
+ {0x3704, 0x28},
+ {0x3705, 0xd1},
+ {0x3708, 0x01},
+ {0x370e, 0x04},
+ {0x3710, 0x40},
+ {0x3711, 0x1c},
+ {0x3714, 0x5f},
+ {0x3715, 0x58},
+ {0x3717, 0x80},
+ {0x3718, 0x11},
+ {0x3719, 0x11},
+ {0x371b, 0xa0},
+ {0x371c, 0x46},
+ {0x371d, 0x40},
+ {0x371e, 0x2c},
+ {0x3723, 0x30},
+ {0x3725, 0x2e},
+ {0x3726, 0x70},
+ {0x3808, 0x00},
+ {0x380a, 0x00},
+ {0x3817, 0x24},
+ {0x3819, 0x80},
+ {0x382c, 0x02},
+ {0x382d, 0x01},
+ {0x3a00, 0x78},
+ {0x3a13, 0x46},
+ {0x3a18, 0x00},
+ {0x3a19, 0x7f},
+ {0x3a1a, 0x06},
+ {0x3a25, 0x83},
+ {0x3b09, 0x0a},
+ {0x4002, 0xc5},
+ {0x4004, 0x02},
+ {0x4005, 0x10},
+ {0x4009, 0x40},
+ {0x404f, 0xff},
+ {0x4709, 0x00},
+ {0x4801, 0x0f},
+ {0x4806, 0x80},
+ {0x4842, 0x01},
+ {0x5000, 0x00},
+ {0x5001, 0x00},
+ {0x5002, 0x00},
+ {0x503b, 0x01},
+ {0x503c, 0x10},
+ {0x5041, 0x0e},
+ {0x5780, 0xfc},
+ {0x5b00, 0x10},
+ {0x5b01, 0x5b},
+ {0x5b03, 0x00},
+
+
+ {0x3005, 0xa7},
+ {0x3006, 0x80},
+ {0x3007, 0x08},
+ {0x3013, 0x1f},
+
+ {0x3602, 0x53},
+ {0x3604, 0x80},
+ {0x3605, 0x01},
+ {0x360b, 0x0c},
+ {0x360c, 0x45},
+ {0x360d, 0x03},
+ {0x3614, 0x05},
+
+ {0x3707, 0x73},
+ {0x370a, 0x81},
+ {0x370b, 0x20},
+ {0x370c, 0x04},
+ {0x370d, 0x01},
+ {0x370f, 0x00},
+ {0x3713, 0xe6},
+ {0x3716, 0xf0},
+ {0x3721, 0x08},
+ {0x3724, 0x2e},
+ {0x3727, 0x60},
+ {0x3728, 0x02},
+
+ {0x3803, 0x07},
+ {0x3804, 0x05}, /* width */
+ {0x3805, 0x09},
+ {0x3806, 0x02}, /* height */
+ {0x3807, 0xd8},
+ {0x380c, 0x05},
+ {0x380d, 0x66},
+ {0x380e, 0x02},
+ {0x380f, 0xe4},
+ {0x3810, 0x22},
+ {0x3811, 0x02},
+ {0x3818, 0x45},
+ {0x381c, 0x13},
+ {0x381d, 0xb8},
+ {0x381e, 0x05}, /* height w/o skipping */
+ {0x381f, 0xc0},
+ {0x3820, 0x03},
+ {0x3821, 0xa8},
+ {0x3503, 0x13}, /* Manual exposure, gain control */
+
+ {0x4050, 0xc0},
+ {0x4051, 0x00},
+ {0x4053, 0xa1},
+ {0x4837, 0x1b},
+ {0x503d, 0x00},
+ {0x5042, 0x31},
+ {0x5047, 0x00},
+
+ {0x100, 0x01},
+ {OV14810_TABLE_END, 0x0000}
+};
+
enum {
- OV14810_MODE_4416x3312
+ OV14810_MODE_4416x3312,
+ OV14810_MODE_1280x720
};
static struct ov14810_reg *mode_table[] = {
[OV14810_MODE_4416x3312] = mode_4416x3312,
+ [OV14810_MODE_1280x720] = mode_1280x720
};
static inline void ov14810_get_frame_length_regs(struct ov14810_reg *regs,
@@ -821,6 +956,11 @@ static int ov14810_write_table(struct ov14810_info *info,
for (next = table; next->addr != OV14810_TABLE_END; next++) {
val = next->val;
+ if (next->addr == OV14810_TABLE_WAIT_MS) {
+ msleep(val);
+ continue;
+ }
+
/* When an override list is passed in, replace the reg */
/* value to write if the reg is in the list */
if (override_list) {
@@ -845,7 +985,15 @@ static int ov14810_set_mode(struct ov14810_info *info, struct ov14810_mode *mode
pr_info("%s: xres %u yres %u framelength %u coarsetime %u gain %u\n",
__func__, mode->xres, mode->yres, mode->frame_length,
mode->coarse_time, mode->gain);
- sensor_mode = OV14810_MODE_4416x3312;
+ if (mode->xres == 1280 && mode->yres == 720)
+ sensor_mode = OV14810_MODE_1280x720;
+ else if (mode->xres == 4416 && mode->yres == 3312)
+ sensor_mode = OV14810_MODE_4416x3312;
+ else {
+ pr_err("%s: invalid resolution supplied to set mode %d %d\n",
+ __func__, mode->xres, mode->yres);
+ return -EINVAL;
+ }
/* get a list of override regs for the asking frame length, */
/* coarse integration time, and gain. */