Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1478796
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/2] phy: rockchip-typec: add pm runtime support |
| Date | 2016-09-08 08:40 +0200 |
| Message-ID | <sf1aa-2fT-15@gated-at.bofh.it> (permalink) |
| References | <seU8G-6oM-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
On Thursday 08 September 2016 04:36 AM, Chris Zhong wrote:
> 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 v2:
> -- add pm_runtime_put_sync in err case
>
> drivers/phy/phy-rockchip-typec.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/phy/phy-rockchip-typec.c b/drivers/phy/phy-rockchip-typec.c
> index fb58a27..0b2f528 100644
> --- a/drivers/phy/phy-rockchip-typec.c
> +++ b/drivers/phy/phy-rockchip-typec.c
> @@ -552,6 +552,12 @@ static int tcphy_phy_init(struct rockchip_typec_phy *tcphy, u8 mode)
> goto err_clk_core;
> }
>
> + ret = pm_runtime_get_sync(tcphy->dev);
> + if (ret < 0) {
> + dev_err(tcphy->dev, "cannot get pm runtime %d\n", ret);
> + goto err_clk_ref;
> + }
phy_core will do get_sync for you if.. <see below>
> +
> reset_control_deassert(tcphy->tcphy_rst);
>
> property_enable(tcphy, &cfg->typec_conn_dir, tcphy->flip);
> @@ -600,8 +606,10 @@ static int tcphy_phy_init(struct rockchip_typec_phy *tcphy, u8 mode)
> return 0;
>
> err_wait_pma:
> + pm_runtime_put_sync(tcphy->dev);
> reset_control_assert(tcphy->uphy_rst);
> reset_control_assert(tcphy->tcphy_rst);
> +err_clk_ref:
> clk_disable_unprepare(tcphy->clk_ref);
> err_clk_core:
> clk_disable_unprepare(tcphy->clk_core);
> @@ -610,6 +618,7 @@ err_clk_core:
>
> static void tcphy_phy_deinit(struct rockchip_typec_phy *tcphy)
> {
> + pm_runtime_put_sync(tcphy->dev);
> reset_control_assert(tcphy->tcphy_rst);
> reset_control_assert(tcphy->uphy_rst);
> reset_control_assert(tcphy->pipe_rst);
> @@ -987,6 +996,15 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
> return PTR_ERR(phy_provider);
> }
>
> + pm_runtime_enable(dev);
... pm_runtime_enable is invoked before phy_create.
Thanks
Kishon
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 1/2] phy: rockchip-typec: add pm runtime support Chris Zhong <zyw@rock-chips.com> - 2016-09-08 01:10 +0200
[PATCH v2 2/2] arm64: dts: rk3399: add powerdomain for typec Chris Zhong <zyw@rock-chips.com> - 2016-09-08 01:10 +0200
Re: [PATCH v2 2/2] arm64: dts: rk3399: add powerdomain for typec Heiko Stuebner <heiko@sntech.de> - 2016-09-08 17:20 +0200
Re: [PATCH v2 1/2] phy: rockchip-typec: add pm runtime support Kishon Vijay Abraham I <kishon@ti.com> - 2016-09-08 08:40 +0200
[RESEND PATCH v3 1/2] phy: rockchip-typec: add pm runtime support Chris Zhong <zyw@rock-chips.com> - 2016-09-08 09:00 +0200
Re: [RESEND PATCH v3 1/2] phy: rockchip-typec: add pm runtime support Guenter Roeck <groeck@google.com> - 2016-09-08 17:40 +0200
csiph-web