From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Quadros Subject: Re: [PATCH 1/3] usb: host: ohci-platform: Add basic runtime PM support Date: Fri, 26 May 2017 10:28:27 +0300 Message-ID: <033e8288-954e-8ea4-63d9-9058ff388592@ti.com> References: <20170525161333.32639-1-tony@atomide.com> <20170525161333.32639-2-tony@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170525161333.32639-2-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> Content-Language: en-GB Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Tony Lindgren , Alan Stern Cc: Greg Kroah-Hartman , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Hans de Goede , Rob Herring , Sebastian Reichel , Yoshihiro Shimoda List-Id: linux-omap@vger.kernel.org On 25/05/17 19:13, Tony Lindgren wrote: > This is needed in preparation of adding support for omap3 and > later OHCI. The runtime PM will only do something on platforms > that implement it. > > Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: Hans de Goede > Cc: Rob Herring > Cc: Roger Quadros > Cc: Sebastian Reichel > Cc: Yoshihiro Shimoda > Signed-off-by: Tony Lindgren Acked-by: Roger Quadros > --- > drivers/usb/host/ohci-platform.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c > --- a/drivers/usb/host/ohci-platform.c > +++ b/drivers/usb/host/ohci-platform.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -242,6 +243,8 @@ static int ohci_platform_probe(struct platform_device *dev) > } > #endif > > + pm_runtime_set_active(&dev->dev); > + pm_runtime_enable(&dev->dev); > if (pdata->power_on) { > err = pdata->power_on(dev); > if (err < 0) > @@ -271,6 +274,7 @@ static int ohci_platform_probe(struct platform_device *dev) > if (pdata->power_off) > pdata->power_off(dev); > err_reset: > + pm_runtime_disable(&dev->dev); > while (--rst >= 0) > reset_control_assert(priv->resets[rst]); > err_put_clks: > @@ -292,6 +296,7 @@ static int ohci_platform_remove(struct platform_device *dev) > struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); > int clk, rst; > > + pm_runtime_get_sync(&dev->dev); > usb_remove_hcd(hcd); > > if (pdata->power_off) > @@ -305,6 +310,9 @@ static int ohci_platform_remove(struct platform_device *dev) > > usb_put_hcd(hcd); > > + pm_runtime_put_sync(&dev->dev); > + pm_runtime_disable(&dev->dev); > + > if (pdata == &ohci_platform_defaults) > dev->dev.platform_data = NULL; > > -- cheers, -roger -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html