htcleo: some camera/pmem cleanups and improvements

This commit is contained in:
Markinus 2010-10-09 12:37:26 +02:00
parent 5c1dc05a36
commit c2245c074a
3 changed files with 50 additions and 22 deletions

View File

@ -460,6 +460,8 @@ static int flashlight_control(int mode)
static struct camera_flash_cfg msm_camera_sensor_flash_cfg = {
.camera_flash = flashlight_control,
.num_flash_levels = FLASHLIGHT_NUM,
.low_temp_limit = 5,
.low_cap_limit = 15,
};
static struct msm_camera_sensor_info msm_camera_sensor_s5k3e2fx_data =
@ -538,7 +540,7 @@ static struct platform_device msm_kgsl_device =
// Memory
///////////////////////////////////////////////////////////////////////
static struct android_pmem_platform_data android_pmem_pdata = {
static struct android_pmem_platform_data mdp_pmem_pdata = {
.name = "pmem",
.no_allocator = 0,
.cached = 1,
@ -550,19 +552,20 @@ static struct android_pmem_platform_data android_pmem_adsp_pdata = {
.cached = 1,
};
static struct android_pmem_platform_data android_pmem_camera_pdata = {
.name = "pmem_camera",
.start = MSM_PMEM_CAMERA_BASE,
.size = MSM_PMEM_CAMERA_SIZE,
.no_allocator = 1,
static struct android_pmem_platform_data android_pmem_venc_pdata = {
.name = "pmem_venc",
.start = MSM_PMEM_VENC_BASE,
.size = MSM_PMEM_VENC_SIZE,
.no_allocator = 0,
.cached = 1,
};
static struct platform_device android_pmem_device = {
static struct platform_device android_pmem_mdp_device = {
.name = "android_pmem",
.id = 0,
.dev = {
.platform_data = &android_pmem_pdata
.platform_data = &mdp_pmem_pdata
},
};
@ -574,13 +577,14 @@ static struct platform_device android_pmem_adsp_device = {
},
};
static struct platform_device android_pmem_camera_device = {
static struct platform_device android_pmem_venc_device = {
.name = "android_pmem",
.id = 6,
.id = 5,
.dev = {
.platform_data = &android_pmem_camera_pdata,
.platform_data = &android_pmem_venc_pdata,
},
};
///////////////////////////////////////////////////////////////////////
// RAM-Console
///////////////////////////////////////////////////////////////////////
@ -634,9 +638,9 @@ static struct platform_device *devices[] __initdata =
&msm_device_smd,
&htcleo_rfkill,
&msm_device_rtc,
&android_pmem_device,
&android_pmem_mdp_device,
&android_pmem_adsp_device,
&android_pmem_camera_device,
&android_pmem_venc_device,
&msm_device_i2c,
&msm_kgsl_device,
&msm_camera_sensor_s5k3e2fx,
@ -859,8 +863,8 @@ static void __init htcleo_allocate_memory_regions(void)
size = pmem_sf_size;
if (size) {
addr = alloc_bootmem(size);
android_pmem_pdata.start = __pa(addr);
android_pmem_pdata.size = size;
mdp_pmem_pdata.start = __pa(addr);
mdp_pmem_pdata.size = size;
pr_info("allocating %lu bytes at %p (%lx physical) for sf "
"pmem arena\n", size, addr, __pa(addr));
}

View File

@ -38,11 +38,11 @@
#define MSM_GPU_PHYS_SIZE 0x00800000
/* #define MSM_GPU_PHYS_SIZE 0x00300000 */
#define MSM_PMEM_CAMERA_BASE (MSM_GPU_PHYS_BASE + MSM_GPU_PHYS_SIZE)
#define MSM_PMEM_CAMERA_SIZE 0x00C00000
#define MSM_PMEM_VENC_BASE (MSM_GPU_PHYS_BASE + MSM_GPU_PHYS_SIZE)
#define MSM_PMEM_VENC_SIZE 0x00800000
#define MSM_PMEM_SMIPOOL_BASE (MSM_PMEM_CAMERA_BASE + MSM_PMEM_CAMERA_SIZE)
#define MSM_PMEM_SMIPOOL_SIZE (MSM_PMEM_SMI_SIZE - MSM_GPU_PHYS_SIZE - MSM_FB_SIZE - MSM_PMEM_CAMERA_SIZE)
#define MSM_PMEM_SMIPOOL_BASE (MSM_PMEM_VENC_BASE + MSM_PMEM_VENC_SIZE)
#define MSM_PMEM_SMIPOOL_SIZE (MSM_PMEM_SMI_SIZE - MSM_GPU_PHYS_SIZE - MSM_FB_SIZE - MSM_PMEM_VENC_SIZE)
/* End SMI region */
/* Begin EBI region */

View File

@ -7,6 +7,7 @@
#include <linux/i2c.h>
#include <linux/uaccess.h>
#include <linux/miscdevice.h>
#include <linux/slab.h>
#include <media/msm_camera.h>
#include <mach/board.h>
#include <mach/gpio.h>
@ -42,6 +43,11 @@ static uint16_t g_usModuleVersion; /*0: rev.4, 1: rev.5 */
#define GROUPED_PARAMETER_HOLD 0x01
#define GROUPED_PARAMETER_UPDATE 0x00
/* Greenish in low light */
#define REG_MASK_CORRUPTED_FRAMES 0x0105
#define MASK 0x01
#define NO_MASK 0x00
/* PLL Registers */
#define REG_PRE_PLL_CLK_DIV 0x0305
#define REG_PLL_MULTIPLIER_MSB 0x0306
@ -2094,6 +2100,27 @@ static int s5k3e2fx_setting(enum msm_s_reg_update rupdate,
{0x3063, 0x16},
}
};
/* Most registers are directly applied at next frame after
writing except shutter and analog gain. Shutter and gain are
applied at 2nd or 1st frame later depending on register
writing time. When the camera is switched from preview to
snapshot, the first frame may have wrong shutter/gain and
should be discarded. The register REG_MASK_CORRUPTED_FRAMES
can discard the frame that has wrong shutter/gain. But in
preview mode, the frames should not be dropped. Otherwise
the preview will not be smooth. */
if (rt == S_RES_PREVIEW) {
/* Frames will be not discarded after exposure and gain are
written. */
s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
REG_MASK_CORRUPTED_FRAMES, NO_MASK);
} else {
/* Solve greenish in lowlight. Prevent corrupted frame */
s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
REG_MASK_CORRUPTED_FRAMES, MASK);
}
/* solve greenish: hold for both */
rc = s5k3e2fx_i2c_write_b(
s5k3e2fx_client->addr,
@ -2416,9 +2443,6 @@ static int s5k3e2fx_probe_init_lens_correction(
s5k3e2fx_i2c_write_table(&lc_setting[g_usModuleVersion][0], NUM_LC_REG);
+ /* Solve EVT5 greenish in lowlight, prevent corrupted frame*/
+ s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr, 0x105,0x1);
/*20090811 separates the EVT4/EVT5 sensor init and LC setting end */
s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
S5K3E2FX_REG_MODE_SELECT,