]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
media: platform: tegra: OV5693: Add 2592x1458 mode
authorFrank Chen <frankc@nvidia.com>
Thu, 12 Mar 2015 21:42:40 +0000 (14:42 -0700)
committerJihoon Bang <jbang@nvidia.com>
Thu, 23 Jul 2015 22:33:40 +0000 (15:33 -0700)
Add 2592x1458 as the biggest 16:9 mode for OV5693.

Bug 1636345

Change-Id: Ic772a7314f7cabc04a0d9bfe4ce6076f5106d8e0
Signed-off-by: David Wang <davidw@nvidia.com>
(cherry picked from commit 4884f09f6f66008fb11347ef3c1fa2ef0a4eb541)
Reviewed-on: http://git-master/r/737927
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
drivers/media/platform/tegra/ov5693.c

index 7ba8c6eb89260cfa70f2eafc0d90efecf477be68..8941772e4e8de0fcb48d21bec1aa3bad83122360 100644 (file)
@@ -884,6 +884,263 @@ static const struct reg_8 ov5693_1920x1080_i2c[] = {
        {OV5693_TABLE_END, 0x0000}
 };
 
+static const struct reg_8 ov5693_2592x1458_i2c[] = {
+       {0x0100, 0x00},/*, 0xIncluding, 0xsw, 0xreset, 0x*/
+       {0x3001, 0x0a},
+       {0x3002, 0x80},
+       {0x3006, 0x00},
+       {0x3011, 0x21},
+       {0x3012, 0x09},
+       {0x3013, 0x10},
+       {0x3014, 0x00},
+       {0x3015, 0x08},
+       {0x3016, 0xf0},
+       {0x3017, 0xf0},
+       {0x3018, 0xf0},
+       {0x301b, 0xb4},
+       {0x301d, 0x02},
+       {0x3021, 0x00},
+       {0x3022, 0x01},
+       {0x3028, 0x44},
+       {0x3098, 0x03},
+       {0x3099, 0x1e},
+       {0x309a, 0x02},
+       {0x309b, 0x01},
+       {0x309c, 0x00},
+       {0x30a0, 0xd2},
+       {0x30a2, 0x01},
+       {0x30b2, 0x00},
+       {0x30b3, 0x68},
+       {0x30b4, 0x03},
+       {0x30b5, 0x04},
+       {0x30b6, 0x01},
+       {0x3104, 0x21},
+       {0x3106, 0x00},
+       {0x3400, 0x04},
+       {0x3401, 0x00},
+       {0x3402, 0x04},
+       {0x3403, 0x00},
+       {0x3404, 0x04},
+       {0x3405, 0x00},
+       {0x3406, 0x01},
+       {0x3500, 0x00},
+       {0x3501, 0x7b},
+       {0x3502, 0x00},
+       {0x3503, 0x07},
+       {0x3504, 0x00},
+       {0x3505, 0x00},
+       {0x3506, 0x00},
+       {0x3507, 0x02},
+       {0x3508, 0x00},
+       {0x3509, 0x10},
+       {0x350a, 0x00},
+       {0x350b, 0x40},
+       {0x3600, 0xbc},
+       {0x3601, 0x0a},
+       {0x3602, 0x38},
+       {0x3612, 0x80},
+       {0x3620, 0x44},
+       {0x3621, 0xb5},
+       {0x3622, 0x0c},
+       {0x3625, 0x10},
+       {0x3630, 0x55},
+       {0x3631, 0xf4},
+       {0x3632, 0x00},
+       {0x3633, 0x34},
+       {0x3634, 0x02},
+       {0x364d, 0x0d},
+       {0x364f, 0xdd},
+       {0x3660, 0x04},
+       {0x3662, 0x10},
+       {0x3663, 0xf1},
+       {0x3665, 0x00},
+       {0x3666, 0x20},
+       {0x3667, 0x00},
+       {0x366a, 0x80},
+       {0x3680, 0xe0},
+       {0x3681, 0x00},
+       {0x3700, 0x42},
+       {0x3701, 0x14},
+       {0x3702, 0xa0},
+       {0x3703, 0xd8},
+       {0x3704, 0x78},
+       {0x3705, 0x02},
+       {0x3708, 0xe2},
+       {0x3709, 0xc3},
+       {0x370a, 0x00},
+       {0x370b, 0x20},
+       {0x370c, 0x0c},
+       {0x370d, 0x11},
+       {0x370e, 0x00},
+       {0x370f, 0x40},
+       {0x3710, 0x00},
+       {0x371a, 0x1c},
+       {0x371b, 0x05},
+       {0x371c, 0x01},
+       {0x371e, 0xa1},
+       {0x371f, 0x0c},
+       {0x3721, 0x00},
+       {0x3724, 0x10},
+       {0x3726, 0x00},
+       {0x372a, 0x01},
+       {0x3730, 0x10},
+       {0x3738, 0x22},
+       {0x3739, 0xe5},
+       {0x373a, 0x50},
+       {0x373b, 0x02},
+       {0x373c, 0x41},
+       {0x373f, 0x02},
+       {0x3740, 0x42},
+       {0x3741, 0x02},
+       {0x3742, 0x18},
+       {0x3743, 0x01},
+       {0x3744, 0x02},
+       {0x3747, 0x10},
+       {0x374c, 0x04},
+       {0x3751, 0xf0},
+       {0x3752, 0x00},
+       {0x3753, 0x00},
+       {0x3754, 0xc0},
+       {0x3755, 0x00},
+       {0x3756, 0x1a},
+       {0x3758, 0x00},
+       {0x3759, 0x0f},
+       {0x376b, 0x44},
+       {0x375c, 0x04},
+       {0x3774, 0x10},
+       {0x3776, 0x00},
+       {0x377f, 0x08},
+       {0x3780, 0x22},
+       {0x3781, 0x0c},
+       {0x3784, 0x2c},
+       {0x3785, 0x1e},
+       {0x378f, 0xf5},
+       {0x3791, 0xb0},
+       {0x3795, 0x00},
+       {0x3796, 0x64},
+       {0x3797, 0x11},
+       {0x3798, 0x30},
+       {0x3799, 0x41},
+       {0x379a, 0x07},
+       {0x379b, 0xb0},
+       {0x379c, 0x0c},
+       {0x37c5, 0x00},
+       {0x37c6, 0x00},
+       {0x37c7, 0x00},
+       {0x37c9, 0x00},
+       {0x37ca, 0x00},
+       {0x37cb, 0x00},
+       {0x37de, 0x00},
+       {0x37df, 0x00},
+       {0x3800, 0x00},
+       {0x3801, 0x00},
+       {0x3802, 0x00},
+       {0x3803, 0xf4},
+       {0x3804, 0x0a},
+       {0x3805, 0x3f},
+       {0x3806, 0x06},
+       {0x3807, 0xb1},
+       {0x3808, 0x0a},
+       {0x3809, 0x20},
+       {0x380a, 0x05},
+       {0x380b, 0xb2},
+       {0x380c, 0x0a},
+       {0x380d, 0x80},
+       {0x380e, 0x07},
+       {0x380f, 0xc0},
+       {0x3810, 0x00},
+       {0x3811, 0x10},
+       {0x3812, 0x00},
+       {0x3813, 0x06},
+       {0x3814, 0x11},
+       {0x3815, 0x11},
+       {0x3820, 0x00},
+       {0x3821, 0x1e},
+       {0x3823, 0x00},
+       {0x3824, 0x00},
+       {0x3825, 0x00},
+       {0x3826, 0x00},
+       {0x3827, 0x00},
+       {0x382a, 0x04},
+       {0x3a04, 0x06},
+       {0x3a05, 0x14},
+       {0x3a06, 0x00},
+       {0x3a07, 0xfe},
+       {0x3b00, 0x00},
+       {0x3b02, 0x00},
+       {0x3b03, 0x00},
+       {0x3b04, 0x00},
+       {0x3b05, 0x00},
+       {0x3e07, 0x20},
+       {0x4000, 0x08},
+       {0x4001, 0x04},
+       {0x4002, 0x45},
+       {0x4004, 0x08},
+       {0x4005, 0x18},
+       {0x4006, 0x20},
+       {0x4008, 0x24},
+       {0x4009, 0x10},
+       {0x400c, 0x00},
+       {0x400d, 0x00},
+       {0x4058, 0x00},
+       {0x404e, 0x37},
+       {0x404f, 0x8f},
+       {0x4058, 0x00},
+       {0x4101, 0xb2},
+       {0x4303, 0x00},
+       {0x4304, 0x08},
+       {0x4307, 0x30},
+       {0x4311, 0x04},
+       {0x4315, 0x01},
+       {0x4511, 0x05},
+       {0x4512, 0x01},
+       {0x4800, 0x20}, /* dis-continuous */
+       {0x4806, 0x00},
+       {0x4816, 0x52},
+       {0x481f, 0x30},
+       {0x4826, 0x2c},
+       {0x4831, 0x64},
+       {0x4d00, 0x04},
+       {0x4d01, 0x71},
+       {0x4d02, 0xfd},
+       {0x4d03, 0xf5},
+       {0x4d04, 0x0c},
+       {0x4d05, 0xcc},
+       {0x4837, 0x0a},
+       {0x5000, 0x06},
+       {0x5001, 0x01},
+       {0x5002, 0x00},
+       {0x5003, 0x20},
+       {0x5046, 0x0a},
+       {0x5013, 0x00},
+       {0x5046, 0x0a},
+       {0x5780, 0xfc},
+       {0x5781, 0x13},
+       {0x5782, 0x03},
+       {0x5786, 0x20},
+       {0x5787, 0x40},
+       {0x5788, 0x08},
+       {0x5789, 0x08},
+       {0x578a, 0x02},
+       {0x578b, 0x01},
+       {0x578c, 0x01},
+       {0x578d, 0x0c},
+       {0x578e, 0x02},
+       {0x578f, 0x01},
+       {0x5790, 0x01},
+       {0x5791, 0xff},
+       {0x5842, 0x01},
+       {0x5843, 0x2b},
+       {0x5844, 0x01},
+       {0x5845, 0x92},
+       {0x5846, 0x01},
+       {0x5847, 0x8f},
+       {0x5848, 0x01},
+       {0x5849, 0x0c},
+       {0x5e00, 0x00},
+       {0x5e10, 0x0c},
+       {OV5693_TABLE_END, 0x0000}
+};
 
 static const struct reg_8 ov5693_1280x720_120fps_i2c[] = {
        {0x0100, 0x00},/* Including sw reset */
@@ -2127,6 +2384,7 @@ static const struct reg_8 ov5693_1280x720_HDR_60fps_i2c[] = {
 enum {
        OV5693_MODE_2592x1944 = 0,
        OV5693_MODE_1920x1080,
+       OV5693_MODE_2592x1458,
        OV5693_MODE_1296x972,
        OV5693_MODE_1280x720_120FPS,
        OV5693_MODE_2592x1944_HDR,
@@ -2138,6 +2396,7 @@ enum {
 static const struct reg_8 *mode_table[] = {
        [OV5693_MODE_2592x1944]         = ov5693_2592x1944_i2c,
        [OV5693_MODE_1920x1080]         = ov5693_1920x1080_i2c,
+       [OV5693_MODE_2592x1458]         = ov5693_2592x1458_i2c,
        [OV5693_MODE_1296x972]          = ov5693_1296x972_i2c,
        [OV5693_MODE_1280x720_120FPS]   = ov5693_1280x720_120fps_i2c,
        [OV5693_MODE_2592x1944_HDR]     = ov5693_2592x1944_HDR_24fps_i2c,
@@ -2895,6 +3154,13 @@ static int ov5693_set_mode(struct ov5693_info *info,
        u32 mode_index = 0;
        int err = 0;
 
+       dev_info(&info->i2c_client->dev,
+                       "[OV5693] sensor %s:%d ++\n", __func__, __LINE__);
+       dev_info(&info->i2c_client->dev,
+                        "%s: xres %u yres %u framelength %u coarsetime %u gain %u, hdr %d\n",
+                        __func__, mode->res_x, mode->res_y, mode->frame_length,
+                        mode->coarse_time, mode->gain, mode->hdr_en);
+
        if (!mode->res_x && !mode->res_y) {
                if (mode->frame_length || mode->coarse_time || mode->gain) {
                        /* write exposure only */
@@ -2923,6 +3189,8 @@ static int ov5693_set_mode(struct ov5693_info *info,
                        mode_index = OV5693_MODE_1296x972;
                else if (mode->res_x == 1920 && mode->res_y == 1080)
                        mode_index = OV5693_MODE_1920x1080;
+               else if (mode->res_x == 2592 && mode->res_y == 1458)
+                       mode_index = OV5693_MODE_2592x1458;
                else if (mode->res_x == 1280 && mode->res_y == 720)
                        mode_index = OV5693_MODE_1280x720_120FPS;
        }