From patchwork Wed Apr 2 17:13:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 3929881 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BCEB6BF540 for ; Wed, 2 Apr 2014 17:14:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF956201FB for ; Wed, 2 Apr 2014 17:14:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EDA1F20200 for ; Wed, 2 Apr 2014 17:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932341AbaDBRO3 (ORCPT ); Wed, 2 Apr 2014 13:14:29 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:34097 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932263AbaDBRO2 (ORCPT ); Wed, 2 Apr 2014 13:14:28 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3E000L5YK3QPC0@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 03 Apr 2014 02:14:27 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 2A.14.09028.3754C335; Thu, 03 Apr 2014 02:14:27 +0900 (KST) X-AuditID: cbfee68e-b7f566d000002344-34-533c45732122 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 48.83.29263.2754C335; Thu, 03 Apr 2014 02:14:27 +0900 (KST) Received: from localhost.localdomain ([107.108.83.245]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3E008ZSYJTP380@mmp1.samsung.com>; Thu, 03 Apr 2014 02:14:26 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: inki.dae@samsung.com, r.sh.open@gmail.com, joshi@samsung.com, Rahul Sharma Subject: [PATCH 2/5] drm/exynos: use regmap interface to set hdmiphy control bit in pmu Date: Wed, 02 Apr 2014 22:43:43 +0530 Message-id: <1396458826-3051-3-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1396458826-3051-1-git-send-email-rahul.sharma@samsung.com> References: <1396458826-3051-1-git-send-email-rahul.sharma@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFLMWRmVeSWpSXmKPExsWyRsSkVrfY1SbY4NMPbosrX9+zWUy6P4HF 4vuuL+wWM87vY7JY+CLeYsqiw6wObB47Z91l97jffZzJo2/LKkaPz5vkAliiuGxSUnMyy1KL 9O0SuDJOXXnFWvBZpuLqqS/MDYzTJboYOTkkBEwkpi87yAxhi0lcuLeerYuRi0NIYCmjxPtj E5lgir4/X8AMkVjEKDH1JkxVO5NE398FbCBVbAK6ErMPPmMEsUUE3CSaDs9kBbGZBbIlDh94 CRYXFoiUuNG4CCjOwcEioCpx/B1YmFfAXaLt1ypmkLCEgILEnEk2IGFOAQ+JT09fg5UIAZV8 3tPMCrJWQqCbXWLZ8XawBIuAgMS3yYdYIHplJTYdgHpGUuLgihssExiFFzAyrGIUTS1ILihO Si8y0itOzC0uzUvXS87P3cQIDOfT/5717WC8ecD6EGMy0LiJzFKiyfnAeMgriTc0NjOyMDUx NTYytzQjTVhJnHfRw6QgIYH0xJLU7NTUgtSi+KLSnNTiQ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geks2gIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rahul Sharma Hdmiphy control bit needs to be set before setting the resolution to hdmi hardware. This was handled using dummy hdmiphy clock which is removed now. PMU is already defined as system controller for exynos SoC. Registers of PMU are accessed using regmap interfaces. Devicetree binding document for hdmi is also updated. Signed-off-by: Rahul Sharma --- .../devicetree/bindings/video/exynos_hdmi.txt | 2 ++ drivers/gpu/drm/exynos/exynos_hdmi.c | 17 +++++++++++++++++ drivers/gpu/drm/exynos/regs-hdmi.h | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt index f9187a2..243a499 100644 --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt @@ -27,6 +27,7 @@ Required properties: "hdmi", "sclk_hdmi", "sclk_pixel", "sclk_hdmiphy" and "mout_hdmi". - ddc: phandle to the hdmi ddc node - phy: phandle to the hdmi phy node +- samsung,syscon-phandle: phandle for system controller node for PMU. Example: @@ -37,4 +38,5 @@ Example: hpd-gpio = <&gpx3 7 1>; ddc = <&hdmi_ddc_node>; phy = <&hdmi_phy_node>; + samsung,syscon-phandle = <&pmu_system_controller>; }; diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 23abfa0..47b8c06 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include @@ -194,6 +196,7 @@ struct hdmi_context { struct hdmi_resources res; int hpd_gpio; + struct regmap *pmureg; enum hdmi_type type; }; @@ -1853,6 +1856,9 @@ static void hdmi_poweron(struct exynos_drm_display *display) if (regulator_bulk_enable(res->regul_count, res->regul_bulk)) DRM_DEBUG_KMS("failed to enable regulator bulk\n"); + /* set pmu hdmiphy control bit to enable hdmiphy */ + regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL, + PMU_HDMI_PHY_ENABLE_BIT, 1); clk_prepare_enable(res->hdmi); clk_prepare_enable(res->sclk_hdmi); @@ -1879,6 +1885,10 @@ static void hdmi_poweroff(struct exynos_drm_display *display) clk_disable_unprepare(res->sclk_hdmi); clk_disable_unprepare(res->hdmi); + /* reset pmu hdmiphy control bit to disable hdmiphy */ + regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL, + PMU_HDMI_PHY_ENABLE_BIT, 0); + regulator_bulk_disable(res->regul_count, res->regul_bulk); pm_runtime_put_sync(hdata->dev); @@ -2128,6 +2138,13 @@ static int hdmi_probe(struct platform_device *pdev) goto err_hdmiphy; } + hdata->pmureg = syscon_regmap_lookup_by_phandle(dev->of_node, + "samsung,syscon-phandle"); + if (IS_ERR_OR_NULL(hdata->pmureg)) { + DRM_ERROR("syscon regmap lookup failed.\n"); + goto err_hdmiphy; + } + pm_runtime_enable(dev); hdmi_display.ctx = hdata; diff --git a/drivers/gpu/drm/exynos/regs-hdmi.h b/drivers/gpu/drm/exynos/regs-hdmi.h index ef1b3eb..9811d6f 100644 --- a/drivers/gpu/drm/exynos/regs-hdmi.h +++ b/drivers/gpu/drm/exynos/regs-hdmi.h @@ -578,4 +578,8 @@ #define HDMI_TG_VACT_ST4_H HDMI_TG_BASE(0x0074) #define HDMI_TG_3D HDMI_TG_BASE(0x00F0) +/* PMU Registers for PHY */ +#define PMU_HDMI_PHY_CONTROL 0x700 +#define PMU_HDMI_PHY_ENABLE_BIT (1<<0) + #endif /* SAMSUNG_REGS_HDMI_H */