mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomasz Stanislawski <t.stanislaws@samsung.com>
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
Cc: kishon@ti.com, t.figa@samsung.com, kyungmin.park@samsung.com,
	sylvester.nawrocki@gmail.com, robh+dt@kernel.org,
	inki.dae@samsung.com, rahul.sharma@samsung.com,
	grant.likely@linaro.org, kgene.kim@samsung.com,
	Tomasz Stanislawski <t.stanislaws@samsung.com>
Subject: [PATCHv2 3/3] s5p-tv: hdmi: use hdmiphy as PHY
Date: Tue, 08 Apr 2014 16:37:36 +0200	[thread overview]
Message-ID: <1396967856-27470-4-git-send-email-t.stanislaws@samsung.com> (raw)
In-Reply-To: <1396967856-27470-1-git-send-email-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>
---
 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-04-08 14:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 14:37 [PATCHv2 0/3] phy: Add exynos-simple-phy driver Tomasz Stanislawski
2014-04-08 14:37 ` [PATCHv2 1/3] " Tomasz Stanislawski
2014-04-09  8:37   ` Andrzej Hajda
2014-04-09  9:12     ` Rahul Sharma
2014-04-09 10:01       ` Sylwester Nawrocki
2014-05-05  9:44         ` Kishon Vijay Abraham I
2014-05-07 10:38           ` Rahul Sharma
2014-05-07 13:36             ` Tomasz Stanislawski
2014-05-07 14:19               ` Rahul Sharma
2014-05-07 15:33                 ` Tomasz Figa
2014-05-13 11:20                   ` Rahul Sharma
2014-04-09 11:14       ` Tomasz Stanislawski
2014-04-09 11:47     ` Andreas Oberritter
2014-04-30  6:37       ` Rahul Sharma
2014-04-30  8:32         ` Tomasz Stanislawski
2014-04-30  8:43           ` Rahul Sharma
2014-04-08 14:37 ` [PATCHv2 2/3] drm: exynos: hdmi: use hdmiphy as PHY Tomasz Stanislawski
2014-04-09 10:30   ` Andrzej Hajda
2014-04-09 10:46     ` Rahul Sharma
2014-04-09 11:05     ` Tomasz Stanislawski
2014-04-08 14:37 ` Tomasz Stanislawski [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=1396967856-27470-4-git-send-email-t.stanislaws@samsung.com \
    --to=t.stanislaws@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=grant.likely@linaro.org \
    --cc=inki.dae@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kishon@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=rahul.sharma@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=t.figa@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

all inboxes | Powered by JetHome®