From patchwork Thu May 15 13:10:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 4182441 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 23F0A9F1C0 for ; Thu, 15 May 2014 13:14:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F3012017D for ; Thu, 15 May 2014 13:14:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2798B20251 for ; Thu, 15 May 2014 13:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753217AbaEONOe (ORCPT ); Thu, 15 May 2014 09:14:34 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:33921 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752149AbaEONOe (ORCPT ); Thu, 15 May 2014 09:14:34 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5M00INFA48XN90@mailout2.samsung.com>; Thu, 15 May 2014 22:14:32 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 74.D8.11496.8BDB4735; Thu, 15 May 2014 22:14:32 +0900 (KST) X-AuditID: cbfee691-b7f3e6d000002ce8-da-5374bdb8fb89 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 9C.F7.25708.7BDB4735; Thu, 15 May 2014 22:14:32 +0900 (KST) Received: from localhost.localdomain ([107.108.83.245]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5M0098Y9Z4RB20@mmp1.samsung.com>; Thu, 15 May 2014 22:14:31 +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, thierry.reding@gmail.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, r.sh.open@gmail.com, Rahul Sharma Subject: [PATCH v4 3/3] s5p-tv: hdmi: use hdmiphy as PHY Date: Thu, 15 May 2014 18:40:54 +0530 Message-id: <1400159454-31107-4-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1400159454-31107-1-git-send-email-rahul.sharma@samsung.com> References: <1400159454-31107-1-git-send-email-rahul.sharma@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRmVeSWpSXmKPExsWyRsSkVnfH3pJgg74uXotb686xWsw/AiSu fH3PZnHgzw5Gi++7vrBb9C64ymZx4WkPm8XZpjfsFpd3zWGzmHF+H5PFwhfxFlMWHWa1aN17 hN1i3uedTBbz2l+yWvzcNY/FQcBj56y77B6bVnWyedy5tofN4373cSaPvi2rGD2O39jO5PF5 k1wAexSXTUpqTmZZapG+XQJXRsOrhYwFPSIVV2bMYmlgfCnQxcjJISFgInF/TT8rhC0mceHe erYuRi4OIYGljBK7t79gginq+XifBSKxiFHi3/Zl7BBOO5PE+5tnmEGq2AR0JWYffMYIYosI pEl8O9DCClLELHCGSeLZlf1ADgeHsICFxLIHqiA1LAKqEg83fmQBCfMKeEhMfqYEYkoIKEjM mWQDUsEp4Cmx68xNsOlC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anFhxiTgW6ayCwlmpwPTCV5JfGGxibmpsamliYWJmaWpAkrifMebLUOFBJITyxJ zU5NLUgtgtnCxMEp1cBo+GTr1dRMx38hi6fP91XPKDvLxfos2E5W7OGqKx927jipt8xzeUfe kq3sslNOzQn7tuet0U2euElhq7fNuVV0Jvv7nrvCa69uNZ+1JNDxc98fd70JXLWtfHfczRL1 Vue8O37ydOKsJF31eJ7vVcZ34nOyD3y2tX2U7j7nxBHBa8m7eL+Xh5WvUmIpzkg01GIuKk4E ACaXi4kbAwAA 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;