From patchwork Tue Apr 8 14:37:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3949101 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A53DD9F3E2 for ; Tue, 8 Apr 2014 14:38:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D40E22039C for ; Tue, 8 Apr 2014 14:38:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CD0E420266 for ; Tue, 8 Apr 2014 14:38:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20EB66E248; Tue, 8 Apr 2014 07:38:35 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 0996E6E248 for ; Tue, 8 Apr 2014 07:38:33 -0700 (PDT) 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 <0N3P008DHVC7RA40@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 08 Apr 2014 23:38:32 +0900 (KST) X-AuditID: cbfee61b-b7f456d000006dfd-a9-534409e7e671 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C8.0D.28157.7E904435; Tue, 08 Apr 2014 23:38:31 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3P001YRVAS9H00@mmp1.samsung.com>; Tue, 08 Apr 2014 23:38:31 +0900 (KST) From: Tomasz Stanislawski To: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCHv2 2/3] drm: exynos: hdmi: use hdmiphy as PHY Date: Tue, 08 Apr 2014 16:37:35 +0200 Message-id: <1396967856-27470-3-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1396967856-27470-1-git-send-email-t.stanislaws@samsung.com> References: <1396967856-27470-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsVy+t9jAd3nnC7BBo8/mFvMP3KO1eLK1/ds Fgf+7GC0mHR/AotF74KrbBYXnvawWZxtesNucXnXHDaLng1bWS1mnN/HZDFl0WFWi9a9R9gt 5n3eyWSxfsZrFot57S9ZHfg9ds66y+6xaVUnm8eda3vYPO53H2fy6NuyitHj+I3tTB6fN8kF sEdx2aSk5mSWpRbp2yVwZdxofMlYsF2w4t/sdSwNjBf4uhg5OCQETCRenU7uYuQEMsUkLtxb z9bFyMUhJLCIUaK9/xAjhNPFJNHz5zYLSBUbUMOxJZ/BEiICCxkltp6cAuYwC3QwSZx/sosZ pEpYwEZi0sUOsA4WAVWJdf8PMoLYvAIeEg++9bBB7FOU6H42AczmFPCU+PPmISvISUJANfM2 Jkxg5F3AyLCKUTS1ILmgOCk910ivODG3uDQvXS85P3cTIzh0n0nvYFzVYHGIUYCDUYmHV+GQ U7AQa2JZcWXuIUYJDmYlEd6KY87BQrwpiZVVqUX58UWlOanFhxilOViUxHkPtloHCgmkJ5ak ZqemFqQWwWSZODilGhhjomc0TPnE+kBvWaauFuO6ffP+v1dP999R1bzUrMRlYen6C3KLYg53 hEsprj/z3Mzl2Xq9JdP2nCzk61r4q/GsQMdDhiiV0r5/5uXpf1uKLSOeh2xxTBGV2+Xm/Wyu x1trz5Jn7m0MejlMqa17+YTXlecz8RU9U5Hhs3E4GPa5+v7J0p/7nJVYijMSDbWYi4oTAULR kp1ZAgAA Cc: Tomasz Stanislawski , kgene.kim@samsung.com, kishon@ti.com, kyungmin.park@samsung.com, robh+dt@kernel.org, grant.likely@linaro.org, sylvester.nawrocki@gmail.com, rahul.sharma@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The HDMIPHY (physical interface) is controlled by a single bit in a power controller's regiter. It was implemented as clock. It was a simple but effective hack. This patch makes HDMI driver to control HDMIPHY via PHY interface. Signed-off-by: Tomasz Stanislawski --- drivers/gpu/drm/exynos/exynos_hdmi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 9a6d652..ef1cdd0 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -74,8 +75,8 @@ struct hdmi_resources { struct clk *sclk_hdmi; struct clk *sclk_pixel; struct clk *sclk_hdmiphy; - struct clk *hdmiphy; struct clk *mout_hdmi; + struct phy *hdmiphy; struct regulator_bulk_data *regul_bulk; int regul_count; }; @@ -1854,7 +1855,7 @@ 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"); - clk_prepare_enable(res->hdmiphy); + phy_power_on(res->hdmiphy); clk_prepare_enable(res->hdmi); clk_prepare_enable(res->sclk_hdmi); @@ -1881,7 +1882,7 @@ static void hdmi_poweroff(struct exynos_drm_display *display) clk_disable_unprepare(res->sclk_hdmi); clk_disable_unprepare(res->hdmi); - clk_disable_unprepare(res->hdmiphy); + phy_power_off(res->hdmiphy); regulator_bulk_disable(res->regul_count, res->regul_bulk); pm_runtime_put_sync(hdata->dev); @@ -1977,9 +1978,9 @@ static int hdmi_resources_init(struct hdmi_context *hdata) DRM_ERROR("failed to get clock 'sclk_hdmiphy'\n"); goto fail; } - res->hdmiphy = devm_clk_get(dev, "hdmiphy"); + res->hdmiphy = devm_phy_get(dev, "hdmiphy"); if (IS_ERR(res->hdmiphy)) { - DRM_ERROR("failed to get clock 'hdmiphy'\n"); + DRM_ERROR("failed to get phy 'hdmiphy'\n"); goto fail; } res->mout_hdmi = devm_clk_get(dev, "mout_hdmi");