usb: gadget: renesas_usbhs: add platform power control function
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 24 Oct 2011 02:57:10 +0000 (19:57 -0700)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Dec 2011 09:44:58 +0000 (11:44 +0200)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/common.c
include/linux/usb/renesas_usbhs.h

index b4cf555..17bf1f7 100644 (file)
@@ -291,18 +291,25 @@ static u32 usbhsc_default_pipe_type[] = {
  */
 static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable)
 {
+       struct platform_device *pdev = usbhs_priv_to_pdev(priv);
        struct device *dev = usbhs_priv_to_dev(priv);
 
        if (enable) {
                /* enable PM */
                pm_runtime_get_sync(dev);
 
+               /* enable platform power */
+               usbhs_platform_call(priv, power_ctrl, pdev, priv->base, enable);
+
                /* USB on */
                usbhs_sys_clock_ctrl(priv, enable);
        } else {
                /* USB off */
                usbhs_sys_clock_ctrl(priv, enable);
 
+               /* disable platform power */
+               usbhs_platform_call(priv, power_ctrl, pdev, priv->base, enable);
+
                /* disable PM */
                pm_runtime_put_sync(dev);
        }
index c9fceb9..0d3f988 100644 (file)
@@ -67,6 +67,14 @@ struct renesas_usbhs_platform_callback {
        /*
         * option:
         *
+        * for board specific clock control
+        */
+       void (*power_ctrl)(struct platform_device *pdev,
+                          void __iomem *base, int enable);
+
+       /*
+        * option:
+        *
         * Phy reset for platform
         */
        void (*phy_reset)(struct platform_device *pdev);