media: video: tegra: IMX135: 640x480 120fps mode
Frank Chen [Fri, 30 Aug 2013 17:52:27 +0000 (10:52 -0700)]
Add 640x480 120fps slow motion mode for IMX135

bug 1302356

Change-Id: Ia5a4006e66ddb93e1c4fda76ee246594604ea35c
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: http://git-master/r/268632
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Breczinski <pbreczinski@nvidia.com>
Reviewed-by: Charlie Huang <chahuang@nvidia.com>
Tested-by: David Wang (SW-TEGRA) <davidw@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

drivers/media/video/tegra/imx135.c
drivers/media/video/tegra/imx135_tables.h

index dda52df..3723f75 100644 (file)
@@ -302,6 +302,9 @@ imx135_set_mode(struct imx135_info *info, struct imx135_mode *mode)
                } else if (mode->xres == 1280 && mode->yres == 720) {
                        sensor_mode = IMX135_MODE_1280X720;
                        quality_hdr = 0;
+               } else if (mode->xres == 640 && mode->yres == 480) {
+                       sensor_mode = IMX135_MODE_640X480;
+                       quality_hdr = 0;
                } else {
                        pr_err("%s: invalid resolution supplied to set mode %d %d\n",
                                 __func__, mode->xres, mode->yres);
index f05c75a..723fc69 100644 (file)
@@ -1706,6 +1706,169 @@ static struct imx135_reg mode_1920x1080[] = {
        {IMX135_TABLE_END, 0x00}
 };
 
+static struct imx135_reg mode_640x480[] = {
+       /* software reset */
+       {0x0103, 0x01},
+       /* global settings */
+       {0x0101, 0x00},
+       {0x0105, 0x01},
+       {0x0110, 0x00},
+       {0x0220, 0x01},
+       {0x3302, 0x11},
+       {0x3833, 0x20},
+       {0x3893, 0x00},
+       {0x3906, 0x08},
+       {0x3907, 0x01},
+       {0x391B, 0x01},
+       {0x3C09, 0x01},
+       {0x600A, 0x00},
+       {0x3008, 0xB0},
+       {0x320A, 0x01},
+       {0x320D, 0x10},
+       {0x3216, 0x2E},
+       {0x322C, 0x02},
+       {0x3409, 0x0C},
+       {0x340C, 0x2D},
+       {0x3411, 0x39},
+       {0x3414, 0x1E},
+       {0x3427, 0x04},
+       {0x3480, 0x1E},
+       {0x3484, 0x1E},
+       {0x3488, 0x1E},
+       {0x348C, 0x1E},
+       {0x3490, 0x1E},
+       {0x3494, 0x1E},
+       {0x3511, 0x8F},
+       {0x364F, 0x2D},
+
+       /* Clock Setting */
+       {0x011E, 0x18},
+       {0x011F, 0x00},
+       {0x0301, 0x05},
+       {0x0303, 0x01},
+       {0x0305, 0x0C},
+       {0x0309, 0x05},
+       {0x030B, 0x02},
+       {0x030C, 0x01},
+       {0x030D, 0x59},
+       {0x030E, 0x01},
+       {0x3A06, 0x12},
+
+       /* Mode Settings */
+       {0x0108, 0x03},
+       {0x0112, 0x0A},
+       {0x0113, 0x0A},
+       {0x0381, 0x01},
+       {0x0383, 0x01},
+       {0x0385, 0x01},
+       {0x0387, 0x01},
+       {0x0390, 0x01},
+       {0x0391, 0x44},
+       {0x0392, 0x00},
+       {0x0401, 0x00},
+       {0x0404, 0x00},
+       {0x0405, 0x10},
+       {0x4082, 0x01},
+       {0x4083, 0x01},
+       {0x7006, 0x04},
+
+       /* Optinal/Function settings */
+       {0x0700, 0x00},
+       {0x3A63, 0x00},
+       {0x4100, 0xF8},
+       {0x4203, 0xFF},
+       {0x4344, 0x00},
+       {0x441C, 0x01},
+
+       /* Size Setting */
+       {0x0340, 0x01},
+       {0x0341, 0xF6},
+       {0x0342, 0x11},
+       {0x0343, 0xDC},
+       {0x0344, 0x03},
+       {0x0345, 0x38},
+       {0x0346, 0x02},
+       {0x0347, 0x58},
+       {0x0348, 0x0D},
+       {0x0349, 0x37},
+       {0x034A, 0x09},
+       {0x034B, 0xD7},
+       {0x034C, 0x02},
+       {0x034D, 0x80},
+       {0x034E, 0x01},
+       {0x034F, 0xE0},
+       {0x0350, 0x00},
+       {0x0351, 0x00},
+       {0x0352, 0x00},
+       {0x0353, 0x00},
+       {0x0354, 0x02},
+       {0x0355, 0x80},
+       {0x0356, 0x01},
+       {0x0357, 0xE0},
+       {0x301D, 0x30},
+       {0x3310, 0x02},
+       {0x3311, 0x80},
+       {0x3312, 0x01},
+       {0x3313, 0xE0},
+       {0x331C, 0x01},
+       {0x331D, 0xE4},
+       {0x4084, 0x00},
+       {0x4085, 0x00},
+       {0x4086, 0x00},
+       {0x4087, 0x00},
+       {0x4400, 0x00},
+
+       /* Global Timing Setting */
+       {0x0830, 0x5F},
+       {0x0831, 0x1F},
+       {0x0832, 0x3F},
+       {0x0833, 0x1F},
+       {0x0834, 0x1F},
+       {0x0835, 0x17},
+       {0x0836, 0x67},
+       {0x0837, 0x27},
+       {0x0839, 0x1F},
+       {0x083A, 0x17},
+       {0x083B, 0x02},
+
+       /* Integration Time Setting */
+       {0x0202, 0x01},
+       {0x0203, 0xF2},
+
+       /* Gain Setting */
+       {0x0205, 0x00},
+       {0x020E, 0x01},
+       {0x020F, 0x00},
+       {0x0210, 0x01},
+       {0x0211, 0x00},
+       {0x0212, 0x01},
+       {0x0213, 0x00},
+       {0x0214, 0x01},
+       {0x0215, 0x00},
+
+       /* HDR Setting */
+       {0x0230, 0x00},
+       {0x0231, 0x00},
+       {0x0233, 0x00},
+       {0x0234, 0x00},
+       {0x0235, 0x40},
+       {0x0238, 0x00},
+       {0x0239, 0x04},
+       {0x023B, 0x00},
+       {0x023C, 0x01},
+       {0x33B0, 0x04},
+       {0x33B1, 0x00},
+       {0x33B3, 0x00},
+       {0x33B4, 0x01},
+       {0x3800, 0x00},
+
+       /* stream on */
+       {0x0100, 0x01},
+
+       {IMX135_TABLE_WAIT_MS, IMX135_WAIT_MS},
+       {IMX135_TABLE_END, 0x00}
+};
+
 static struct imx135_reg mode_quality_hdr[] = {
        /* defect correction */
        {0x380A, 0x00},
@@ -2072,6 +2235,7 @@ enum {
        IMX135_MODE_2104X1560,
        IMX135_MODE_1920X1080,
        IMX135_MODE_1280X720,
+       IMX135_MODE_640X480,
        IMX135_MODE_QUALITY_HDR,
        IMX135_MODE_QUALITY,
 };
@@ -2086,6 +2250,7 @@ static struct imx135_reg *mode_table[] = {
        [IMX135_MODE_2104X1560] = mode_2104x1560,
        [IMX135_MODE_1920X1080] = mode_1920x1080,
        [IMX135_MODE_1280X720]  = mode_1280x720,
+       [IMX135_MODE_640X480]  = mode_640x480,
        [IMX135_MODE_QUALITY_HDR] = mode_quality_hdr,
        [IMX135_MODE_QUALITY] = mode_quality,
 };