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: 4177591 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 0277A9F1C0 for ; Wed, 14 May 2014 19:19:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2065920220 for ; Wed, 14 May 2014 19:19:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E40220222 for ; Wed, 14 May 2014 19:19:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752221AbaENTSq (ORCPT ); Wed, 14 May 2014 15:18:46 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:16363 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751593AbaENTS3 (ORCPT ); Wed, 14 May 2014 15:18:29 -0400 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>; 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 Cc: a.hajda@samsung.com, t.stanislaws@samsung.com, devicetree@vger.kernel.org, kgene.kim@samsung.com, kishon@ti.com, kyungmin.park@samsung.com, robh+dt@kernel.org, grant.likely@linaro.org, sylvester.nawrocki@gmail.com, joshi@samsung.com, Rahul Sharma 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+RBUr6zEpgNQ70hKHFxx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U1ILUIpgtTByc Ug2M0XYOs/7znEtjkd500f9zQUO4sVVohubR5rCDhs7JHxwW7fgV7/1tWWtAu9SUf0ZLneX4 OH/dSy97dmvT3u3be2ukGQ3Wnck6xPGEI2RBwfOPPoU/XllrXSuafdas7/i6ppaS/d12umxG 5mkT/wjO9Zg9Z1rFQa3aTe4MgfO29pxVP3pry10XJZbijERDLeai4kQAnDL4OhQDAAA= 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: 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;