[PATCH 2/2] usb: musb: add support for u8500 platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Initial support for u8500 platform.

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@xxxxxxxxxxxxxx>
Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxxxxxx>
---
Patch created against recent Linus's tree.

 drivers/usb/musb/Kconfig     |    4 +++
 drivers/usb/musb/Makefile    |    1 +
 drivers/usb/musb/abx500.c    |   62 ++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/musb/musb_core.c |    4 ++-
 4 files changed, 70 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/musb/abx500.c

diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 341a37a..f7782c9 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -41,6 +41,7 @@ config USB_MUSB_SOC
 	default y if ARCH_OMAP4
 	default y if (BF54x && !BF544)
 	default y if (BF52x && !BF522 && !BF523)
+	default y if ARCH_U8500
 
 comment "DaVinci 35x and 644x USB support"
 	depends on USB_MUSB_HDRC && ARCH_DAVINCI_DMx
@@ -60,6 +61,9 @@ comment "OMAP 44xx high speed USB support"
 comment "Blackfin high speed USB Support"
 	depends on USB_MUSB_HDRC && ((BF54x && !BF544) || (BF52x && !BF522 && !BF523))
 
+comment "U8500 high speed USB support"
+	depends on USB_MUSB_HDRC && ARCH_U8500 && AB8500_USB
+
 config USB_MUSB_AM35X
 	bool
 	depends on USB_MUSB_HDRC && !ARCH_OMAP2430 && !ARCH_OMAP4
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index ce164e8..96a0605 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -18,6 +18,7 @@ else
 	musb_hdrc-$(CONFIG_ARCH_OMAP3430)	+= omap2430.o
 endif
 musb_hdrc-$(CONFIG_ARCH_OMAP4)			+= omap2430.o
+musb_hdrc-$(CONFIG_ARCH_U8500)  		+= abx500.o
 musb_hdrc-$(CONFIG_BF54x)			+= blackfin.o
 musb_hdrc-$(CONFIG_BF52x)			+= blackfin.o
 musb_hdrc-$(CONFIG_USB_GADGET_MUSB_HDRC)	+= musb_gadget_ep0.o musb_gadget.o
diff --git a/drivers/usb/musb/abx500.c b/drivers/usb/musb/abx500.c
new file mode 100644
index 0000000..95668ff
--- /dev/null
+++ b/drivers/usb/musb/abx500.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 ST-Ericsson AB
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/clk.h>
+#include "musb_core.h"
+
+void musb_platform_enable(struct musb *musb)
+{
+}
+
+void musb_platform_disable(struct musb *musb)
+{
+	musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
+}
+
+int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
+{
+	u8 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
+
+	musb_writeb(musb->mregs, MUSB_DEVCTL, devctl | MUSB_DEVCTL_SESSION);
+
+	return 0;
+}
+
+int __init musb_platform_init(struct musb *musb, void *board_data)
+{
+	clk_enable(musb->clock);
+
+	musb->xceiv = otg_get_transceiver();
+	if (!musb->xceiv) {
+		pr_err("no transceiver configured\n");
+		return -ENODEV;;
+	}
+
+	return 0;
+}
+
+int musb_platform_exit(struct musb *musb)
+{
+	otg_put_transceiver(musb->xceiv);
+
+	clk_disable(musb->clock);
+
+	return 0;
+}
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index e6669fc..d565a20 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1078,6 +1078,8 @@ static void musb_shutdown(struct platform_device *pdev)
 	defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \
 	|| defined(CONFIG_ARCH_OMAP4)
 static ushort __initdata fifo_mode = 4;
+#elif defined(CONFIG_ARCH_U8500)
+static ushort __initdata fifo_mode = 5;
 #else
 static ushort __initdata fifo_mode = 2;
 #endif
@@ -1548,7 +1550,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
 /*-------------------------------------------------------------------------*/
 
 #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) || \
-	defined(CONFIG_ARCH_OMAP4)
+	defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_ARCH_U8500)
 
 static irqreturn_t generic_interrupt(int irq, void *__hci)
 {
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux