From db93f98b582b07221fa433ababcbcec81c0a2cd7 Mon Sep 17 00:00:00 2001 From: SangHyun Sim Date: Fri, 8 Jun 2018 15:36:37 +0900 Subject: [PATCH] [COMMON] fimc-is2: modify 4h5yc module files for maestro Change-Id: Iea9480cded76805df6603f042cf564d4147ec45d Signed-off-by: SangHyun Sim --- .../module_framework/cis/fimc-is-cis-4h5yc.c | 20 ++-- .../modules/fimc-is-device-module-4h5yc.c | 93 +++++++++---------- 2 files changed, 50 insertions(+), 63 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-4h5yc.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-4h5yc.c index d1dcb9eafcb4..accf23da5d7e 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-4h5yc.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-4h5yc.c @@ -57,7 +57,7 @@ static void sensor_4h5yc_cis_data_calculation(const struct sensor_pll_info *pll_ u32 pll_voc_a = 0, vt_pix_clk_hz = 0; u32 frame_rate = 0, max_fps = 0, frame_valid_us = 0; - FIMC_BUG(!pll_info); + FIMC_BUG_VOID(!pll_info); /* 1. mipi data rate calculation (Mbps/Lane) */ /* ToDo: using output Pixel Clock Divider Value */ @@ -1639,15 +1639,13 @@ int sensor_4h5yc_cis_compensate_gain_for_extremely_br(struct v4l2_subdev *subdev ratio = ((expo << 8) / integration_time); if (pre_coarse_int <= 15) { - compensated_again = (*again * (pre_ratio)) >> 8; - - if (compensated_again < cis_data->min_analog_gain[1]) { + compensated_again = (*again * (pre_ratio)) >> 8; + if (compensated_again < cis_data->min_analog_gain[1]) *again = cis_data->min_analog_gain[1]; - } else if (*again >= cis_data->max_analog_gain[1]) { + else if (*again >= cis_data->max_analog_gain[1]) *dgain = (*dgain * (pre_ratio)); - } else { + else *again = compensated_again; - } dbg_sensor(1, "[%s] exp(%d), again(%d), dgain(%d), coarse_int(%d)," KERN_CONT "compensated_again(%d), integration_time : (%d)\n", @@ -1765,12 +1763,10 @@ static int cis_4h5yc_probe(struct i2c_client *client, if (of_property_read_bool(dnode, "sensor_f_number")) { ret = of_property_read_u32(dnode, "sensor_f_number", &cis->aperture_num); - if (ret) { - warn("f-number read is fail(%d)",ret); - } - } else { + if (ret) + warn("f-number read is fail(%d)", ret); + } else cis->aperture_num = F2_2; - } probe_info("%s f-number %d\n", __func__, cis->aperture_num); diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-4h5yc.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-4h5yc.c index 81f9919bd954..5624f5ed2672 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-4h5yc.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-4h5yc.c @@ -40,26 +40,29 @@ static struct fimc_is_sensor_cfg config_module_4h5yc[] = { /* 3280x2458@30fps */ - FIMC_IS_SENSOR_CFG(3280, 2458, 30, 36, 0, CSI_DATA_LANES_4), + FIMC_IS_SENSOR_CFG(3280, 2458, 30, 0, 0, CSI_DATA_LANES_4, 689, CSI_MODE_DT_ONLY, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 3280, 2458), 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_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), /* 3280x1846@30fps */ - FIMC_IS_SENSOR_CFG(3280, 1846, 30, 29, 1, CSI_DATA_LANES_4), + FIMC_IS_SENSOR_CFG(3280, 1846, 30, 0, 1, CSI_DATA_LANES_4, 689, CSI_MODE_DT_ONLY, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 3280, 1846), 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_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), /* 1640x924_60fps */ - FIMC_IS_SENSOR_CFG(1640, 924, 60, 36, 2, CSI_DATA_LANES_4), + FIMC_IS_SENSOR_CFG(1640, 924, 60, 0, 2, CSI_DATA_LANES_4, 689, CSI_MODE_DT_ONLY, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 1640, 924), 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_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0), + VC_IN(3, HW_FORMAT_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, VC_NOTHING, 0, 0)), /* 816x460_120fps */ - FIMC_IS_SENSOR_CFG(816, 460, 120, 29, 3, CSI_DATA_LANES_4), -}; - -static struct fimc_is_vci vci_module_4h5yc[] = { - { - .pixelformat = V4L2_PIX_FMT_SBGGR10, - .config = {{0, HW_FORMAT_RAW10}, {1, HW_FORMAT_UNKNOWN}, {2, HW_FORMAT_USER}, {3, 0}} - }, { - .pixelformat = V4L2_PIX_FMT_SBGGR12, - .config = {{0, HW_FORMAT_RAW10}, {1, HW_FORMAT_UNKNOWN}, {2, HW_FORMAT_USER}, {3, 0}} - }, { - .pixelformat = V4L2_PIX_FMT_SBGGR16, - .config = {{0, HW_FORMAT_RAW10}, {1, HW_FORMAT_UNKNOWN}, {2, HW_FORMAT_USER}, {3, 0}} - } + FIMC_IS_SENSOR_CFG(816, 460, 120, 0, 3, CSI_DATA_LANES_4, 689, CSI_MODE_DT_ONLY, PD_NONE, + VC_IN(0, HW_FORMAT_RAW10, 816, 460), 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_UNKNOWN, 0, 0), VC_OUT(HW_FORMAT_UNKNOWN, 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 = { @@ -73,7 +76,8 @@ static const struct v4l2_subdev_core_ops core_ops = { }; static const struct v4l2_subdev_video_ops video_ops = { - .s_stream = sensor_module_s_stream + .s_stream = sensor_module_s_stream, + .s_parm = sensor_module_s_param }; static const struct v4l2_subdev_pad_ops pad_ops = { @@ -118,45 +122,37 @@ static int sensor_module_4h5yc_power_setpin(struct platform_device *pdev, /* Normal on */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_reset, "sen_rst low", PIN_OUTPUT, 0, 0); - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "REAR_CAM_AF_2V8", PIN_REGULATOR, 1, 0); - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "REAR_CAM_DOVDD_1V8", PIN_REGULATOR, 1, 0); - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "cam_vddd", PIN_REGULATOR, 1, 0); -#ifdef CONFIG_MACH_UNIVERSAL3475 - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "ldo1", PIN_REGULATOR, 1, 0); -#endif - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "pin", PIN_FUNCTION, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "VDD_REAR_CAM_AF_2V8", PIN_REGULATOR, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "DOVDD_REAR_CAM_1V8", PIN_REGULATOR, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "DVDD_REAR_CAM_1V2", PIN_REGULATOR, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "on_i2c", PIN_I2C, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_none, "pin", PIN_FUNCTION, 2, 0); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, gpio_reset, "sen_rst high", PIN_OUTPUT, 1, 0); /* Normal off */ - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "REAR_CAM_AF_2V8", PIN_REGULATOR, 0, 0); - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "cam_vddd", PIN_REGULATOR, 0, 0); -#ifdef CONFIG_MACH_UNIVERSAL3475 - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "ldo1", PIN_REGULATOR, 0, 0); -#endif - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "pin", PIN_FUNCTION, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "VDD_REAR_CAM_AF_2V8", PIN_REGULATOR, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "DVDD_REAR_CAM_1V2", PIN_REGULATOR, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "pin", PIN_FUNCTION, 0, 0); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_reset, "sen_rst", PIN_OUTPUT, 0, 0); - SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "REAR_CAM_DOVDD_1V8", PIN_REGULATOR, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "off_i2c", PIN_I2C, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, gpio_none, "DOVDD_REAR_CAM_1V8", PIN_REGULATOR, 0, 0); /* Vision on */ SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_reset, "sen_rst low", PIN_OUTPUT, 0, 0); - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "REAR_CAM_AF_2V8", PIN_REGULATOR, 1, 0); - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "REAR_CAM_DOVDD_1V8", PIN_REGULATOR, 1, 0); - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "cam_vddd", PIN_REGULATOR, 1, 0); -#ifdef CONFIG_MACH_UNIVERSAL3475 - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "ldo1", PIN_REGULATOR, 1, 0); -#endif - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "pin", PIN_FUNCTION, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "VDD_REAR_CAM_AF_2V8", PIN_REGULATOR, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "DOVDD_REAR_CAM_1V8", PIN_REGULATOR, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "DVDD_REAR_CAM_1V2", PIN_REGULATOR, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "pin", PIN_FUNCTION, 2, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_none, "on_i2c", PIN_I2C, 1, 0); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, gpio_reset, "sen_rst high", PIN_OUTPUT, 1, 0); /* Vision off */ - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "REAR_CAM_AF_2V8", PIN_REGULATOR, 0, 0); - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "cam_vddd", PIN_REGULATOR, 0, 0); -#ifdef CONFIG_MACH_UNIVERSAL3475 - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "ldo1", PIN_REGULATOR, 0, 0); -#endif - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "pin", PIN_FUNCTION, 1, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "VDD_REAR_CAM_AF_2V8", PIN_REGULATOR, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "DVDD_REAR_CAM_1V2", PIN_REGULATOR, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "pin", PIN_FUNCTION, 0, 0); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_reset, "sen_rst", PIN_OUTPUT, 0, 0); - SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "REAR_CAM_DOVDD_1V8", PIN_REGULATOR, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "off_i2c", PIN_I2C, 0, 0); + SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, gpio_none, "DOVDD_REAR_CAM_1V8", PIN_REGULATOR, 0, 0); dev_info(dev, "%s X v4\n", __func__); @@ -215,11 +211,7 @@ static int __init sensor_module_4h5yc_probe(struct platform_device *pdev) module->pixel_height = module->active_height; module->max_framerate = 120; module->position = pdata->position; - module->mode = CSI_MODE_DT_ONLY; - module->lanes = CSI_DATA_LANES_4; module->bitwidth = 10; - module->vcis = ARRAY_SIZE(vci_module_4h5yc); - module->vci = vci_module_4h5yc; module->sensor_maker = "SLSI"; module->sensor_name = "S5K4H5YC"; module->setfile_name = "setfile_4h5yc.bin"; @@ -237,7 +229,6 @@ static int __init sensor_module_4h5yc_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; -- 2.20.1