From: Dohyun Kim Date: Wed, 27 Mar 2019 09:18:16 +0000 (+0900) Subject: [COMMON] fimc-is2: Add pdaf feature to 12a10 sensor X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=79066ecb4ded37485144ad8db247a8534b58cd2d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: Add pdaf feature to 12a10 sensor Change-Id: Ibe4dc721533e5161e7f3bfd9f9b9361c12ae8541 Signed-off-by: Dohyun Kim --- diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10-setA.h b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10-setA.h index 521e2efd1bfe..4415ea613e01 100755 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10-setA.h +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10-setA.h @@ -489,6 +489,31 @@ const struct sensor_pll_info_compact sensor_12a10_pllinfo_A_1280x720_120fps = { 0x0428, /* line_length_pck (0x380c) */ }; +const struct sensor_crop_info sensor_12a10_crop_info_A_4096x3072_30fps = { + 0, /* cal_crop_x */ + 0, /* cal_crop_y */ +}; +#if 0 +const struct sensor_crop_info sensor_12a10_crop_info_A_2048x1536_60fps = { + 0, /* cal_crop_x */ + 0, /* cal_crop_y */ +}; + +const struct sensor_crop_info sensor_12a10_crop_info_A_2000x1124_60fps = { + 24, /* cal_crop_x */ + 206, /* cal_crop_y */ +}; + +const struct sensor_crop_info sensor_12a10_crop_info_A_1920x1080_60fps = { + 64, /* cal_crop_x */ + 228, /* cal_crop_y */ +}; + +const struct sensor_crop_info sensor_12a10_crop_info_A_1280x720_120fps = { + 384, /* cal_crop_x */ + 408, /* cal_crop_y */ +}; +#endif static const u32 *sensor_12a10_setfiles_A[] = { sensor_12a10_setfile_A_4096x3072_30fps, sensor_12a10_setfile_A_2048x1536_60fps, @@ -512,4 +537,12 @@ static const struct sensor_pll_info_compact *sensor_12a10_pllinfos_A[] = { &sensor_12a10_pllinfo_A_1920x1080_60fps,*/ &sensor_12a10_pllinfo_A_1280x720_120fps, }; + +static const struct sensor_crop_info *sensor_12a10_crop_infos_A[] = { + &sensor_12a10_crop_info_A_4096x3072_30fps, + /*&sensor_12a10_crop_info_A_2048x1536_60fps, + &sensor_12a10_crop_info_A_2000x1124_60fps, + &sensor_12a10_crop_info_A_1920x1080_60fps, + &sensor_12a10_crop_info_A_1280x720_120fps,*/ +}; #endif diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10.c index aa8315afccbe..4568e5c2f541 100755 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-12a10.c @@ -50,6 +50,7 @@ static u32 sensor_12a10_global_size; static const u32 **sensor_12a10_setfiles; static const u32 *sensor_12a10_setfile_sizes; static const struct sensor_pll_info_compact **sensor_12a10_pllinfos; +static const struct sensor_crop_info **sensor_12a10_crop_infos; static u32 sensor_12a10_max_setfile_num; static void sensor_12a10_cis_data_calculation(const struct sensor_pll_info_compact *pll_info_compact, cis_shared_data *cis_data) @@ -366,6 +367,13 @@ int sensor_12a10_cis_mode_change(struct v4l2_subdev *subdev, u32 mode) sensor_12a10_cis_data_calculation(sensor_12a10_pllinfos[mode], cis->cis_data); + if (cis->cis_data->is_data.paf_mode) { + cis->cis_data->cur_pos_x = 0; + cis->cis_data->cur_pos_y = 0; + info("get cur_pos_x/y value for MS paf mode x: %d, y: %d\n", + cis->cis_data->cur_pos_x, cis->cis_data->cur_pos_y); + } + I2C_MUTEX_LOCK(cis->i2c_lock); ret = sensor_cis_set_registers(subdev, sensor_12a10_setfiles[mode], sensor_12a10_setfile_sizes[mode]); @@ -1806,6 +1814,7 @@ static int cis_12a10_probe(struct i2c_client *client, sensor_12a10_setfile_sizes = sensor_12a10_setfile_A_sizes; sensor_12a10_pllinfos = sensor_12a10_pllinfos_A; sensor_12a10_max_setfile_num = ARRAY_SIZE(sensor_12a10_setfiles_A); + sensor_12a10_crop_infos = sensor_12a10_crop_infos_A; } cis->use_initial_ae = of_property_read_bool(dnode, "use_initial_ae"); diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-12a10.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-12a10.c index 94b0cf038e0c..67990270792f 100755 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-12a10.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-12a10.c @@ -40,10 +40,10 @@ static struct fimc_is_sensor_cfg config_module_12a10[] = { /* width, height, fps, settle, mode, lane, speed, interleave, pd_mode */ - FIMC_IS_SENSOR_CFG(4096, 3072, 30, 0, 0, CSI_DATA_LANES_4, 1144, CSI_MODE_VC_DT, PD_NONE, + FIMC_IS_SENSOR_CFG(4096, 3072, 30, 0, 0, CSI_DATA_LANES_4, 1144, CSI_MODE_VC_DT, PD_MSPD, VC_IN(0, HW_FORMAT_RAW10, 4096, 3072), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 4096, 3072), - VC_IN(1, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0), - VC_IN(2, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_RAW10, 256, 384), VC_OUT(HW_FORMAT_USER, VC_PRIVATE, 256, 384), + VC_IN(2, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_USER, VC_MIPISTAT, 256, 384), VC_IN(0, HW_FORMAT_EMBEDDED_8BIT, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), FIMC_IS_SENSOR_CFG(2048, 1536, 60, 0, 1, CSI_DATA_LANES_4, 1144, CSI_MODE_VC_DT, PD_NONE, VC_IN(0, HW_FORMAT_RAW10, 2048, 1536), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 2048, 1536), @@ -346,19 +346,19 @@ static int __init sensor_module_12a10_probe(struct platform_device *pdev) module->vc_extra_info[t].stat_type = VC_STAT_TYPE_PAFSTAT_FLOATING; - module->vc_extra_info[t].sensor_mode = VC_SENSOR_MODE_ULTRA_PD_TAIL; - module->vc_extra_info[t].max_width = 4032; - module->vc_extra_info[t].max_height = 1; - module->vc_extra_info[t].max_element = 1; + module->vc_extra_info[t].sensor_mode = VC_SENSOR_MODE_OV_PDAF; + module->vc_extra_info[t].max_width = 256; + module->vc_extra_info[t].max_height = 768; + module->vc_extra_info[t].max_element = 2; break; case VC_BUF_DATA_TYPE_GENERAL_STAT2: module->vc_extra_info[t].stat_type = VC_STAT_TYPE_PAFSTAT_STATIC; - module->vc_extra_info[t].sensor_mode = VC_SENSOR_MODE_ULTRA_PD_TAIL; - module->vc_extra_info[t].max_width = 127680; - module->vc_extra_info[t].max_height = 1; - module->vc_extra_info[t].max_element = 1; + module->vc_extra_info[t].sensor_mode = VC_SENSOR_MODE_OV_PDAF; + module->vc_extra_info[t].max_width = 256; + module->vc_extra_info[t].max_height = 768; + module->vc_extra_info[t].max_element = 2; break; } }