From 7c5bd04e0e8828d1a103b7bca1d54273adc78a32 Mon Sep 17 00:00:00 2001 From: Eunyoung Lee Date: Fri, 6 Jul 2018 09:58:42 +0900 Subject: [PATCH] [COMMON] fimc-is2: changed 2P6 sensor_cfg PR JIRA ID : CPR-38 Change-Id: I41eff5d76aff13e94c745f9c8b7e81e1a74ebcad Signed-off-by: Eunyoung Lee --- .../module_framework/cis/fimc-is-cis-2p6.c | 18 +-- .../modules/fimc-is-device-module-2p6.c | 103 ++++++++++-------- 2 files changed, 64 insertions(+), 57 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c index d936478db92c..0364464b79d9 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c @@ -403,23 +403,23 @@ int sensor_2p6_cis_mode_change(struct v4l2_subdev *subdev, u32 mode) /* In case of fastAE or high speed fps, forced to set pdaf off */ if (cis->use_pdaf == true) { if (mode <= SENSOR_2P6_MODE_2304X1120_30) { - cis->cis_data->companion_data.paf_stat_enable = true; + cis->cis_data->is_data.paf_stat_enable = true; } else { - cis->cis_data->companion_data.paf_stat_enable = false; + cis->cis_data->is_data.paf_stat_enable = false; } dbg_sensor(1, "[%s] mode(%d) paf_stat_enable(%d) \n", - __func__, mode, cis->cis_data->companion_data.paf_stat_enable); + __func__, mode, cis->cis_data->is_data.paf_stat_enable); } #if defined(USE_SENSOR_WDR) /* In case of fastAE or high speed fps, forced to set wdr off */ if (mode <= SENSOR_2P6_MODE_4608X2240_30) { - cis->cis_data->companion_data.wdr_enable = true; + cis->cis_data->is_data.wdr_enable = true; } else { - cis->cis_data->companion_data.wdr_enable = false; + cis->cis_data->is_data.wdr_enable = false; } dbg_sensor(1, "[%s] mode(%d) wdr_enable(%d) \n", - __func__, mode, cis->cis_data->companion_data.wdr_enable); + __func__, mode, cis->cis_data->is_data.wdr_enable); #endif if (cis->use_pdaf == true) { @@ -452,9 +452,9 @@ int sensor_2p6_cis_mode_change(struct v4l2_subdev *subdev, u32 mode) #endif /* pdaf tail mode off */ - if (cis->cis_data->companion_data.paf_stat_enable == false) { + if (cis->cis_data->is_data.paf_stat_enable == false) { info("[%s]: Set pdaf tail mode off (paf_stat_enable %d)\n", - __func__, cis->cis_data->companion_data.paf_stat_enable); + __func__, cis->cis_data->is_data.paf_stat_enable); ret = fimc_is_sensor_write16(cis->client, 0x6028, 0x2000); if (ret < 0) { @@ -475,7 +475,7 @@ int sensor_2p6_cis_mode_change(struct v4l2_subdev *subdev, u32 mode) } #if defined(USE_SENSOR_WDR) - if (cis->cis_data->companion_data.wdr_enable == false) { + if (cis->cis_data->is_data.wdr_enable == false) { info("[%s] S5K2P6_WDR_DISABLE\n", __func__); ret = fimc_is_sensor_write16(cis->client, 0x6028, 0x4000); if (ret < 0) { diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-2p6.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-2p6.c index d079a834e4f1..201587874c86 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-2p6.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-2p6.c @@ -51,46 +51,52 @@ enum sensor_module_2p6_position { }; static struct fimc_is_sensor_cfg config_module_2p6[] = { - /* 4608x3456@30fps */ - FIMC_IS_SENSOR_CFG_EXT(4608, 3456, 30, 32, 0, CSI_DATA_LANES_4, 1443, SET_VC(VC_TAIL_MODE_PDAF, 288, 1728), 0, 0), - /* 4608x2624@30fps */ - FIMC_IS_SENSOR_CFG_EXT(4608, 2624, 30, 32, 1, CSI_DATA_LANES_4, 1443, SET_VC(VC_TAIL_MODE_PDAF, 288, 1312), 0, 0), - /* 4608x2240@30fps */ - FIMC_IS_SENSOR_CFG_EXT(4608, 2240, 30, 32, 2, CSI_DATA_LANES_4, 1443, SET_VC(VC_TAIL_MODE_PDAF, 288, 1120), 0, 0), - /* 2304x1728@30fps */ - FIMC_IS_SENSOR_CFG_EXT(2304, 1728, 30, 32, 3, CSI_DATA_LANES_4, 1352, SET_VC(VC_TAIL_MODE_PDAF, 288, 1728), 0, 0), - /* 2304x1728@15fps */ - FIMC_IS_SENSOR_CFG_EXT(2304, 1728, 15, 32, 4, CSI_DATA_LANES_4, 1352, SET_VC(VC_TAIL_MODE_PDAF, 288, 1728), 0, 0), - /* 2304x1312@30fps */ - FIMC_IS_SENSOR_CFG_EXT(2304, 1312, 30, 32, 5, CSI_DATA_LANES_4, 1352, SET_VC(VC_TAIL_MODE_PDAF, 288, 1312), 0, 0), - /* 2304x1120@30fps */ - FIMC_IS_SENSOR_CFG_EXT(2304, 1120, 30, 32, 6, CSI_DATA_LANES_4, 1352, SET_VC(VC_TAIL_MODE_PDAF, 288, 1120), 0, 0), - /* 1152x864@120fps */ - FIMC_IS_SENSOR_CFG_EXT(1152, 864, 120, 32, 7, CSI_DATA_LANES_4, 1352, 0, 0, 0), - /* 1152x656@120fps */ - FIMC_IS_SENSOR_CFG_EXT(1152, 656, 120, 32, 8, CSI_DATA_LANES_4, 1352, 0, 0, 0), -}; - -static struct fimc_is_vci vci_module_2p6[] = { - { - .pixelformat = V4L2_PIX_FMT_SBGGR10, - .config = {{0, HW_FORMAT_RAW10, VCI_DMA_NORMAL}, - {1, HW_FORMAT_RAW10, VCI_DMA_INTERNAL}, - {2, 0, VCI_DMA_NORMAL}, - {3, 0, VCI_DMA_NORMAL}} - }, { - .pixelformat = V4L2_PIX_FMT_SBGGR12, - .config = {{0, HW_FORMAT_RAW10, VCI_DMA_NORMAL}, - {1, HW_FORMAT_RAW10, VCI_DMA_INTERNAL}, - {2, 0, VCI_DMA_NORMAL}, - {3, 0, VCI_DMA_NORMAL}} - }, { - .pixelformat = V4L2_PIX_FMT_SBGGR16, - .config = {{0, HW_FORMAT_RAW10, VCI_DMA_NORMAL}, - {1, HW_FORMAT_RAW10, VCI_DMA_INTERNAL}, - {2, 0, VCI_DMA_NORMAL}, - {3, 0, VCI_DMA_NORMAL}} - } + /* width, height, fps, settle, mode, lane, speed, interleave, pd_mode */ + FIMC_IS_SENSOR_CFG(4608, 3456, 30, 0, 0, CSI_DATA_LANES_4, 1443, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 4608, 3456), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_RAW10, 288, 1728), VC_OUT(HW_FORMAT_RAW10, VC_TAILPDAF, 288, 1728), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(4608, 2624, 30, 0, 1, CSI_DATA_LANES_4, 1443, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 4608, 2624), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_RAW10, 288, 1312), VC_OUT(HW_FORMAT_RAW10, VC_TAILPDAF, 288, 1312), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(4608, 2240, 30, 0, 2, CSI_DATA_LANES_4, 1443, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 4608, 2240), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_RAW10, 288, 1120), VC_OUT(HW_FORMAT_RAW10, VC_TAILPDAF, 288, 1120), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(2304, 1728, 30, 0, 3, CSI_DATA_LANES_4, 1352, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 2304, 1728), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_RAW10, 288, 1728), VC_OUT(HW_FORMAT_RAW10, VC_TAILPDAF, 288, 1728), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(2304, 1728, 15, 0, 4, CSI_DATA_LANES_4, 1352, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 2304, 1728), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_UNKNOWN, 288, 1728), VC_OUT(HW_FORMAT_RAW10, VC_TAILPDAF, 288, 1728), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(2304, 1312, 30, 0, 5, CSI_DATA_LANES_4, 1352, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 2304, 1312), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_UNKNOWN, 288, 1312), VC_OUT(HW_FORMAT_RAW10, VC_TAILPDAF, 288, 1312), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(2304, 1120, 30, 0, 6, CSI_DATA_LANES_4, 1352, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 2304, 1120), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_RAW10, 288, 1120), VC_OUT(HW_FORMAT_RAW10, VC_TAILPDAF, 288, 1120), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(1152, 864, 120, 0, 7, CSI_DATA_LANES_4, 1352, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 1152, 864), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), + FIMC_IS_SENSOR_CFG(1152, 656, 120, 0, 8, CSI_DATA_LANES_4, 1352, CSI_MODE_VC_DT, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 1152, 656), VC_OUT(HW_FORMAT_RAW10, VC_NOTHING, 0, 0), + VC_IN(1, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0), + VC_IN(2, HW_FORMAT_USER, 0, 0), VC_OUT(HW_FORMAT_USER, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), }; static const struct v4l2_subdev_core_ops core_ops = { @@ -651,6 +657,7 @@ int sensor_module_2p6_probe(struct platform_device *pdev) struct exynos_platform_fimc_is_module *pdata; struct device *dev; struct device_node *af_np; + struct pinctrl_state *s; BUG_ON(!fimc_is_dev); @@ -708,11 +715,7 @@ int sensor_module_2p6_probe(struct platform_device *pdev) module->pixel_height = module->active_height; module->max_framerate = 120; module->position = pdata->position; - module->mode = CSI_MODE_VC_DT; - module->lanes = CSI_DATA_LANES_4; module->bitwidth = 10; - module->vcis = ARRAY_SIZE(vci_module_2p6); - module->vci = vci_module_2p6; module->sensor_maker = "SLSI"; if (use_pdaf == true) { module->sensor_name = "S5K2P6SX"; /* pdaf sensor */ @@ -727,10 +730,8 @@ int sensor_module_2p6_probe(struct platform_device *pdev) module->cfgs = ARRAY_SIZE(config_module_2p6); module->cfg = config_module_2p6; module->ops = NULL; - for (ch = 1; ch < CSI_VIRTUAL_CH_MAX; ch++) { - module->internal_vc[ch] = pdata->internal_vc[ch]; + for (ch = 1; ch < CSI_VIRTUAL_CH_MAX; ch++) module->vc_buffer_offset[ch] = pdata->vc_buffer_offset[ch]; - } /* Sensor peri */ module->private_data = kzalloc(sizeof(struct fimc_is_device_sensor_peri), GFP_KERNEL); if (!module->private_data) { @@ -742,7 +743,6 @@ int sensor_module_2p6_probe(struct platform_device *pdev) PERI_SET_MODULE(module); ext = &module->ext; - ext->mipi_lane_num = module->lanes; ext->sensor_con.product_name = module->sensor_id; ext->sensor_con.peri_type = SE_I2C; @@ -801,6 +801,13 @@ int sensor_module_2p6_probe(struct platform_device *pdev) v4l2_set_subdev_hostdata(subdev_module, device); snprintf(subdev_module->name, V4L2_SUBDEV_NAME_SIZE, "sensor-subdev.%d", module->sensor_id); + s = pinctrl_lookup_state(pdata->pinctrl, "release"); + + if (pinctrl_select_state(pdata->pinctrl, s) < 0) { + probe_err("pinctrl_select_state is fail\n"); + goto p_err; + } + probe_info("%s done\n", __func__); p_err: -- 2.20.1