diff options
author | Chris Zhong <zyw@rock-chips.com> | 2016-09-07 22:57:33 -0700 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2016-09-10 17:13:29 +0530 |
commit | 2a4d59625bf0f0ae57d6fecf5970ca03613f5db8 (patch) | |
tree | a10cfdbce844d7496fde2b19b55f96e418020aeb /drivers/phy | |
parent | cddbc4b7ef39ac5d84f183a46ee279cb0ae31a9f (diff) | |
download | linux-2a4d59625bf0f0ae57d6fecf5970ca03613f5db8.tar.gz linux-2a4d59625bf0f0ae57d6fecf5970ca03613f5db8.tar.bz2 linux-2a4d59625bf0f0ae57d6fecf5970ca03613f5db8.zip |
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.
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/phy-rockchip-typec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/phy/phy-rockchip-typec.c b/drivers/phy/phy-rockchip-typec.c index fb58a2775a49..7cfb0f8995de 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, |