media: video: tegra: imx132: Add 1080p 1-lane mode
Sudhir Vyas [Thu, 24 Jan 2013 06:56:33 +0000 (11:56 +0530)]
Add new 1-lane sensor mode support for ceres platforms,
as front sensor is connected on CIL-E 1-lane.

Bug 1180015

Change-Id: I13e169a24fc40bdfffcad2cbfea19aebe942f1da
Signed-off-by: Sudhir Vyas <svyas@nvidia.com>
Reviewed-on: http://git-master/r/193649
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>

drivers/media/video/tegra/imx132.c

index 63c8872..a7f48cd 100644 (file)
@@ -56,6 +56,115 @@ struct imx132_info {
 
 #define IMX132_WAIT_MS 5
 
+static struct imx132_reg mode_1920x1080[] = {
+       /* Stand by */
+       {0x0100, 0x00},
+       {IMX132_TABLE_WAIT_MS, IMX132_WAIT_MS},
+
+       /* global settings */
+       {0x3087, 0x53},
+       {0x308B, 0x5A},
+       {0x3094, 0x11},
+       {0x309D, 0xA4},
+       {0x30AA, 0x01},
+       {0x30C6, 0x00},
+       {0x30C7, 0x00},
+       {0x3118, 0x2F},
+       {0x312A, 0x00},
+       {0x312B, 0x0B},
+       {0x312C, 0x0B},
+       {0x312D, 0x13},
+
+       /* PLL Setting */
+       {0x0305, 0x02},
+       {0x0307, 0x42},
+       {0x30A4, 0x02},
+       {0x303C, 0x4B},
+
+       /* Mode Setting */
+       {0x0340, 0x04},
+       {0x0341, 0x92},
+       {0x0342, 0x08},
+       {0x0343, 0xC8},
+       {0x0344, 0x00},
+       {0x0345, 0x00},
+       {0x0346, 0x00},
+       {0x0347, 0x1C},
+       {0x0348, 0x07},
+       {0x0349, 0xB7},
+       {0x034A, 0x04},
+       {0x034B, 0x93},
+       {0x034C, 0x07},
+       {0x034D, 0xB8},
+       {0x034E, 0x04},
+       {0x034F, 0x78},
+       {0x0381, 0x01},
+       {0x0383, 0x01},
+       {0x0385, 0x01},
+       {0x0387, 0x01},
+       {0x303D, 0x10},
+       {0x303E, 0x5A},
+       {0x3040, 0x08},
+       {0x3041, 0x97},
+       {0x3048, 0x00},
+       {0x304C, 0x2F},
+       {0x304D, 0x02},
+       {0x3064, 0x92},
+       {0x306A, 0x10},
+       {0x309B, 0x00},
+       {0x309E, 0x41},
+       {0x30A0, 0x10},
+       {0x30A1, 0x0B},
+       {0x30B2, 0x00},
+       {0x30D5, 0x00},
+       {0x30D6, 0x00},
+       {0x30D7, 0x00},
+       {0x30D8, 0x00},
+       {0x30D9, 0x00},
+       {0x30DA, 0x00},
+       {0x30DB, 0x00},
+       {0x30DC, 0x00},
+       {0x30DD, 0x00},
+       {0x30DE, 0x00},
+       {0x3102, 0x0C},
+       {0x3103, 0x33},
+       {0x3104, 0x18},
+       {0x3105, 0x00},
+       {0x3106, 0x65},
+       {0x3107, 0x00},
+       {0x3108, 0x06},
+       {0x3109, 0x04},
+       {0x310A, 0x04},
+       {0x315C, 0x3D},
+       {0x315D, 0x3C},
+       {0x316E, 0x3E},
+       {0x316F, 0x3D},
+       {0x3301, 0x01},
+       {0x3304, 0x07},
+       {0x3305, 0x06},
+       {0x3306, 0x19},
+       {0x3307, 0x03},
+       {0x3308, 0x0F},
+       {0x3309, 0x07},
+       {0x330A, 0x0C},
+       {0x330B, 0x06},
+       {0x330C, 0x0B},
+       {0x330D, 0x07},
+       {0x330E, 0x03},
+       {0x3318, 0x61},
+       {0x3322, 0x09},
+       {0x3342, 0x00},
+       {0x3348, 0xE0},
+
+       /* Shutter gain Settings */
+       {0x0202, 0x04},
+       {0x0203, 0x33},
+
+       /* Streaming */
+       {0x0100, 0x01},
+       {IMX132_TABLE_WAIT_MS, IMX132_WAIT_MS},
+       {IMX132_TABLE_END, 0x00}
+};
 
 static struct imx132_reg mode_1976x1200[] = {
        /* Stand by */
@@ -168,10 +277,12 @@ static struct imx132_reg mode_1976x1200[] = {
 };
 
 enum {
+       IMX132_MODE_1920X1080,
        IMX132_MODE_1976X1200,
 };
 
 static struct imx132_reg *mode_table[] = {
+       [IMX132_MODE_1920X1080] = mode_1920x1080,
        [IMX132_MODE_1976X1200] = mode_1976x1200,
 };
 
@@ -323,9 +434,11 @@ imx132_set_mode(struct imx132_info *info, struct imx132_mode *mode)
                __func__, mode->xres, mode->yres,
                mode->frame_length, mode->coarse_time, mode->gain);
 
-       if (mode->xres == 1976 && mode->yres == 1200)
+       if (mode->xres == 1920 && mode->yres == 1080) {
+               sensor_mode = IMX132_MODE_1920X1080;
+       } else if (mode->xres == 1976 && mode->yres == 1200) {
                sensor_mode = IMX132_MODE_1976X1200;
-       else {
+       } else {
                dev_err(dev, "%s: invalid resolution to set mode %d %d\n",
                        __func__, mode->xres, mode->yres);
                return -EINVAL;