]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
media: tegra_v4l2_camera: update v4l2_imx230
authorArun Kannan <akannan@nvidia.com>
Tue, 6 Oct 2015 21:42:29 +0000 (14:42 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 22 Dec 2015 00:20:07 +0000 (16:20 -0800)
Add support for 2 more modes
2672x1600 (2-binned mode of 5344x3200) and
5344x4016 (full-res)

Bug 1682934

Change-Id: I0c2d9fb9343757ea9b87e32fbce0d2cecfed750c
Signed-off-by: Arun Kannan <akannan@nvidia.com>
Reviewed-on: http://git-master/r/812401
(cherry picked from commit c91b6360f67721aec8165c8d21ae1aba713aa6c4)
Reviewed-on: http://git-master/r/833570
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: David Wang (SW-TEGRA) <davidw@nvidia.com>
Reviewed-by: Venkata (Muni) Anda <vanda@nvidia.com>
drivers/media/i2c/soc_camera/imx230_mode_tbls.h
drivers/media/i2c/soc_camera/imx230_v4l2.c

index 22b62f0feb73fc3dc40faedfe3b65e172e21bbe5..77fae152d1a9086b7b3c83409fb37d6ada185419 100644 (file)
@@ -45,6 +45,129 @@ static imx230_reg tp_colorbars[] = {
        {IMX230_TABLE_END, 0x00}
 };
 
+static imx230_reg mode_2672x1600[] = {
+
+       /* Mode setting */
+       {0x0114, 0x03},
+       {0x0220, 0x00},
+       {0x0221, 0x11},
+       {0x0222, 0x01},
+       {0x0340, 0x06},
+       {0x0341, 0x9A},
+       {0x0342, 0x17},
+       {0x0343, 0x88},
+       {0x0344, 0x00},
+       {0x0345, 0x00},
+       {0x0346, 0x01},
+       {0x0347, 0x98},
+       {0x0348, 0x14},
+       {0x0349, 0xDF},
+       {0x034A, 0x0E},
+       {0x034B, 0x17},
+       {0x0381, 0x01},
+       {0x0383, 0x01},
+       {0x0385, 0x01},
+       {0x0387, 0x01},
+       {0x0900, 0x01},
+       {0x0901, 0x22},
+       {0x0902, 0x00},
+       {0x3000, 0x74},
+       {0x3001, 0x00},
+       {0x305C, 0x11},
+
+       /* Output size setting */
+       {0x0112, 0x0A},
+       {0x0113, 0x0A},
+       {0x034C, 0x0A},
+       {0x034D, 0x70},
+       {0x034E, 0x06},
+       {0x034F, 0x40},
+       {0x0401, 0x00},
+       {0x0404, 0x00},
+       {0x0405, 0x10},
+       {0x0408, 0x00},
+       {0x0409, 0x00},
+       {0x040A, 0x00},
+       {0x040B, 0x00},
+       {0x040C, 0x0A},
+       {0x040D, 0x70},
+       {0x040E, 0x06},
+       {0x040F, 0x40},
+
+       /* Clock setting */
+       {0x0301, 0x04},
+       {0x0303, 0x02},
+       {0x0305, 0x04},
+       {0x0306, 0x00},
+       {0x0307, 0xC8},
+       {0x0309, 0x0A},
+       {0x030B, 0x01},
+       {0x030D, 0x0F},
+       {0x030E, 0x03},
+       {0x030F, 0xA9},
+       {0x0310, 0x01},
+
+       /* Data rate setting */
+       {0x0820, 0x17},
+       {0x0821, 0x6C},
+       {0x0822, 0xCC},
+       {0x0823, 0xCC},
+
+       /* Integration time setting */
+       {0x0202, 0x06},
+       {0x0203, 0x90},
+       {0x0204, 0x01},
+       {0x0225, 0xF4},
+
+       /* Gain setting */
+       {0x0204, 0x00},
+       {0x0205, 0x00},
+       {0x0216, 0x00},
+       {0x0217, 0x00},
+       {0x020E, 0x01},
+       {0x020F, 0x00},
+       {0x0210, 0x01},
+       {0x0211, 0x00},
+       {0x0212, 0x01},
+       {0x0213, 0x00},
+       {0x0214, 0x01},
+       {0x0215, 0x00},
+
+       /* HDR setting */
+       {0x3006, 0x01},
+       {0x3007, 0x02},
+       {0x31E0, 0x03},
+       {0x31E1, 0xFF},
+       {0x31E4, 0x02},
+
+       /* DPC2D setting */
+       {0x3A22, 0x20},
+       {0x3A23, 0x14},
+       {0x3A24, 0xE0},
+       {0x3A25, 0x06},
+       {0x3A26, 0x40},
+       {0x3A2F, 0x00},
+       {0x3A30, 0x00},
+       {0x3A31, 0x01},
+       {0x3A32, 0x98},
+       {0x3A33, 0x14},
+       {0x3A34, 0xDF},
+       {0x3A35, 0x0E},
+       {0x3A36, 0x17},
+       {0x3A37, 0x00},
+       {0x3A38, 0x01},
+       {0x3A39, 0x00},
+
+       /* LSC setting */
+       {0x3A21, 0x00},
+
+       /* Stats setting */
+       {0x3011, 0x00},
+       {0x3013, 0x01},
+
+       {IMX230_TABLE_END, 0x00}
+};
+
 static imx230_reg mode_5344x3200[] = {
 
        /* Mode setting */
@@ -168,6 +291,130 @@ static imx230_reg mode_5344x3200[] = {
        {IMX230_TABLE_END, 0x00}
 };
 
+static imx230_reg mode_5344x4016[] = {
+
+       /* Mode setting */
+       {0x0114, 0x03},
+       {0x0220, 0x00},
+       {0x0221, 0x11},
+       {0x0222, 0x01},
+       {0x0340, 0x10},
+       {0x0341, 0x22},
+       {0x0342, 0x17},
+       {0x0343, 0x88},
+       {0x0344, 0x00},
+       {0x0345, 0x00},
+       {0x0346, 0x00},
+       {0x0347, 0x00},
+       {0x0348, 0x14},
+       {0x0349, 0xDF},
+       {0x034A, 0x0F},
+       {0x034B, 0xAF},
+       {0x0381, 0x01},
+       {0x0383, 0x01},
+       {0x0385, 0x01},
+       {0x0387, 0x01},
+       {0x0900, 0x00},
+       {0x0901, 0x11},
+       {0x0902, 0x00},
+       {0x3000, 0x74},
+       {0x3001, 0x00},
+       {0x305C, 0x11},
+
+       /* Output size setting */
+       {0x0112, 0x0A},
+       {0x0113, 0x0A},
+       {0x034C, 0x14},
+       {0x034D, 0xE0},
+       {0x034E, 0x0F},
+       {0x034F, 0xB0},
+       {0x0401, 0x00},
+       {0x0404, 0x00},
+       {0x0405, 0x10},
+       {0x0408, 0x00},
+       {0x0409, 0x00},
+       {0x040A, 0x00},
+       {0x040B, 0x00},
+       {0x040C, 0x14},
+       {0x040D, 0xE0},
+       {0x040E, 0x0F},
+       {0x040F, 0xB0},
+
+       /* Clock setting */
+       {0x0301, 0x04},
+       {0x0303, 0x02},
+       {0x0305, 0x04},
+       {0x0306, 0x00},
+       {0x0307, 0xB1},
+       {0x0309, 0x0A},
+       {0x030B, 0x01},
+       {0x030D, 0x0F},
+       {0x030E, 0x03},
+       {0x030F, 0xA9},
+       {0x0310, 0x01},
+
+       /* Data rate setting */
+       {0x0820, 0x17},
+       {0x0821, 0x6C},
+       {0x0822, 0xCC},
+       {0x0823, 0xCC},
+
+       /* Integration time setting */
+       {0x0202, 0x10},
+       {0x0203, 0x18},
+       {0x0204, 0x01},
+       {0x0225, 0xF4},
+
+       /* Gain setting */
+       {0x0204, 0x00},
+       {0x0205, 0x00},
+       {0x0216, 0x00},
+       {0x0217, 0x00},
+       {0x020E, 0x01},
+       {0x020F, 0x00},
+       {0x0210, 0x01},
+       {0x0211, 0x00},
+       {0x0212, 0x01},
+       {0x0213, 0x00},
+       {0x0214, 0x01},
+       {0x0215, 0x00},
+
+       /* HDR setting */
+       {0x3006, 0x01},
+       {0x3007, 0x02},
+       {0x31E0, 0x03},
+       {0x31E1, 0xFF},
+       {0x31E4, 0x02},
+
+       /* DPC2D setting */
+       {0x3A22, 0x20},
+       {0x3A23, 0x14},
+       {0x3A24, 0xE0},
+       {0x3A25, 0x0F},
+       {0x3A26, 0xB0},
+       {0x3A2F, 0x00},
+       {0x3A30, 0x00},
+       {0x3A31, 0x00},
+       {0x3A32, 0x00},
+       {0x3A33, 0x14},
+       {0x3A34, 0xDF},
+       {0x3A35, 0x0F},
+       {0x3A36, 0xAF},
+       {0x3A37, 0x00},
+       {0x3A38, 0x00},
+       {0x3A39, 0x00},
+
+       /* LSC setting */
+       {0x3A21, 0x00},
+
+       /* Stats setting */
+       {0x3011, 0x00},
+       {0x3013, 0x01},
+
+       {IMX230_TABLE_END, 0x00}
+
+};
+
 static imx230_reg mode_table_common[] = {
 
        /* external clock setting */
@@ -276,7 +523,9 @@ static imx230_reg mode_table_common[] = {
 };
 
 enum {
+       IMX230_MODE_2672x1600,
        IMX230_MODE_5344x3200,
+       IMX230_MODE_5344x4016,
 
        IMX230_MODE_COMMON,
        IMX230_MODE_START_STREAM,
@@ -285,7 +534,9 @@ enum {
 };
 
 static imx230_reg *mode_table[] = {
+       [IMX230_MODE_2672x1600] = mode_2672x1600,
        [IMX230_MODE_5344x3200] = mode_5344x3200,
+       [IMX230_MODE_5344x4016] = mode_5344x4016,
 
        [IMX230_MODE_COMMON] = mode_table_common,
        [IMX230_MODE_START_STREAM] = imx230_start,
@@ -294,6 +545,8 @@ static imx230_reg *mode_table[] = {
 };
 
 static const struct camera_common_frmfmt imx230_frmfmt[] = {
+       {{2672, 1600},  0, IMX230_MODE_2672x1600},
        {{5344, 3200},  0, IMX230_MODE_5344x3200},
+       {{5344, 4016},  0, IMX230_MODE_5344x4016},
 };
 #endif  /* __IMX230_I2C_TABLES__ */
index 34ede5db1847281da8825ce8dd7aa59361a8c1d0..c39d5bae595af787a9cf3f0a029341837c204f53 100644 (file)
@@ -16,7 +16,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define DEBUG
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/gpio.h>
@@ -435,7 +434,8 @@ static int imx230_s_stream(struct v4l2_subdev *sd, int enable)
        struct v4l2_control control;
        int err;
 
-       dev_dbg(&client->dev, "%s++ enable %d\n", __func__, enable);
+       dev_dbg(&client->dev, "%s++ enable %d mode %d\n",
+               __func__, enable, s_data->mode);
 
        if (!enable)
                return imx230_write_table(priv,