From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761776AbcINHs4 (ORCPT ); Wed, 14 Sep 2016 03:48:56 -0400 Received: from arroyo.ext.ti.com ([198.47.19.12]:46475 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761314AbcINHpk (ORCPT ); Wed, 14 Sep 2016 03:45:40 -0400 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH 41/51] phy: rockchip-typec: add pm runtime support Date: Wed, 14 Sep 2016 13:14:22 +0530 Message-ID: <1473839072-5673-42-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1473839072-5673-1-git-send-email-kishon@ti.com> References: <1473839072-5673-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Zhong 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 Signed-off-by: Kishon Vijay Abraham I --- 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.7.9.5