From patchwork Thu Oct 4 15:42:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 1545191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 4F139DF6DA for ; Thu, 4 Oct 2012 07:30:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TJfqj-0005CL-Fq; Thu, 04 Oct 2012 07:28:02 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TJfnu-00038K-OB for linux-arm-kernel@lists.infradead.org; Thu, 04 Oct 2012 07:25:09 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBC00CTLXVK9PN0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 04 Oct 2012 16:24:56 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C9.69.03860.8C93D605; Thu, 04 Oct 2012 16:24:56 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-90-506d39c8de4d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 39.69.03860.7C93D605; Thu, 04 Oct 2012 16:24:56 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBC006I9XWMLU10@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 04 Oct 2012 16:24:55 +0900 (KST) From: Rahul Sharma To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: [PATCH v1 12/14] drm: exynos: hdmi: replace is_v13 with version check in hdmi Date: Thu, 04 Oct 2012 21:12:50 +0530 Message-id: <1349365372-21417-13-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1349365372-21417-1-git-send-email-rahul.sharma@samsung.com> References: <1349365372-21417-1-git-send-email-rahul.sharma@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJLMWRmVeSWpSXmKPExsWyRsSkVveEZW6Awen5nBabHl9jdWD02Lyk PoAxissmJTUnsyy1SN8ugStj4p//rAWvtSr2L7zF2sDYotzFyMEhIWAicekmVxcjJ5ApJnHh 3nq2LkYuDiGBpYwSxzb0sUEkTCR6v/WxQySmM0o07PjNAuFsYJI4//MnE0gVm4CuxOyDzxhB bBEBV4mtW26C2cwCSRLff04CqxEWiJBY2bYTzGYRUJWYfOwDM8gVvAKeEgdu8kAsU5BoXXaI HSTMCRQ+8jMRJCwk4CEx6UMHK0SngMS3yYdYIO6Xldh0gBnkGgmBy2wSd2c9YoEYIylxcMUN lgmMwgsYGVYxiqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBIbf6X/PpHcwrmqwOMQowMGoxMNr MSknQIg1say4MvcQowQHs5II72bF3AAh3pTEyqrUovz4otKc1OJDjD5Al0xklhJNzgfGRl5J vKGxibmpsamlkZGZqSkOYSVx3maPlAAhgfTEktTs1NSC1CKYcUwcnFINjB7nWot5P3ZEuqk7 CEZeNVk4YafepE9rKmI3O/983ch/vXna/0D2hOumpR9vXwzMvLH5yBO3SQ1Jeotz3Hjee7S1 LO6e6rs6aIdSxUu5ghmuDnaHIhaeXj/96lzZT4/dLuxjWzj7sqvb7WlmbBcyq1TYyx4niK5S yfu98emNdu+tbcFv5z/QFFdiKc5INNRiLipOBADXf8EibAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeLIzCtJLcpLzFFi42I5/e+xoO4Jy9wAg2uLGS02Pb7G6sDosXlJ fQBjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYQ1jxsQ//1kLXmtV7F94i7WB sUW5i5GTQ0LARKL3Wx87hC0mceHeerYuRi4OIYHpjBINO36zQDgbmCTO//zJBFLFJqArMfvg M0YQW0TAVWLrlptgNrNAksT3n5PAaoQFIiRWtu0Es1kEVCUmH/vA3MXIwcEr4Clx4CYPxDIF idZlh9hBwpxA4SM/E0HCQgIeEpM+dLBOYORdwMiwilE0tSC5oDgpPddIrzgxt7g0L10vOT93 EyM4vJ9J72Bc1WBxiFGAg1GJh9diUk6AEGtiWXFl7iFGCQ5mJRHezYq5AUK8KYmVValF+fFF pTmpxYcYfYBumsgsJZqcD4y9vJJ4Q2MTc1NjU0sTCxMzSxzCSuK8zR4pAUIC6YklqdmpqQWp RTDjmDg4pRoYmZLzUsR8D12fc2rD5P0V855MLIpqNrr868WhckuTmz6vCtj4O+e/fta+4PBT m+1sWf+F9/9RFd7rHqf28bkRS8uy8JJHK5SSfyVbfl5k58eymP1rTtYu8VLRtzOdFK+diY+q WhabGO8RWK7E9sn7ItsWueyo08Wbb+9R+ND/cVvmxhV+ghLTlViKMxINtZiLihMBN4ha9ZwC AAA= X-CFilter-Loop: Reflected X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.1 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.9 DATE_IN_FUTURE_06_12 Date: is 6 to 12 hours after Received: date -2.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: t.stanislaws@samsung.com, inki.dae@samsung.com, kyungmin.park@samsung.com, joshi@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch removed the is_v13 variable from the hdmi driver context. It is replaced with condition check for the hdmi version. This cleans the way for handling further hdmi versions. Signed-off-by: Rahul Sharma --- drivers/gpu/drm/exynos/exynos_hdmi.c | 40 +++++++++++++++++----------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index e3ab840..89e798b 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -47,6 +47,11 @@ #define MAX_HEIGHT 1080 #define get_hdmi_context(dev) platform_get_drvdata(to_platform_device(dev)) +enum hdmi_type { + HDMI_TYPE13, + HDMI_TYPE14, +}; + struct hdmi_resources { struct clk *hdmi; struct clk *sclk_hdmi; @@ -62,7 +67,6 @@ struct hdmi_context { struct drm_device *drm_dev; bool hpd; bool powered; - bool is_v13; bool dvi_mode; struct mutex hdmi_mutex; @@ -80,6 +84,8 @@ struct hdmi_context { void *parent_ctx; int hpd_gpio; + + enum hdmi_type type; }; /* HDMI Version 1.3 */ @@ -1211,7 +1217,7 @@ static void hdmi_v14_regs_dump(struct hdmi_context *hdata, char *prefix) static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix) { - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) hdmi_v13_regs_dump(hdata, prefix); else hdmi_v14_regs_dump(hdata, prefix); @@ -1252,7 +1258,7 @@ static int hdmi_v14_conf_index(struct drm_display_mode *mode) static int hdmi_conf_index(struct hdmi_context *hdata, struct drm_display_mode *mode) { - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) return hdmi_v13_conf_index(mode); return hdmi_v14_conf_index(mode); @@ -1348,7 +1354,7 @@ static int hdmi_check_timing(void *ctx, void *timing) check_timing->yres, check_timing->refresh, check_timing->vmode); - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) return hdmi_v13_check_timing(check_timing); else return hdmi_v14_check_timing(check_timing); @@ -1414,7 +1420,7 @@ static void hdmi_reg_acr(struct hdmi_context *hdata, u8 *acr) hdmi_reg_writeb(hdata, HDMI_ACR_CTS1, acr[2]); hdmi_reg_writeb(hdata, HDMI_ACR_CTS2, acr[1]); - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) hdmi_reg_writeb(hdata, HDMI_V13_ACR_CON, 4); else hdmi_reg_writeb(hdata, HDMI_ACR_CON, 4); @@ -1518,7 +1524,7 @@ static void hdmi_conf_reset(struct hdmi_context *hdata) { u32 reg; - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) reg = HDMI_V13_CORE_RSTOUT; else reg = HDMI_CORE_RSTOUT; @@ -1550,7 +1556,7 @@ static void hdmi_conf_init(struct hdmi_context *hdata) HDMI_VID_PREAMBLE_DIS | HDMI_GUARD_BAND_DIS); } - if (hdata->is_v13) { + if (hdata->type == HDMI_TYPE13) { /* choose bluescreen (fecal) color */ hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_0, 0x12); hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_1, 0x34); @@ -1832,7 +1838,7 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata) static void hdmi_timing_apply(struct hdmi_context *hdata) { - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) hdmi_v13_timing_apply(hdata); else hdmi_v14_timing_apply(hdata); @@ -1854,7 +1860,7 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata) if (hdata->hdmiphy_port) i2c_master_send(hdata->hdmiphy_port, buffer, 2); - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) reg = HDMI_V13_PHY_RSTOUT; else reg = HDMI_PHY_RSTOUT; @@ -1881,7 +1887,7 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata) } /* pixel clock */ - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) hdmiphy_data = hdmi_v13_confs[hdata->cur_conf].hdmiphy_data; else hdmiphy_data = hdmi_confs[hdata->cur_conf].hdmiphy_data; @@ -1949,7 +1955,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector, drm_mode_set_crtcinfo(adjusted_mode, 0); - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) index = hdmi_v13_conf_index(adjusted_mode); else index = hdmi_v14_conf_index(adjusted_mode); @@ -1963,7 +1969,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector, * to adjusted_mode. */ list_for_each_entry(m, &connector->modes, head) { - if (hdata->is_v13) + if (hdata->type == HDMI_TYPE13) index = hdmi_v13_conf_index(m); else index = hdmi_v14_conf_index(m); @@ -2244,11 +2250,6 @@ void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy) hdmi_hdmiphy = hdmiphy; } -enum hdmi_type { - HDMI_TYPE13, - HDMI_TYPE14, -}; - static struct platform_device_id hdmi_driver_types[] = { { .name = "s5pv210-hdmi", @@ -2272,7 +2273,6 @@ static int __devinit hdmi_probe(struct platform_device *pdev) struct s5p_hdmi_platform_data *pdata; struct resource *res; int ret; - enum hdmi_type hdmi_type; DRM_DEBUG_KMS("[%d]\n", __LINE__); @@ -2303,8 +2303,8 @@ static int __devinit hdmi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, drm_hdmi_ctx); - hdmi_type = platform_get_device_id(pdev)->driver_data; - hdata->is_v13 = (hdmi_type == HDMI_TYPE13); + hdata->type = (enum hdmi_type)platform_get_device_id + (pdev)->driver_data; hdata->hpd_gpio = pdata->hpd_gpio; hdata->dev = dev;