linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rahul Sharma <rahul.sharma@samsung.com>
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 <rahul.sharma@samsung.com>
Subject: [PATCH v3 3/3] s5p-tv: hdmi: use hdmiphy as PHY
Date: Thu, 15 May 2014 00:47:23 +0530	[thread overview]
Message-ID: <1400095043-685-4-git-send-email-rahul.sharma@samsung.com> (raw)
In-Reply-To: <1400095043-685-1-git-send-email-rahul.sharma@samsung.com>

From: Tomasz Stanislawski <t.stanislaws@samsung.com>

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 <t.stanislaws@samsung.com>
Signed-off-by: Rahul Sharma <Rahul.Sharma@samsung.com>
---
 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 <linux/clk.h>
 #include <linux/regulator/consumer.h>
 #include <linux/v4l2-dv-timings.h>
+#include <linux/phy/phy.h>
 
 #include <media/s5p_hdmi.h>
 #include <media/v4l2-common.h>
@@ -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;
-- 
1.7.9.5


      parent reply	other threads:[~2014-05-14 19:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 19:17 [PATCH v3 0/3] phy: Add exynos-simple-phy driver Rahul Sharma
2014-05-14 19:17 ` [PATCH v3 1/3] " Rahul Sharma
2014-05-14 20:01   ` Tomasz Figa
2014-05-15  4:01     ` Rahul Sharma
2014-05-15 21:44       ` Tomasz Figa
2014-05-16  9:42         ` Rahul Sharma
2014-05-16 10:35           ` Rahul Sharma
2014-05-16 10:50             ` Tomasz Figa
2014-05-16 14:30               ` Rahul Sharma
2014-05-16 14:49                 ` Tomasz Figa
2014-05-19  7:10                   ` Rahul Sharma
2014-05-19 10:54                     ` Tomasz Figa
2014-05-20  5:12                       ` Rahul Sharma
2014-05-14 22:14   ` Thierry Reding
2014-05-15  5:19     ` Rahul Sharma
2014-05-15  7:42       ` Thierry Reding
2014-05-15  8:17         ` Rahul Sharma
2014-05-15  9:23           ` Thierry Reding
2014-05-15 13:31   ` Bartlomiej Zolnierkiewicz
2014-05-15 13:35     ` Rahul Sharma
2014-05-15 13:41       ` Kishon Vijay Abraham I
2014-05-15 13:45         ` Rahul Sharma
2014-05-14 19:17 ` [PATCH v3 2/3] drm: exynos: hdmi: use hdmiphy as PHY Rahul Sharma
2014-05-14 19:17 ` Rahul Sharma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400095043-685-4-git-send-email-rahul.sharma@samsung.com \
    --to=rahul.sharma@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=grant.likely@linaro.org \
    --cc=joshi@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kishon@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=t.stanislaws@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).