From patchwork Wed May 14 19:17:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 4178901 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 EF3A79F485 for ; Thu, 15 May 2014 00:56:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEAE820364 for ; Thu, 15 May 2014 00:56:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EF31420328 for ; Thu, 15 May 2014 00:56:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6AF46ED34; Wed, 14 May 2014 17:56: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 F25D56ECF4 for ; Wed, 14 May 2014 12:18:27 -0700 (PDT) Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5K00KFMWAQ2G10@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 15 May 2014 04:18:27 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id AB.16.09952.281C3735; Thu, 15 May 2014 04:18:26 +0900 (KST) X-AuditID: cbfee690-b7fcd6d0000026e0-ed-5373c1826ffe Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 37.16.27725.281C3735; Thu, 15 May 2014 04:18:26 +0900 (KST) Received: from localhost.localdomain ([107.108.83.245]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5K00HEHW9W7Z10@mmp2.samsung.com>; Thu, 15 May 2014 04:18:26 +0900 (KST) From: Rahul Sharma To: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 3/3] s5p-tv: hdmi: use hdmiphy as PHY Date: Thu, 15 May 2014 00:47:23 +0530 Message-id: <1400095043-685-4-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1400095043-685-1-git-send-email-rahul.sharma@samsung.com> References: <1400095043-685-1-git-send-email-rahul.sharma@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsWyRsSkVrfpYHGwQXOvucWtdedYLeYfARJX vr5nszjwZwejxfddX9gtehdcZbO48LSHzeJs0xt2i8u75rBZzDi/j8liyqLDrBate4+wW8z7 vJPJYl77S1YHPo+ds+6ye2xa1cnmcefaHjaP+93HmTz6tqxi9Dh+YzuTx+dNcgHsUVw2Kak5 mWWpRfp2CVwZDa8WMhb0iFRcmTGLpYHxpUAXIyeHhICJxOkJ7cwQtpjEhXvr2boYuTiEBJYy Sjxp+8MEU3T80HZGiMR0RomFB/6xQzjtTBKT+t6AtbMJ6ErMPviMEcQWEUiT+HaghRWkiFlg NpPExhev2UASwgIWEuu+dII1sAioSvS8WQTWwCvgJvHv63WWLkYOoHUKEnMm2YCEOQXcJRou bQQrFwIqWdEyD2ymhMA9domXX34zQswRkPg2+RBUr6zEpgNQ70hKHFxxg2UCo/ACRoZVjKKp BckFxUnpRSZ6xYm5xaV56XrJ+bmbGIExdPrfswk7GO8dsD7EmAw0biKzlGhyPjAG80riDY3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H/dSy97dmvT3u3be2ukGQ3Wnck6xPGEI2RBwfOPPoU/XllrXSuafdas7/i6ppaS/d12umxG 5mkT/wjO9Zg9Z1rFQa3aTe4MgfO29pxVP3pry10XJZbijERDLeai4kQAnDL4OhQDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 14 May 2014 17:56:35 -0700 Cc: t.stanislaws@samsung.com, devicetree@vger.kernel.org, kgene.kim@samsung.com, joshi@samsung.com, kishon@ti.com, a.hajda@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org, grant.likely@linaro.org, sylvester.nawrocki@gmail.com, Rahul Sharma 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.8 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 From: Tomasz Stanislawski 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 Signed-off-by: Rahul Sharma --- 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;