From: Yong He <[email protected]> Subject: [PATCH] MRST Tablet camera driver ver-0.963, fix 11393
Bug 11393 - rear camera preview start to flicker when the light is very low worked together with OVT to find this solution. fix iso settings, set the last 4 bit of iso to 0 will resolve this issue. Signed-off-by: Yong He <[email protected]> Index: linux-2.6.37/drivers/staging/mrstci/mrstov5640/ov5640.h =================================================================== --- linux-2.6.37/drivers/staging/mrstci/mrstov5640/ov5640.h (revision 1293) +++ linux-2.6.37/drivers/staging/mrstci/mrstov5640/ov5640.h (revision 1295) @@ -4022,7 +4022,7 @@ {0x471c, 0x50}, {0x3a13, 0x43}, {0x3a18, 0x01}, - {0x3a19, 0xfc}, + {0x3a19, 0xf0}, {0x3635, 0x1c}, {0x3634, 0x40}, {0x3622, 0x01}, Index: linux-2.6.37/drivers/staging/mrstci/mrstov5640/mrstov5640.c =================================================================== --- linux-2.6.37/drivers/staging/mrstci/mrstov5640/mrstov5640.c (revision 1293) +++ linux-2.6.37/drivers/staging/mrstci/mrstov5640/mrstov5640.c (revision 1295) @@ -50,7 +50,7 @@ #include "ci_sensor_common.h" #include "ov5640.h" -#define DRIVER_VERSION "0.962" +#define DRIVER_VERSION "0.963" #define GPIO_FLASH 45 static int ov5640_flash; @@ -1019,7 +1019,7 @@ dev_dbg(sd->v4l2_dev->dev, "ov5640_restore_expo: exposure = 0x%Lx", exposure); - maxgain16 = 0x01fc; /* 32x */ + maxgain16 = 0x01f0; /* 32x */ if (ov5640_status.expo.lightfreq == 60) { bandwidth = ov5640_setting_ext[cap_idx].REG_3a0aw; @@ -1331,11 +1331,11 @@ } static uint16_t ov5640_iso_gain_tbl[] = { - 0x006c, /* 100*/ - 0x008c, /* 200*/ - 0x00cc, /* 400*/ - 0x00fc, /* 800*/ - 0x01fc, /* 1600*/ + 0x0060, /* 100*/ + 0x0080, /* 200*/ + 0x00c0, /* 400*/ + 0x00f0, /* 800*/ + 0x01f0, /* 1600*/ }; static int ov5640_t_iso_val(struct v4l2_subdev *sd, int value) @@ -1370,9 +1370,9 @@ }; gain = ov5640_iso_gain_tbl[index]; - ret += ov5640_read(c, 0x3518, &v); - ret += ov5640_write(c, 0x3518, ((gain>>8)&0x3) | (v & 0xfc)); - ret += ov5640_write(c, 0x3519, gain & 0xff); + ret += ov5640_read(c, 0x3a18, &v); + ret += ov5640_write(c, 0x3a18, ((gain>>8)&0x3) | (v & 0xfc)); + ret += ov5640_write(c, 0x3a19, gain & 0xff); ov5640_status.iso_val = value; return ret; Index: linux-2.6.37/drivers/staging/mrstci/mrstov9740/mrstov9740.c =================================================================== --- linux-2.6.37/drivers/staging/mrstci/mrstov9740/mrstov9740.c (revision 1293) +++ linux-2.6.37/drivers/staging/mrstci/mrstov9740/mrstov9740.c (revision 1295) @@ -47,7 +47,7 @@ #include "ci_sensor_common.h" #include "ov9740.h" -#define DRIVER_VERSION "0.962" +#define DRIVER_VERSION "0.963" #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define DBG_entering pr_debug("%s entering", __func__); @@ -580,10 +580,6 @@ val = ov9740_setting_ext[idx].REG_3a0d; ret += ov9740_write(c, 0x3a0d, val); - /* Set Gain Limit */ - ret += ov9740_write(c, 0x3a18, 0x01); - ret += ov9740_write(c, 0x3a19, 0xfc); - dev_dbg(sd->v4l2_dev->dev, "ov9740_set_b_filter: ov9740_setting_ext[%d]." "REG_3a08w <- 0x%x", idx, @@ -709,9 +705,7 @@ dev_dbg(sd->v4l2_dev->dev, "ov9740_restore_expo: exposure = 0x%Lx", exposure); - maxgain16 = 0x01fc; /* 32x */ - ret += ov9740_write(c, 0x3a18, 0x01); - ret += ov9740_write(c, 0x3a19, 0xfc); + maxgain16 = 0x00f0; /* 16x */ if (ov9740_status.expo.lightfreq == 60) { bandwidth = ov9740_setting_ext[cap_idx].REG_3a0aw; @@ -990,11 +984,11 @@ } static uint16_t ov9740_iso_gain_tbl[] = { - 0x0040, /* 100*/ - 0x0080, /* 200*/ - 0x0100, /* 400*/ - 0x01f0, /* 800*/ - 0x03fc, /* 1600*/ + 0x0020, /* 100*/ + 0x0040, /* 200*/ + 0x0060, /* 400*/ + 0x0080, /* 800*/ + 0x00f0, /* 1600*/ }; static int ov9740_t_iso_val(struct v4l2_subdev *sd, int value) @@ -1029,9 +1023,7 @@ }; gain = ov9740_iso_gain_tbl[index]; - ret += ov9740_read(c, 0x3518, &v); - ret += ov9740_write(c, 0x3518, ((gain>>8)&0x3) | (v & 0xfc)); - ret += ov9740_write(c, 0x3519, gain & 0xff); + ret += ov9740_write(c, 0x3a19, gain & 0xff); ov9740_status.iso_val = value; return ret; Index: linux-2.6.37/drivers/staging/mrstci/mrstov9740/ov9740.h =================================================================== --- linux-2.6.37/drivers/staging/mrstci/mrstov9740/ov9740.h (revision 1293) +++ linux-2.6.37/drivers/staging/mrstci/mrstov9740/ov9740.h (revision 1295) @@ -109,10 +109,10 @@ {0x3833 , 0x04}, {0x3835 , 0x04}, - // AEC/AGC control}, + /* AEC/AGC control */ {0x3503 , 0x10}, - {0x3a18 , 0x01}, - {0x3a19 , 0xB5}, + {0x3a18 , 0x00}, + {0x3a19 , 0xF0}, {0x3a1a , 0x05}, {0x3a11 , 0x90}, {0x3a1b , 0x4a}, Best Regards, Yong He Software Engineer, PCSD SW Solutions, Intel Asia-Pacific R&D Ltd. Phone (+86) 21-61166334 Lab (+86) 21-61167881
linux-2.6.37-camera-ov5640-ov9740-version-0.962_to_0.963.patch
Description: linux-2.6.37-camera-ov5640-ov9740-version-0.962_to_0.963.patch
_______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
