From patchwork Wed Nov 7 11:12:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 1709891 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 28F833FC8F for ; Wed, 7 Nov 2012 10:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753893Ab2KGKw6 (ORCPT ); Wed, 7 Nov 2012 05:52:58 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:29962 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366Ab2KGKw5 (ORCPT ); Wed, 7 Nov 2012 05:52:57 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MD4002Y86812620@mailout2.samsung.com> for linux-fbdev@vger.kernel.org; Wed, 07 Nov 2012 19:52:55 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 65.CB.12699.78D3A905; Wed, 07 Nov 2012 19:52:55 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-93-509a3d8791e2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 25.CB.12699.68D3A905; Wed, 07 Nov 2012 19:52:54 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MD40071065XKE00@mmp1.samsung.com> for linux-fbdev@vger.kernel.org; Wed, 07 Nov 2012 19:52:54 +0900 (KST) From: Ajay Kumar To: linux-fbdev@vger.kernel.org, jg1.han@samsung.com Cc: FlorianSchandinat@gmx.de, olof@lixom.net Subject: [PATCH 1/2] video: exynos_dp: remove redundant parameters Date: Wed, 07 Nov 2012 16:42:23 +0530 Message-id: <1352286744-22588-1-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.0.4 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsWyRsSkWrfddlaAwa753BYn+j6wOjB6fN4k F8AYxWWTkpqTWZZapG+XwJXRvEiq4KRexdGWy2wNjL/Vuxg5OSQETCSe7X3DAmGLSVy4t56t i5GLQ0hgKaPEs4s3mGCKjqxYyQiRWMQosefxd3YIZzmTxLcV75lBqtgEtCW2Tb8JNkoEqGPq 3+tsIDazgI7ElscHWUFsYQEniVMnfoHZLAKqEr1H9oPV8Ap4SLyauxVqm4JE67JD7BA1AhLf Jh8CmskBFJeV2HSAGWSvhMAONol/J69CnS0pcXDFDZYJjIILGBlWMYqmFiQXFCel5xrpFSfm Fpfmpesl5+duYgSG1Ol/z6R3MK5qsDjEKMDBqMTDa5E6M0CINbGsuDL3EKMEB7OSCO9yo1kB QrwpiZVVqUX58UWlOanFhxh9gC6ZyCwlmpwPDPe8knhDYxNzU2NTSyMjM1NTHMJK4rzNHikB QgLpiSWp2ampBalFMOOYODilGhjrdBhMIzgrzSzer1/j9c9GeXa62nbL9tmXPT+vejBbre7N dtefUqrFcod5tb2qrb4Z/TFjrH21nelGmXV404mNLXzztbt+yqTuOHl3Ep/0Hu4rbwsXva2O /dyR9/8g33/BdSccLl+4OsWro3h+bNI75T9TIjSbom71vnk1uTe/96FUQ/BMq3dKLMUZiYZa zEXFiQA8pRhtVgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsVy+t9jAd0221kBBivarC1O9H1gdWD0+LxJ LoAxqoHRJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7UzMBQ19DSwlxJIS8xN9VWycUnQNctMwdo qpJCWWJOKVAoILG4WEnfDtOE0BA3XQuYxghd35AguB4jAzSQsIYxo3mRVMFJvYqjLZfZGhh/ q3cxcnJICJhIHFmxkhHCFpO4cG89WxcjF4eQwCJGiT2Pv7NDOMuZJL6teM8MUsUmoC2xbfpN FhBbBKh76t/rbCA2s4COxJbHB1lBbGEBJ4lTJ36B2SwCqhK9R/aD1fAKeEi8mruVCWKbgkTr skPsExi5FzAyrGIUTS1ILihOSs810itOzC0uzUvXS87P3cQIDthn0jsYVzVYHGIU4GBU4uG1 SJ0ZIMSaWFZcmXuIUYKDWUmEd7nRrAAh3pTEyqrUovz4otKc1OJDjD5A2ycyS4km5wOjKa8k 3tDYxNzU2NTSxMLEzBKHsJI4b7NHSoCQQHpiSWp2ampBahHMOCYOTqkGRvcTX/Y5sW1g/7/v 2WM9Se7Nx3/t8ZUUvDwt6qhmy73J89dyC/7RmXGq6Mw7BSWtFRkSD/4JWcZeP/+xck4fR03h Hn+tx6cu/14/cdNX9w/vGbM+hp1dt6Jnpy/3HO7JU91sFjesX1zVtf64Vr7BHKPlE2rXLNNa zKz/SV7417Jfn0/Z1TqwuyorsRRnJBpqMRcVJwIAFOh8PIUCAAA= X-CFilter-Loop: Reflected Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org This patch cleans up few redundant parameters keeping the same functionality intact. Signed-off-by: Olof Johansson Signed-off-by: Ajay Kumar Acked-by: Jingoo Han --- drivers/video/exynos/exynos_dp_core.c | 14 +++++--------- drivers/video/exynos/exynos_dp_core.h | 9 ++------- drivers/video/exynos/exynos_dp_reg.c | 23 +++++++++-------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c index d55470e..f62778c 100644 --- a/drivers/video/exynos/exynos_dp_core.c +++ b/drivers/video/exynos/exynos_dp_core.c @@ -752,19 +752,15 @@ static int exynos_dp_set_link_train(struct exynos_dp_device *dp, return retval; } -static int exynos_dp_config_video(struct exynos_dp_device *dp, - struct video_info *video_info) +static int exynos_dp_config_video(struct exynos_dp_device *dp) { int retval = 0; int timeout_loop = 0; int done_count = 0; - exynos_dp_config_video_slave_mode(dp, video_info); + exynos_dp_config_video_slave_mode(dp); - exynos_dp_set_video_color_format(dp, video_info->color_depth, - video_info->color_space, - video_info->dynamic_range, - video_info->ycbcr_coeff); + exynos_dp_set_video_color_format(dp); if (exynos_dp_get_pll_lock_status(dp) == PLL_UNLOCKED) { dev_err(dp->dev, "PLL is not locked yet.\n"); @@ -937,7 +933,7 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev) exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate); exynos_dp_init_video(dp); - ret = exynos_dp_config_video(dp, dp->video_info); + ret = exynos_dp_config_video(dp); if (ret) { dev_err(&pdev->dev, "unable to config video\n"); return ret; @@ -1003,7 +999,7 @@ static int exynos_dp_resume(struct device *dev) exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate); exynos_dp_init_video(dp); - exynos_dp_config_video(dp, dp->video_info); + exynos_dp_config_video(dp); return 0; } diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h index 57b8a65..1e646d7 100644 --- a/drivers/video/exynos/exynos_dp_core.h +++ b/drivers/video/exynos/exynos_dp_core.h @@ -107,11 +107,7 @@ u32 exynos_dp_get_lane3_link_training(struct exynos_dp_device *dp); void exynos_dp_reset_macro(struct exynos_dp_device *dp); void exynos_dp_init_video(struct exynos_dp_device *dp); -void exynos_dp_set_video_color_format(struct exynos_dp_device *dp, - u32 color_depth, - u32 color_space, - u32 dynamic_range, - u32 ycbcr_coeff); +void exynos_dp_set_video_color_format(struct exynos_dp_device *dp); int exynos_dp_is_slave_video_stream_clock_on(struct exynos_dp_device *dp); void exynos_dp_set_video_cr_mn(struct exynos_dp_device *dp, enum clock_recovery_m_value_type type, @@ -121,8 +117,7 @@ void exynos_dp_set_video_timing_mode(struct exynos_dp_device *dp, u32 type); void exynos_dp_enable_video_master(struct exynos_dp_device *dp, bool enable); void exynos_dp_start_video(struct exynos_dp_device *dp); int exynos_dp_is_video_stream_on(struct exynos_dp_device *dp); -void exynos_dp_config_video_slave_mode(struct exynos_dp_device *dp, - struct video_info *video_info); +void exynos_dp_config_video_slave_mode(struct exynos_dp_device *dp); void exynos_dp_enable_scrambling(struct exynos_dp_device *dp); void exynos_dp_disable_scrambling(struct exynos_dp_device *dp); diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c index 3f5ca8a..db4975d 100644 --- a/drivers/video/exynos/exynos_dp_reg.c +++ b/drivers/video/exynos/exynos_dp_reg.c @@ -1034,24 +1034,20 @@ void exynos_dp_init_video(struct exynos_dp_device *dp) writel(reg, dp->reg_base + EXYNOS_DP_VIDEO_CTL_8); } -void exynos_dp_set_video_color_format(struct exynos_dp_device *dp, - u32 color_depth, - u32 color_space, - u32 dynamic_range, - u32 ycbcr_coeff) +void exynos_dp_set_video_color_format(struct exynos_dp_device *dp) { u32 reg; /* Configure the input color depth, color space, dynamic range */ - reg = (dynamic_range << IN_D_RANGE_SHIFT) | - (color_depth << IN_BPC_SHIFT) | - (color_space << IN_COLOR_F_SHIFT); + reg = (dp->video_info->dynamic_range << IN_D_RANGE_SHIFT) | + (dp->video_info->color_depth << IN_BPC_SHIFT) | + (dp->video_info->color_space << IN_COLOR_F_SHIFT); writel(reg, dp->reg_base + EXYNOS_DP_VIDEO_CTL_2); /* Set Input Color YCbCr Coefficients to ITU601 or ITU709 */ reg = readl(dp->reg_base + EXYNOS_DP_VIDEO_CTL_3); reg &= ~IN_YC_COEFFI_MASK; - if (ycbcr_coeff) + if (dp->video_info->ycbcr_coeff) reg |= IN_YC_COEFFI_ITU709; else reg |= IN_YC_COEFFI_ITU601; @@ -1178,8 +1174,7 @@ int exynos_dp_is_video_stream_on(struct exynos_dp_device *dp) return 0; } -void exynos_dp_config_video_slave_mode(struct exynos_dp_device *dp, - struct video_info *video_info) +void exynos_dp_config_video_slave_mode(struct exynos_dp_device *dp) { u32 reg; @@ -1190,17 +1185,17 @@ void exynos_dp_config_video_slave_mode(struct exynos_dp_device *dp, reg = readl(dp->reg_base + EXYNOS_DP_VIDEO_CTL_10); reg &= ~INTERACE_SCAN_CFG; - reg |= (video_info->interlaced << 2); + reg |= (dp->video_info->interlaced << 2); writel(reg, dp->reg_base + EXYNOS_DP_VIDEO_CTL_10); reg = readl(dp->reg_base + EXYNOS_DP_VIDEO_CTL_10); reg &= ~VSYNC_POLARITY_CFG; - reg |= (video_info->v_sync_polarity << 1); + reg |= (dp->video_info->v_sync_polarity << 1); writel(reg, dp->reg_base + EXYNOS_DP_VIDEO_CTL_10); reg = readl(dp->reg_base + EXYNOS_DP_VIDEO_CTL_10); reg &= ~HSYNC_POLARITY_CFG; - reg |= (video_info->h_sync_polarity << 0); + reg |= (dp->video_info->h_sync_polarity << 0); writel(reg, dp->reg_base + EXYNOS_DP_VIDEO_CTL_10); reg = AUDIO_MODE_SPDIF_MODE | VIDEO_MODE_SLAVE_MODE;