Commit 2a4d5962 authored by Chris Zhong's avatar Chris Zhong Committed by Kishon Vijay Abraham I

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: default avatarChris Zhong <zyw@rock-chips.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent cddbc4b7
...@@ -960,6 +960,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) ...@@ -960,6 +960,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
return PTR_ERR(tcphy->extcon); return PTR_ERR(tcphy->extcon);
} }
pm_runtime_enable(dev);
for_each_available_child_of_node(np, child_np) { for_each_available_child_of_node(np, child_np) {
struct phy *phy; struct phy *phy;
...@@ -990,6 +992,13 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) ...@@ -990,6 +992,13 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
return 0; 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[] = { static const struct of_device_id rockchip_typec_phy_dt_ids[] = {
{ .compatible = "rockchip,rk3399-typec-phy" }, { .compatible = "rockchip,rk3399-typec-phy" },
{} {}
...@@ -999,6 +1008,7 @@ MODULE_DEVICE_TABLE(of, rockchip_typec_phy_dt_ids); ...@@ -999,6 +1008,7 @@ MODULE_DEVICE_TABLE(of, rockchip_typec_phy_dt_ids);
static struct platform_driver rockchip_typec_phy_driver = { static struct platform_driver rockchip_typec_phy_driver = {
.probe = rockchip_typec_phy_probe, .probe = rockchip_typec_phy_probe,
.remove = rockchip_typec_phy_remove,
.driver = { .driver = {
.name = "rockchip-typec-phy", .name = "rockchip-typec-phy",
.of_match_table = rockchip_typec_phy_dt_ids, .of_match_table = rockchip_typec_phy_dt_ids,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment