[Meego-kernel] [PATCH] MRST Tablet camera driver ver-0.957, fix 10057

He, Yong M yong.m.he at intel.com
Tue Jun 28 02:05:36 PDT 2011


From: Yong He <yong.m.he at intel.com>
Subject: [PATCH] MRST Tablet camera driver ver-0.957, fix 10057

Bug 10057 - [MM-camera] Both camera were preview with serious noise on it.

Solution,
add default Image Quality settings OV provided for both sensors (5640 and 9740)

Signed-off-by: Yong He <yong.m.he at intel.com>
Index: linux-2.6.37/drivers/staging/mrstci/mrstov5640/ov5640.h
===================================================================
--- linux-2.6.37/drivers/staging/mrstci/mrstov5640/ov5640.h       (revision 125)
+++ linux-2.6.37/drivers/staging/mrstci/mrstov5640/ov5640.h    (working copy)
@@ -4294,6 +4294,135 @@
                {0xffff, 0xff},
};
+static struct regval_list ov5640_default_iq[] = {
+       /*Lensc*/
+       {0x5800, 0x1d},
+       {0x5801, 0x0e},
+       {0x5802, 0x0c},
+       {0x5803, 0x0d},
+       {0x5804, 0x0e},
+       {0x5805, 0x1e},
+       {0x5806, 0x07},
+       {0x5807, 0x07},
+       {0x5808, 0x05},
+       {0x5809, 0x05},
+       {0x580a, 0x07},
+       {0x580b, 0x08},
+       {0x580c, 0x06},
+       {0x580d, 0x03},
+       {0x580e, 0x00},
+       {0x580f, 0x00},
+       {0x5810, 0x03},
+       {0x5811, 0x07},
+       {0x5812, 0x06},
+       {0x5813, 0x02},
+       {0x5814, 0x00},
+       {0x5815, 0x00},
+       {0x5816, 0x03},
+       {0x5817, 0x06},
+       {0x5818, 0x08},
+       {0x5819, 0x06},
+       {0x581a, 0x04},
+       {0x581b, 0x05},
+       {0x581c, 0x07},
+       {0x581d, 0x09},
+       {0x581e, 0x16},
+       {0x581f, 0x0c},
+       {0x5820, 0x0a},
+       {0x5821, 0x0b},
+       {0x5822, 0x0d},
+       {0x5823, 0x15},
+       {0x5824, 0x28},
+       {0x5825, 0x28},
+       {0x5826, 0x2a},
+       {0x5827, 0x2a},
+       {0x5828, 0x2a},
+       {0x5829, 0x0a},
+       {0x582a, 0x26},
+       {0x582b, 0x24},
+       {0x582c, 0x26},
+       {0x582d, 0x0a},
+       {0x582e, 0x08},
+       {0x582f, 0x42},
+       {0x5830, 0x40},
+       {0x5831, 0x42},
+       {0x5832, 0x08},
+       {0x5833, 0x28},
+       {0x5834, 0x26},
+       {0x5835, 0x44},
+       {0x5836, 0x46},
+       {0x5837, 0x0a},
+       {0x5838, 0x4a},
+       {0x5839, 0x0a},
+       {0x583a, 0x0c},
+       {0x583b, 0x2a},
+       {0x583c, 0x2c},
+       {0x583d, 0xce},
+       /*AWB*/
+       {0x5180, 0xff},
+       {0x5181, 0xf2},
+       {0x5182, 0x11},
+       {0x5183, 0x14},
+       {0x5184, 0x25},
+       {0x5185, 0x24},
+       {0x5186, 0x10},
+       {0x5187, 0x04},
+       {0x5188, 0x0b},
+       {0x5189, 0x7c},
+       {0x518a, 0x66},
+       {0x518b, 0xfc},
+       {0x518c, 0xa8},
+       {0x518d, 0x22},
+       {0x518e, 0x42},
+       {0x518f, 0x57},
+       {0x5190, 0x4d},
+       {0x5191, 0xf8},
+       {0x5192, 0x04},
+       {0x5193, 0xf0},
+       {0x5194, 0xf0},
+       {0x5195, 0x80},
+       {0x5196, 0x03},
+       {0x5197, 0x01},
+       {0x5198, 0x04},
+       {0x5199, 0x8a},
+       {0x519a, 0x04},
+       {0x519b, 0x00},
+       {0x519c, 0x08},
+       {0x519d, 0xff},
+       {0x519e, 0x38},
+       /*ColorMTX*/
+       {0x5381, 0x1e},
+       {0x5382, 0x5b},
+       {0x5383, 0x08},
+       {0x5384, 0x0c},
+       {0x5385, 0x97},
+       {0x5386, 0xa3},
+       {0x5387, 0x95},
+       {0x5388, 0x82},
+       {0x5389, 0x13},
+       {0x538b, 0x98},
+       {0x538a, 0x01},
+       /*Gamma*/
+       {0x5490, 0x1c},
+       {0x5481, 0x09},
+       {0x5482, 0x15},
+       {0x5483, 0x29},
+       {0x5484, 0x53},
+       {0x5485, 0x66},
+       {0x5486, 0x71},
+       {0x5487, 0x7d},
+       {0x5488, 0x87},
+       {0x5489, 0x91},
+       {0x548a, 0x9a},
+       {0x548b, 0xab},
+       {0x548c, 0xb9},
+       {0x548d, 0xce},
+       {0x548e, 0xdf},
+       {0x548f, 0xeb},
+
+       {0xffff, 0xff},
+};
+
static struct regval_list ov5640_reg_1080P_1_lane[] = {
       /* 1080p */
       {0x3008, 0x42},
Index: linux-2.6.37/drivers/staging/mrstci/mrstov5640/mrstov5640.c
===================================================================
--- linux-2.6.37/drivers/staging/mrstci/mrstov5640/mrstov5640.c        (revision 125)
+++ linux-2.6.37/drivers/staging/mrstci/mrstov5640/mrstov5640.c     (working copy)
@@ -50,7 +50,7 @@
#include "ci_sensor_common.h"
#include "ov5640.h"
-#define DRIVER_VERSION "0.955"
+#define DRIVER_VERSION "0.957"
 #define GPIO_FLASH 45
static int ov5640_flash=0;
@@ -544,6 +544,8 @@
        /* Set registers into default config value */
       ret = ov5640_write_array(c, ov5640_def_reg);
+       /* Set default color tuning value for Image Quality */
+       ret += ov5640_write_array(c, ov5640_default_iq);
       dev_dbg(sd->v4l2_dev->dev, "[ov5640-wr-reg] <-----------"
                          " load ov5640 default settings\n");
       ret += ov5640_set_aec_agc(c, 1);
@@ -1261,15 +1263,13 @@
 static int ov5640_t_flash(struct v4l2_subdev *sd, int value)
{
-        int ret;
-
       if ((value != 0) && (value != 1))
                return -EINVAL;
        gpio_set_value(GPIO_FLASH, value);
       ov5640_flash = value;
-        return ret;
+       return 0;
}
 static int ov5640_q_flash(struct v4l2_subdev *sd, int *value)
@@ -2485,6 +2485,8 @@
                ov5640_set_aec_agc(client, 0);
                ov5640_save_expo_val(sd);
                ov5640_write(client, 0x3008, 0x42);
+                /* turn off Flash when stream off*/
+                ov5640_t_flash(sd, 0);
       }
        DBG_leaving;
