From patchwork Tue Apr 8 14:37:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3949111 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 A0DCFC0DA2 for ; Tue, 8 Apr 2014 14:38:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDBAE20266 for ; Tue, 8 Apr 2014 14:38:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F2C71203AE for ; Tue, 8 Apr 2014 14:38:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42D3E6E0EE; Tue, 8 Apr 2014 07:38:44 -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 87DA66E0EE for ; Tue, 8 Apr 2014 07:38:42 -0700 (PDT) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3P00D5RVCHZK70@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 08 Apr 2014 23:38:41 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-33-534409f1823a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 81.66.29263.1F904435; Tue, 08 Apr 2014 23:38:41 +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:41 +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 3/3] s5p-tv: hdmi: use hdmiphy as PHY Date: Tue, 08 Apr 2014 16:37:36 +0200 Message-id: <1396967856-27470-4-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+NgFjrOLMWRmVeSWpSXmKPExsVy+t9jAd2PnC7BBs1dehbzj5xjtbjy9T2b xYE/OxgtJt2fwGLRu+Aqm8WFpz1sFmeb3rBbXN41h82iZ8NWVosZ5/cxWUxZdJjVonXvEXaL eZ93Mlmsn/GaxWJe+0tWB36PnbPusntsWtXJ5nHn2h42j/vdx5k8+rasYvQ4fmM7k8fnTXIB 7FFcNimpOZllqUX6dglcGTcW3WUsmCNcsbdhN1sDY6tAFyMnh4SAicTzltfMELaYxIV769m6 GLk4hAQWMUpMbV0O5XQxSfy9e5UVpIoNqOPYks+MIAkRgYWMEltPTgFzmAU6mCTOP9kFNktY wFyi+/EcsA4WAVWJxssTWEBsXgEPiT87HzBB7FOU6H42gQ3E5hTwlPjz5iFQPQfQOg+JeRsT JjDyLmBkWMUomlqQXFCclJ5rqFecmFtcmpeul5yfu4kRHLzPpHYwrmywOMQowMGoxMN78rVz sBBrYllxZe4hRgkOZiUR3opjQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8B1qtA4UE0hNLUrNT UwtSi2CyTBycUg2MuctUGKzOuj3Ye2OLt8Ln6FlTm83WxM6vCpTOtuv8rC9qI3CdUaROxPHr 3Ff/N73sWlsxqeGluPaVX35znsVs2yu2qvBSZqz1p1U6ZZ5cxSzvI+/lce/n4nx4Kbv/kUnT GxPjp5cOlgpeXbwkLGA3W/jXty8Nlib8Y3r/okfrVMz3+I4Fxo8eK7EUZyQaajEXFScCAKOl ZV5aAgAA 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 S5P-HDMI driver to control HDMIPHY via PHY interface. Signed-off-by: Tomasz Stanislawski --- drivers/media/platform/s5p-tv/hdmi_drv.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c index 534722c..8013e52 100644 --- a/drivers/media/platform/s5p-tv/hdmi_drv.c +++ b/drivers/media/platform/s5p-tv/hdmi_drv.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -66,7 +67,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; }; @@ -586,7 +587,7 @@ static int hdmi_resource_poweron(struct hdmi_resources *res) if (ret < 0) return ret; /* power-on hdmi physical interface */ - clk_enable(res->hdmiphy); + phy_power_on(res->hdmiphy); /* use VPP as parent clock; HDMIPHY is not working yet */ clk_set_parent(res->sclk_hdmi, res->sclk_pixel); /* turn clocks on */ @@ -600,7 +601,7 @@ static void hdmi_resource_poweroff(struct hdmi_resources *res) /* turn clocks off */ clk_disable(res->sclk_hdmi); /* power-off hdmiphy */ - clk_disable(res->hdmiphy); + phy_power_off(res->hdmiphy); /* turn HDMI power off */ regulator_bulk_disable(res->regul_count, res->regul_bulk); } @@ -784,7 +785,7 @@ static void hdmi_resources_cleanup(struct hdmi_device *hdev) /* kfree is NULL-safe */ kfree(res->regul_bulk); if (!IS_ERR(res->hdmiphy)) - clk_put(res->hdmiphy); + phy_put(res->hdmiphy); if (!IS_ERR(res->sclk_hdmiphy)) clk_put(res->sclk_hdmiphy); if (!IS_ERR(res->sclk_pixel)) @@ -835,7 +836,7 @@ static int hdmi_resources_init(struct hdmi_device *hdev) dev_err(dev, "failed to get clock 'sclk_hdmiphy'\n"); goto fail; } - res->hdmiphy = clk_get(dev, "hdmiphy"); + res->hdmiphy = phy_get(dev, "hdmiphy"); if (IS_ERR(res->hdmiphy)) { dev_err(dev, "failed to get clock 'hdmiphy'\n"); goto fail;