From 2ec5b2b664593ef1d137943743a20e92e89a99ad Mon Sep 17 00:00:00 2001 From: Sunmi Lee Date: Sun, 17 Jun 2018 18:11:57 +0900 Subject: [PATCH] [COMMON] fimc-is2: Code cleanup of ysum in mcsc Change-Id: I491a3646f02e573f8b91ad30af09408540d12dfb Signed-off-by: Sunmi Lee --- .../hardware/fimc-is-hw-mcscaler-v2.c | 23 ++++++++++--------- .../hardware/fimc-is-hw-mcscaler-v2.h | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c index 679f449234aa..0abadc3d0c2d 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c @@ -830,15 +830,10 @@ config: ret_internal = fimc_is_hw_mcsc_update_dsvra_register(hw_ip, head, mcs_param, instance, frame->shot); ret_internal = fimc_is_hw_mcsc_update_tdnr_register(hw_ip, frame, param, start_flag); - - /* setting for YSUM */ - if (cap->ysum == MCSC_CAP_SUPPORT) { - ret_internal = fimc_is_hw_mcsc_update_ysum_register(hw_ip, head, mcs_param, instance, - frame->shot ? frame->shot->uctl.scalerUd.mcsc_sub_blk_port[INTERFACE_TYPE_YSUM] : MCSC_PORT_NONE); - if (ret_internal) { - msdbg_hw(2, "ysum cfg is failed\n", instance, hw_ip); - fimc_is_scaler_set_ysum_enable(hw_ip->regs, false); - } + ret_internal = fimc_is_hw_mcsc_update_ysum_register(hw_ip, head, mcs_param, instance, frame->shot); + if (ret_internal) { + msdbg_hw(2, "ysum cfg is failed\n", instance, hw_ip); + fimc_is_scaler_set_ysum_enable(hw_ip->regs, false); } /* for set shadow register write start @@ -2490,13 +2485,14 @@ int fimc_is_hw_mcsc_update_dsvra_register(struct fimc_is_hw_ip *hw_ip, int fimc_is_hw_mcsc_update_ysum_register(struct fimc_is_hw_ip *hw_ip, struct fimc_is_group *head, struct mcs_param *mcs_param, - u32 instance, enum mcsc_port ysumport) + u32 instance, struct camera2_shot *shot) { int ret = 0; struct fimc_is_hw_mcsc *hw_mcsc = NULL; struct fimc_is_hw_mcsc_cap *cap; u32 width, height; u32 start_x = 0, start_y = 0; + enum mcsc_port ysumport; FIMC_BUG(!hw_ip); FIMC_BUG(!hw_ip->priv_info); @@ -2505,6 +2501,11 @@ int fimc_is_hw_mcsc_update_ysum_register(struct fimc_is_hw_ip *hw_ip, hw_mcsc = (struct fimc_is_hw_mcsc *)hw_ip->priv_info; cap = GET_MCSC_HW_CAP(hw_ip); + if (cap->ysum != MCSC_CAP_SUPPORT) + return ret; + + ysumport = shot ? shot->uctl.scalerUd.mcsc_sub_blk_port[INTERFACE_TYPE_YSUM] : MCSC_PORT_NONE; + if (ysumport == MCSC_PORT_NONE) return -EINVAL; @@ -2536,8 +2537,8 @@ int fimc_is_hw_mcsc_update_ysum_register(struct fimc_is_hw_ip *hw_ip, goto no_setting_ysum; break; } - fimc_is_scaler_set_ysum_image_size(hw_ip->regs, width, height, start_x, start_y); + fimc_is_scaler_set_ysum_image_size(hw_ip->regs, width, height, start_x, start_y); fimc_is_scaler_set_ysum_input_sourece_enable(hw_ip->regs, ysumport, true); if (!test_bit(FIMC_IS_GROUP_OTF_INPUT, &head->state)) diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h index de5e9075e8c1..8f927f40a8bd 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h @@ -236,7 +236,7 @@ int fimc_is_hw_mcsc_update_djag_register(struct fimc_is_hw_ip *hw_ip, u32 instance); int fimc_is_hw_mcsc_update_ysum_register(struct fimc_is_hw_ip *hw_ip, struct fimc_is_group *head, struct mcs_param *mcs_param, - u32 instance, enum mcsc_port ysumport); + u32 instance, struct camera2_shot *shot); int fimc_is_hw_mcsc_update_dsvra_register(struct fimc_is_hw_ip *hw_ip, struct fimc_is_group *head, struct mcs_param *mcs_param, -- 2.20.1