Index: linux-2.6.37/drivers/staging/mrstci/mrstov9740/mrstov9740.c
===================================================================
--- linux-2.6.37/drivers/staging/mrstci/mrstov9740/mrstov9740.c        (revision 125)
+++ linux-2.6.37/drivers/staging/mrstci/mrstov9740/mrstov9740.c     (working copy)
@@ -47,7 +47,7 @@
#include "ci_sensor_common.h"
#include "ov9740.h"
-#define DRIVER_VERSION "0.956"
+#define DRIVER_VERSION "0.957"
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #define DBG_entering  pr_debug("%s entering", __func__);
@@ -304,6 +304,10 @@
       /* Set registers into default config value */
       ret = ov9740_write_array(c, ov9740_def);
       ret += ov9740_write_array(c, ov9740_reg_vga);
+
+       /* Set default color tuning value for Image Quality */
+       ret += ov9740_write_array(c, ov9740_default_iq);
+
       ov9740_write(c, 0x0100, 0x00);
       ov9740_set_data_pin_in(c);
       ret += ov9740_set_aec_agc(c, 1);
Index: linux-2.6.37/drivers/staging/mrstci/mrstov9740/ov9740.h
===================================================================
--- linux-2.6.37/drivers/staging/mrstci/mrstov9740/ov9740.h       (revision 125)
+++ linux-2.6.37/drivers/staging/mrstci/mrstov9740/ov9740.h    (working copy)
@@ -360,6 +360,182 @@
                           {0xffff, 0xff},
};
+
+static struct regval_list ov9740_default_iq[] = {
+       /*Gamma*/
+       {0x5480, 0x05},
+       {0x5481, 0x14},
+       {0x5482, 0x29},
+       {0x5483, 0x4b},
+       {0x5484, 0x58},
+       {0x5485, 0x68},
+       {0x5486, 0x76},
+       {0x5487, 0x82},
+       {0x5488, 0x8c},
+       {0x5489, 0x96},
+       {0x548a, 0xa6},
+       {0x548b, 0xb4},
+       {0x548c, 0xca},
+       {0x548d, 0xdb},
+       {0x548e, 0xed},
+       {0x548f, 0x19},
+       {0x5490, 0x01},
+       {0x5491, 0xc0},
+       {0x5492, 0x03},
+       {0x5493, 0x00},
+       {0x5494, 0x03},
+       {0x5495, 0xe0},
+       {0x5496, 0x03},
+       {0x5497, 0x10},
+       {0x5498, 0x02},
+       {0x5499, 0xac},
+       {0x549a, 0x02},
+       {0x549b, 0x75},
+       {0x549c, 0x02},
+       {0x549d, 0x44},
+       {0x549e, 0x02},
+       {0x549f, 0x20},
+       {0x54a0, 0x02},
+       {0x54a1, 0x07},
+       {0x54a2, 0x01},
+       {0x54a3, 0xec},
+       {0x54a4, 0x01},
+       {0x54a5, 0xc0},
+       {0x54a6, 0x01},
+       {0x54a7, 0x9b},
+       {0x54a8, 0x01},
+       {0x54a9, 0x63},
+       {0x54aa, 0x01},
+       {0x54ab, 0x2b},
+       {0x54ac, 0x01},
+       {0x54ad, 0x22},
+       {0x54ae, 0x00},
+       {0x54af, 0x1d},
+       {0x54b0, 0x03},
+       {0x54b1, 0x20},
+       {0x54b2, 0x01},
+       {0x54b3, 0x40},
+       {0x54b4, 0x00},
+       {0x54b5, 0xf0},
+       {0x54b6, 0x01},
+       {0x54b7, 0xdf},
+       /* color mtx */
+       {0x5380, 0x01},
+       {0x5381, 0x00},
+       {0x5382, 0x00},
+       {0x5383, 0x0d},
+       {0x5384, 0x00},
+       {0x5385, 0x2f},
+       {0x5386, 0x00},
+       {0x5387, 0x00},
+       {0x5388, 0x00},
+       {0x5389, 0xf9},
+       {0x538a, 0x00},
+       {0x538b, 0x24},
+       {0x538c, 0x00},
+       {0x538d, 0x00},
+       {0x538e, 0x00},
+       {0x538f, 0x3c},
+       {0x5390, 0x00},
+       {0x5391, 0xb2},
+       {0x5392, 0x00},
+       {0x5393, 0xa4},
+       {0x5394, 0x18},
+       /*AWB*/
+       {0x5180, 0xf0},
+       {0x5181, 0x00},
+       {0x5182, 0x41},
+       {0x5183, 0x42},
+       {0x5184, 0x7f},
+       {0x5185, 0x76},
+       {0x5186, 0x9b},
+       {0x5187, 0x98},
+       {0x5188, 0x12},
+       {0x5189, 0x0f},
+       {0x518a, 0x13},
+       {0x518b, 0x32},
+       {0x518c, 0x33},
+       {0x518d, 0xf0},
+       {0x518e, 0x10},
+       {0x518f, 0xff},
+       {0x5190, 0x00},
+       {0x5191, 0xff},
+       {0x5192, 0x00},
+       {0x5193, 0x80},
+       {0x5194, 0x00},
+       {0x5195, 0x04},
+       {0x5196, 0x79},
+       {0x5197, 0x04},
+       {0x5198, 0x00},
+       {0x5199, 0x08},
+       {0x519a, 0x0f},
+       {0x519b, 0x10},
+       /*Lensc*/
+       {0x5800, 0x1a},
+       {0x5801, 0x15},
+       {0x5802, 0x12},
+       {0x5803, 0x13},
+       {0x5804, 0x15},
+       {0x5805, 0x1f},
+       {0x5806, 0x0a},
+       {0x5807, 0x08},
+       {0x5808, 0x06},
+       {0x5809, 0x06},
+       {0x580a, 0x08},
+       {0x580b, 0x0d},
+       {0x580c, 0x04},
+       {0x580d, 0x02},
+       {0x580e, 0x00},
+       {0x580f, 0x00},
+       {0x5810, 0x02},
+       {0x5811, 0x06},
+       {0x5812, 0x04},
+       {0x5813, 0x02},
+       {0x5814, 0x00},
+       {0x5815, 0x00},
+       {0x5816, 0x02},
+       {0x5817, 0x05},
+       {0x5818, 0x08},
+       {0x5819, 0x06},
+       {0x581a, 0x05},
+       {0x581b, 0x05},
+       {0x581c, 0x06},
+       {0x581d, 0x0b},
+       {0x581e, 0x17},
+       {0x581f, 0x12},
+       {0x5820, 0x0f},
+       {0x5821, 0x10},
+       {0x5822, 0x12},
+       {0x5823, 0x17},
+       {0x5824, 0x4f},
+       {0x5825, 0x5f},
+       {0x5826, 0x5f},
+       {0x5827, 0x6f},
+       {0x5828, 0x7f},
+       {0x5829, 0x5f},
+       {0x582a, 0x6e},
+       {0x582b, 0x7d},
+       {0x582c, 0x6e},
+       {0x582d, 0x6f},
+       {0x582e, 0x5e},
+       {0x582f, 0x88},
+       {0x5830, 0x86},
+       {0x5831, 0x89},
+       {0x5832, 0x8e},
+       {0x5833, 0x5f},
+       {0x5834, 0x7d},
+       {0x5835, 0x8d},
+       {0x5836, 0x7e},
+       {0x5837, 0x7f},
+       {0x5838, 0x6f},
+       {0x5839, 0x7f},
+       {0x583a, 0x6f},
+       {0x583b, 0x6f},
+       {0x583c, 0x7f},
+
+       {0xffff, 0xff},
+};
+
static struct regval_list ov9740_reg_720p[] = {
                /*OV9740 DVP 1280*720 15FPS*/
                    {0x3104 , 0x20},

Best Regards,

Yong He
Software Engineer, PCSD SW Solutions,
Intel Asia-Pacific R&D Ltd.
Phone (+86) 21-61166334
Lab (+86) 21-61167881

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.meego.com/pipermail/meego-kernel/attachments/20110628/82e0e681/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux-2.6.37-camera-ov5640-ov9740-version-0.956_to_0.957.patch
Type: application/octet-stream
Size: 8844 bytes
Desc: linux-2.6.37-camera-ov5640-ov9740-version-0.956_to_0.957.patch
URL: <http://lists.meego.com/pipermail/meego-kernel/attachments/20110628/82e0e681/attachment-0001.obj>


More information about the MeeGo-kernel mailing list