UPSTREAM: phy: rockchip-typec: add pm runtime support

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.

BUG=chrome-os-partner:52872
TEST=Check DP display and USB3

Change-Id: I072fd06eaa4dfc4b4f598c4a6a3972ee458b833f
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
(cherry picked from git.kernel.org kishon/linux-phy.git next
 commit 15ab5499bd837b1d70287da747dc3d9762ab320a)
Reviewed-on: https://chromium-review.googlesource.com/382113
Reviewed-by: Brian Norris <briannorris@chromium.org>
This commit is contained in:
Chris Zhong
2016-09-07 11:17:25 -07:00
committed by Huang, Tao
parent 143485ffe9
commit c0fb43a77e

View File

@@ -998,6 +998,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
}
}
pm_runtime_enable(dev);
for_each_available_child_of_node(np, child_np) {
struct phy *phy;
@@ -1028,6 +1030,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" },
{}
@@ -1037,6 +1046,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,