mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Zhong <zyw@rock-chips.com>
To: kishon@ti.com, groeck@chromium.org, wulf@rock-chips.com,
	briannorris@chromium.org, heiko@sntech.de, dianders@chromium.org,
	kever.yang@rock-chips.com
Cc: linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Chris Zhong <zyw@rock-chips.com>
Subject: [RESEND PATCH v3 1/2] phy: rockchip-typec: add pm runtime support
Date: Wed,  7 Sep 2016 22:57:33 -0700	[thread overview]
Message-ID: <1473314253-2646-1-git-send-email-zyw@rock-chips.com> (raw)
In-Reply-To: <57D0F612.10702@ti.com>

Adds pm_runtime support for rockchip Type-C, so that power domain is
enabled only when there is a transaction going on to help save power.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
---

Changes in v3:
- use phy_core pm_runtime

Changes in v2:
- add pm_runtime_put_sync in err case

 drivers/phy/phy-rockchip-typec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/phy/phy-rockchip-typec.c b/drivers/phy/phy-rockchip-typec.c
index fb58a27..7cfb0f8 100644
--- a/drivers/phy/phy-rockchip-typec.c
+++ b/drivers/phy/phy-rockchip-typec.c
@@ -960,6 +960,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
 		return PTR_ERR(tcphy->extcon);
 	}
 
+	pm_runtime_enable(dev);
+
 	for_each_available_child_of_node(np, child_np) {
 		struct phy *phy;
 
@@ -990,6 +992,13 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static int rockchip_typec_phy_remove(struct platform_device *pdev)
+{
+	pm_runtime_disable(&pdev->dev);
+
+	return 0;
+}
+
 static const struct of_device_id rockchip_typec_phy_dt_ids[] = {
 	{ .compatible = "rockchip,rk3399-typec-phy" },
 	{}
@@ -999,6 +1008,7 @@ MODULE_DEVICE_TABLE(of, rockchip_typec_phy_dt_ids);
 
 static struct platform_driver rockchip_typec_phy_driver = {
 	.probe		= rockchip_typec_phy_probe,
+	.remove		= rockchip_typec_phy_remove,
 	.driver		= {
 		.name	= "rockchip-typec-phy",
 		.of_match_table = rockchip_typec_phy_dt_ids,
-- 
1.9.1

  reply	other threads:[~2016-09-08  6:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07 23:06 [PATCH v2 " Chris Zhong
2016-09-07 23:06 ` [PATCH v2 2/2] arm64: dts: rk3399: add powerdomain for typec Chris Zhong
2016-09-08 15:16   ` Heiko Stuebner
2016-09-08  5:24 ` [PATCH v2 1/2] phy: rockchip-typec: add pm runtime support Kishon Vijay Abraham I
2016-09-08  5:57   ` Chris Zhong [this message]
2016-09-08 15:31     ` [RESEND PATCH v3 " Guenter Roeck

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=1473314253-2646-1-git-send-email-zyw@rock-chips.com \
    --to=zyw@rock-chips.com \
    --cc=briannorris@chromium.org \
    --cc=dianders@chromium.org \
    --cc=groeck@chromium.org \
    --cc=heiko@sntech.de \
    --cc=kever.yang@rock-chips.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=wulf@rock-chips.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®