From patchwork Mon Oct 21 14:18:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3078181 Return-Path: X-Original-To: patchwork-dri-devel@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 1F078BF924 for ; Mon, 21 Oct 2013 14:26:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F079D202F9 for ; Mon, 21 Oct 2013 14:26:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DE3802014A for ; Mon, 21 Oct 2013 14:26:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD7A8E7186 for ; Mon, 21 Oct 2013 07:26:00 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 864BEE61B3 for ; Mon, 21 Oct 2013 07:19:25 -0700 (PDT) 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 <0MV000DM6VSCKTO0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 21 Oct 2013 23:19:24 +0900 (KST) X-AuditID: cbfee61b-b7fd56d000001fc6-82-526537ec3ec6 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 71.C0.08134.CE735625; Mon, 21 Oct 2013 23:19:24 +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 <0MV000F8PVR0T800@mmp1.samsung.com>; Mon, 21 Oct 2013 23:19:24 +0900 (KST) From: Tomasz Stanislawski To: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 07/12] drm: exynos: hdmi: use hdmiphy as PHY Date: Mon, 21 Oct 2013 16:18:26 +0200 Message-id: <1382365111-6533-8-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1382365111-6533-1-git-send-email-t.stanislaws@samsung.com> References: <1382365111-6533-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLLMWRmVeSWpSXmKPExsVy+t9jAd035qlBBkeeSVnMP3KO1eLK1/ds FpPuT2Cx6F1wlc3iwtMeNouzTW/YLS7vmsNmMeP8PiaLpxMusllMWXSY1eLwm3ZWixmTX7JZ rJ/xmsViXvtLVotjM5YwOvB73Lm2h83jfvdxJo++LasYPY7f2M7k8XmTXABrFJdNSmpOZllq kb5dAlfG62dHWQquCVRs6/7M0sD4m7eLkZNDQsBE4syBK4wQtpjEhXvr2boYuTiEBBYxSny5 8ZQdwulikuhffZAFpIoNqOPYks9gHSICiRK/mu8ygxQxCxxiktjdMoUZJCEsYCWxYP8qJhCb RUBVonfaIzYQm1fAXeLHgzmsEOvkJZ7e7wOLcwp4SJx6uRZsqBBQzbtv81gmMPIuYGRYxSia WpBcUJyUnmukV5yYW1yal66XnJ+7iREcqM+kdzCuarA4xCjAwajEwxvgkhIkxJpYVlyZe4hR goNZSYS3yjQ1SIg3JbGyKrUoP76oNCe1+BCjNAeLkjjvwVbrQCGB9MSS1OzU1ILUIpgsEwen VAOjhI8N/zXlw58qXbwfzWt4y91obG0vp1/0QyozZ9aysPmffq9uPWSoyHmp8XiV7+IfPHkL 2+5WebtM2KreKsgvExFlXBXZVvV7j47z/4w9Xx9ZXFp2SPhdAI/vvgqTU+dYn+9Z7SjgYKMh nMNiKFrjublvHbtW90Ij9XM9XQzvk7Le5Hzds0aJpTgj0VCLuag4EQCPkWofUAIAAA== Cc: Tomasz Stanislawski , kgene.kim@samsung.com, mturquette@linaro.org, sw0312.kim@samsung.com, dri-devel@lists.freedesktop.org, kishon@ti.com, kyungmin.park@samsung.com, s.nawrocki@samsung.com, rahul.sharma@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 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 fcfa23a..e36588a 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -82,7 +83,7 @@ struct hdmi_resources { struct clk *sclk_hdmi; struct clk *sclk_pixel; struct clk *sclk_hdmiphy; - struct clk *hdmiphy; + struct phy *hdmiphy; struct regulator_bulk_data *regul_bulk; int regul_count; }; @@ -1685,7 +1686,7 @@ static void hdmi_poweron(struct hdmi_context *hdata) 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); @@ -1710,7 +1711,7 @@ static void hdmi_poweroff(struct hdmi_context *hdata) 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); mutex_lock(&hdata->hdmi_mutex); @@ -1809,9 +1810,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; }