]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/musb-new/am35x.c
Merge git://git.denx.de/u-boot-mpc85xx
[u-boot] / drivers / usb / musb-new / am35x.c
index 57c9bd393b89b5addb1b5ac98a0136383140d992..0167ea77970c043905fc6cb4e16cf9d63415d30f 100644 (file)
@@ -8,25 +8,10 @@
  *
  * This file is part of the Inventra Controller Driver for Linux.
  *
- * The Inventra Controller Driver for Linux is free software; you
- * can redistribute it and/or modify it under the terms of the GNU
- * General Public License version 2 as published by the Free Software
- * Foundation.
- *
- * The Inventra Controller Driver for Linux is distributed in
- * the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with The Inventra Controller Driver for Linux ; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place,
- * Suite 330, Boston, MA  02111-1307  USA
+ * SPDX-License-Identifier:    GPL-2.0
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/init.h>
 #include <linux/module.h>
@@ -101,7 +86,11 @@ struct am35x_glue {
 /*
  * am35x_musb_enable - enable interrupts
  */
+#ifndef __UBOOT__
 static void am35x_musb_enable(struct musb *musb)
+#else
+static int am35x_musb_enable(struct musb *musb)
+#endif
 {
        void __iomem *reg_base = musb->ctrl_base;
        u32 epmask;
@@ -117,6 +106,9 @@ static void am35x_musb_enable(struct musb *musb)
        if (is_otg_enabled(musb))
                musb_writel(reg_base, CORE_INTR_SRC_SET_REG,
                            AM35X_INTR_DRVVBUS << AM35X_INTR_USB_SHIFT);
+#ifdef __UBOOT__
+       return 0;
+#endif
 }
 
 /*
@@ -344,7 +336,7 @@ eoi:
        if (ret == IRQ_HANDLED || epintr || usbintr) {
                /* clear level interrupt */
                if (data->clear_irq)
-                       data->clear_irq();
+                       data->clear_irq(data->dev);
                /* write EOI */
                musb_writel(reg_base, USB_END_OF_INTR_REG, 0);
        }
@@ -409,14 +401,14 @@ static int am35x_musb_init(struct musb *musb)
 
        /* Reset the musb */
        if (data->reset)
-               data->reset();
+               data->reset(data->dev);
 
        /* Reset the controller */
        musb_writel(reg_base, USB_CTRL_REG, AM35X_SOFT_RESET_MASK);
 
        /* Start the on-chip PHY and its PLL. */
        if (data->set_phy_power)
-               data->set_phy_power(1);
+               data->set_phy_power(data->dev, 1);
 
        msleep(5);
 
@@ -424,7 +416,7 @@ static int am35x_musb_init(struct musb *musb)
 
        /* clear level interrupt */
        if (data->clear_irq)
-               data->clear_irq();
+               data->clear_irq(data->dev);
 
        return 0;
 }
@@ -447,7 +439,7 @@ static int am35x_musb_exit(struct musb *musb)
 
        /* Shutdown the on-chip PHY and its PLL. */
        if (data->set_phy_power)
-               data->set_phy_power(0);
+               data->set_phy_power(data->dev, 0);
 
 #ifndef __UBOOT__
        usb_put_phy(musb->xceiv);
@@ -638,7 +630,7 @@ static int am35x_suspend(struct device *dev)
 
        /* Shutdown the on-chip PHY and its PLL. */
        if (data->set_phy_power)
-               data->set_phy_power(0);
+               data->set_phy_power(data->dev, 0);
 
        clk_disable(glue->phy_clk);
        clk_disable(glue->clk);
@@ -655,7 +647,7 @@ static int am35x_resume(struct device *dev)
 
        /* Start the on-chip PHY and its PLL. */
        if (data->set_phy_power)
-               data->set_phy_power(1);
+               data->set_phy_power(data->dev, 1);
 
        ret = clk_enable(glue->phy_clk);
        if (ret) {