public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge
@ 2009-02-12 19:16 Tony Lindgren
  2009-02-12 19:16 ` [PATCH 1/3] musb_hdrc: Set musb_resources dynamically Tony Lindgren
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Tony Lindgren @ 2009-02-12 19:16 UTC (permalink / raw)
  To: linux-omap

Hi Felipe & Dave,

While creating a patch for usb-musb.c init code for mainline
kernel, I ended up cleaning up following stuff in the l-o tree.

Does it look OK to you?

Regards,

Tony 

---

Tony Lindgren (3):
      musb_hdrc: Build usb-musb based on config entry, clean-up Makefile
      musb_hdrc: Clean-up MUSB init code for next merge window
      musb_hdrc: Set musb_resources dynamically


 arch/arm/mach-omap2/Makefile               |   17 +++++---------
 arch/arm/mach-omap2/board-2430sdp.c        |    2 +-
 arch/arm/mach-omap2/board-3430sdp.c        |    2 +-
 arch/arm/mach-omap2/board-ldp.c            |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c    |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +-
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +-
 arch/arm/mach-omap2/board-overo.c          |    2 +-
 arch/arm/mach-omap2/board-rx51.c           |    2 +-
 arch/arm/mach-omap2/usb-musb.c             |   28 ++++++++++------------
 arch/arm/plat-omap/include/mach/usb-musb.h |   35 ----------------------------
 arch/arm/plat-omap/include/mach/usb.h      |   11 +++++++--
 12 files changed, 35 insertions(+), 72 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/mach/usb-musb.h

-- 
Signature

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] musb_hdrc: Set musb_resources dynamically
  2009-02-12 19:16 [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
@ 2009-02-12 19:16 ` Tony Lindgren
  2009-02-12 19:28   ` Felipe Balbi
  2009-02-12 19:17 ` [PATCH 2/3] musb_hdrc: Clean-up MUSB init code for next merge window Tony Lindgren
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Tony Lindgren @ 2009-02-12 19:16 UTC (permalink / raw)
  To: linux-omap; +Cc: Felipe Balbi, David Brownell

The cpu_is_omap34xx() may not be static.

Cc: Felipe Balbi <felipe.balbi@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/usb-musb.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 5d79f89..897c07d 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -35,13 +35,7 @@
 
 #ifdef CONFIG_USB_MUSB_SOC
 static struct resource musb_resources[] = {
-	[0] = {
-		.start	= cpu_is_omap34xx()
-			? OMAP34XX_HSUSB_OTG_BASE
-			: OMAP243X_HS_BASE,
-		.end	= cpu_is_omap34xx()
-			? OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1
-			: OMAP243X_HS_BASE + SZ_8K - 1,
+	[0] = { /* start and end set dynamically */
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {	/* general IRQ */
@@ -128,9 +122,7 @@ static struct musb_hdrc_platform_data musb_plat = {
 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
 	.mode		= MUSB_PERIPHERAL,
 #endif
-	.clock		= cpu_is_omap34xx()
-			? "hsotgusb_ick"
-			: "usbhs_ick",
+	/* .clock is set dynamically */
 	.set_clock	= musb_set_clock,
 	.config		= &musb_config,
 
@@ -160,6 +152,17 @@ static struct platform_device musb_device = {
 void __init usb_musb_init(void)
 {
 #ifdef CONFIG_USB_MUSB_SOC
+
+	if (cpu_is_omap243x()) {
+		musb_resources[0].start = OMAP243X_HS_BASE;
+		musb_plat.clock = "usbhs_ick";
+	} else {
+		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+		musb_plat.clock = "hsotgusb_ick";
+	}
+
+	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
+
 	if (platform_device_register(&musb_device) < 0) {
 		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
 		return;


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] musb_hdrc: Clean-up MUSB init code for next merge window
  2009-02-12 19:16 [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
  2009-02-12 19:16 ` [PATCH 1/3] musb_hdrc: Set musb_resources dynamically Tony Lindgren
@ 2009-02-12 19:17 ` Tony Lindgren
  2009-02-12 19:30   ` Felipe Balbi
  2009-02-12 19:17 ` [PATCH 3/3] musb_hdrc: Build usb-musb based on config entry, clean-up Makefile Tony Lindgren
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Tony Lindgren @ 2009-02-12 19:17 UTC (permalink / raw)
  To: linux-omap; +Cc: Felipe Balbi, David Brownell

Let's just use mach/usb.h as mach/musb.h only has one entry.

Cc: Felipe Balbi <felipe.balbi@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-2430sdp.c        |    2 +-
 arch/arm/mach-omap2/board-3430sdp.c        |    2 +-
 arch/arm/mach-omap2/board-ldp.c            |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c    |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +-
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +-
 arch/arm/mach-omap2/board-overo.c          |    2 +-
 arch/arm/mach-omap2/board-rx51.c           |    2 +-
 arch/arm/plat-omap/include/mach/usb-musb.h |   35 ----------------------------
 arch/arm/plat-omap/include/mach/usb.h      |    4 ++-
 10 files changed, 10 insertions(+), 45 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/mach/usb-musb.h

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index cc65b1a..aa5df72 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -36,7 +36,7 @@
 #include <mach/gpio.h>
 #include <mach/mux.h>
 #include <mach/board.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 #include <mach/common.h>
 #include <mach/gpmc.h>
 #include <mach/mcspi.h>
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 8a0dba6..10be03e 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -34,7 +34,7 @@
 #include <mach/gpio.h>
 #include <mach/mux.h>
 #include <mach/board.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 #include <mach/usb-ehci.h>
 #include <mach/common.h>
 #include <mach/dma.h>
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 73c4504..1e1fd84 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -35,7 +35,7 @@
 #include <mach/board.h>
 #include <mach/common.h>
 #include <mach/gpmc.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 
 #include <asm/io.h>
 #include <asm/delay.h>
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 64c76bd..64fc613 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -38,7 +38,7 @@
 #include <asm/mach/flash.h>
 
 #include <mach/board.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 #include <mach/usb-ehci.h>
 #include <mach/common.h>
 #include <mach/gpmc.h>
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 775a1f3..4946463 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -31,7 +31,7 @@
 
 #include <mach/gpio.h>
 #include <mach/board.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 #include <mach/usb-ehci.h>
 #include <mach/common.h>
 #include <mach/mcspi.h>
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 2637641..cd90bf4 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -45,7 +45,7 @@
 #include <mach/hardware.h>
 #include <mach/nand.h>
 #include <mach/usb-ehci.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 #include <mach/mcspi.h>
 
 #include "sdram-micron-mt46h32m32lf-6.h"
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index c95b890..f600f70 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -46,7 +46,7 @@
 #include <mach/hardware.h>
 #include <mach/nand.h>
 #include <mach/usb-ehci.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "twl4030-generic-scripts.h"
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index e845aac..98dfde1 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -28,7 +28,7 @@
 #include <mach/keypad.h>
 #include <mach/dma.h>
 #include <mach/gpmc.h>
-#include <mach/usb-musb.h>
+#include <mach/usb.h>
 
 #include <asm/io.h>
 #include <asm/delay.h>
diff --git a/arch/arm/plat-omap/include/mach/usb-musb.h b/arch/arm/plat-omap/include/mach/usb-musb.h
deleted file mode 100644
index b455b29..0000000
--- a/arch/arm/plat-omap/include/mach/usb-musb.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/usb-musb.h
- *
- * Hardware definitions for Mentor Graphics MUSBMHDRC.
- *
- * Initial creation by Felipe Balbi.
- *
- * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * 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.
- */
-
-#ifndef __ASM_ARCH_OMAP_USB_MUSB_H
-#define __ASM_ARCH_OMAP_USB_MUSB_H
-
-extern void usb_musb_init(void);
-
-#endif /* __ASM_ARCH_OMAP_USB_MUSB_H */
-
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
index e078155..7d7b2b0 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/mach/usb.h
@@ -27,8 +27,8 @@
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
-void __init usb_musb_init(void);
-void __init usb_ehci_init(void);
+extern void usb_musb_init(void);
+extern void usb_ehci_init(void);
 
 #endif
 


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] musb_hdrc: Build usb-musb based on config entry, clean-up Makefile
  2009-02-12 19:16 [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
  2009-02-12 19:16 ` [PATCH 1/3] musb_hdrc: Set musb_resources dynamically Tony Lindgren
  2009-02-12 19:17 ` [PATCH 2/3] musb_hdrc: Clean-up MUSB init code for next merge window Tony Lindgren
@ 2009-02-12 19:17 ` Tony Lindgren
  2009-02-12 19:31   ` Felipe Balbi
  2009-02-12 19:21 ` [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
  2009-02-12 20:49 ` David Brownell
  4 siblings, 1 reply; 12+ messages in thread
From: Tony Lindgren @ 2009-02-12 19:17 UTC (permalink / raw)
  To: linux-omap; +Cc: Felipe Balbi, David Brownell

Build usb-musb based on config entry, clean-up Makefile

Cc: Felipe Balbi <felipe.balbi@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Makefile          |   17 ++++++-----------
 arch/arm/mach-omap2/usb-musb.c        |    7 -------
 arch/arm/plat-omap/include/mach/usb.h |    7 +++++++
 3 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 631166d..fad8af4 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -44,27 +44,24 @@ obj-$(CONFIG_MACH_OMAP_H4)		+= board-h4.o board-h4-mmc.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)		+= board-2430sdp.o \
 					   board-2430sdp-flash.o \
 					   mmc-twl4030.o \
-					   usb-musb.o \
 					   usb-ehci.o
 obj-$(CONFIG_MACH_OMAP2EVM)		+= board-omap2evm.o \
 					   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o \
 					   mmc-twl4030.o \
-					   usb-musb.o \
 					   usb-ehci.o \
 					   board-3430sdp-flash.o
 obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o \
 					   mmc-twl4030.o \
-					   usb-musb.o usb-ehci.o \
+					   usb-ehci.o \
 					   board-omap3evm-flash.o \
 					   twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)		+= board-omap3beagle.o \
-					   usb-musb.o usb-ehci.o \
+					   usb-ehci.o \
 					   mmc-twl4030.o \
 					   twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP_LDP)		+= board-ldp.o \
-					   mmc-twl4030.o \
-					   usb-musb.o
+					   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)		+= board-apollon.o \
 					   board-apollon-mmc.o	\
 					   board-apollon-keys.o
@@ -80,19 +77,17 @@ obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o \
 					   board-rx51-sdram.o \
 					   board-rx51-video.o \
 					   board-rx51-peripherals.o \
-					   mmc-twl4030.o \
-					   usb-musb.o
+					   mmc-twl4030.o
 
 obj-$(CONFIG_MACH_OVERO)		+= board-overo.o \
 					   mmc-twl4030.o \
-					   usb-musb.o \
 					   usb-ehci.o \
 					   twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o \
 					   mmc-twl4030.o \
-					   usb-musb.o \
 					   usb-ehci.o
 
-# TUSB 6010 chips
+# Platform specific device init code
+obj-$(CONFIG_USB_MUSB_SOC)		+= usb-musb.o
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
 
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 897c07d..327af7d 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -33,7 +33,6 @@
 #include <mach/mux.h>
 #include <mach/usb.h>
 
-#ifdef CONFIG_USB_MUSB_SOC
 static struct resource musb_resources[] = {
 	[0] = { /* start and end set dynamically */
 		.flags	= IORESOURCE_MEM,
@@ -146,13 +145,9 @@ static struct platform_device musb_device = {
 	.num_resources	= ARRAY_SIZE(musb_resources),
 	.resource	= musb_resources,
 };
-#endif
-
 
 void __init usb_musb_init(void)
 {
-#ifdef CONFIG_USB_MUSB_SOC
-
 	if (cpu_is_omap243x()) {
 		musb_resources[0].start = OMAP243X_HS_BASE;
 		musb_plat.clock = "usbhs_ick";
@@ -167,6 +162,4 @@ void __init usb_musb_init(void)
 		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
 		return;
 	}
-#endif
 }
-
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
index 7d7b2b0..e69c5ad 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/mach/usb.h
@@ -27,7 +27,14 @@
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
+#ifdef CONFIG_USB_MUSB_SOC
 extern void usb_musb_init(void);
+#else
+static inline void usb_musb_init(void)
+{
+}
+#endif
+
 extern void usb_ehci_init(void);
 
 #endif


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge
  2009-02-12 19:16 [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
                   ` (2 preceding siblings ...)
  2009-02-12 19:17 ` [PATCH 3/3] musb_hdrc: Build usb-musb based on config entry, clean-up Makefile Tony Lindgren
@ 2009-02-12 19:21 ` Tony Lindgren
  2009-02-12 19:35   ` Felipe Balbi
  2009-02-13 20:50   ` David Brownell
  2009-02-12 20:49 ` David Brownell
  4 siblings, 2 replies; 12+ messages in thread
From: Tony Lindgren @ 2009-02-12 19:21 UTC (permalink / raw)
  To: linux-omap

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

* Tony Lindgren <tony@atomide.com> [090212 11:16]:
> Hi Felipe & Dave,
> 
> While creating a patch for usb-musb.c init code for mainline
> kernel, I ended up cleaning up following stuff in the l-o tree.
> 
> Does it look OK to you?

And here's what the musb_init patch for the mainline. No boards are
calling musb_init() yet, but that's easy to append.

The clock function might cause some merge issues.. I guess eventually
the driver should just call clk_enable/disable once the omap2 clock
merge is done.

Regards,

Tony

[-- Attachment #2: musb-init.patch --]
[-- Type: text/x-diff, Size: 5314 bytes --]

>From 545f2a61242ca4d27bb22d54a1f0b0bfcea86c5f Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Wed, 11 Feb 2009 17:33:49 -0800
Subject: [PATCH] ARM: OMAP3: MUSB initialization for omap hw

Create a generic board-file for initializing usb
on omap2430 and omap3 boards.

Patch modified by Tony to build the module based on
CONFIG_USB_MUSB_SOC.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b239c7d..dd63683 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -44,3 +44,5 @@ obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o \
 					   board-rx51-peripherals.o \
 					   mmc-twl4030.o
 
+# Platform specific device init code
+obj-$(CONFIG_USB_MUSB_SOC)		+= usb-musb.o
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
new file mode 100644
index 0000000..327af7d
--- /dev/null
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -0,0 +1,165 @@
+/*
+ * linux/arch/arm/mach-omap2/usb-musb.c
+ *
+ * This file will contain the board specific details for the
+ * MENTOR USB OTG controller on OMAP3430
+ *
+ * Copyright (C) 2007-2008 Texas Instruments
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Vikram Pandita
+ *
+ * Generalization by:
+ * Felipe Balbi <felipe.balbi@nokia.com>
+ *
+ * This program 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.
+ */
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/dma-mapping.h>
+
+#include <asm/io.h>
+
+#include <linux/usb/musb.h>
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/pm.h>
+#include <mach/mux.h>
+#include <mach/usb.h>
+
+static struct resource musb_resources[] = {
+	[0] = { /* start and end set dynamically */
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {	/* general IRQ */
+		.start	= INT_243X_HS_USB_MC,
+		.flags	= IORESOURCE_IRQ,
+	},
+	[2] = {	/* DMA IRQ */
+		.start	= INT_243X_HS_USB_DMA,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static int clk_on;
+
+static int musb_set_clock(struct clk *clk, int state)
+{
+	if (state) {
+		if (clk_on > 0)
+			return -ENODEV;
+
+		clk_enable(clk);
+		clk_on = 1;
+	} else {
+		if (clk_on == 0)
+			return -ENODEV;
+
+		clk_disable(clk);
+		clk_on = 0;
+	}
+
+	return 0;
+}
+
+static struct musb_hdrc_eps_bits musb_eps[] = {
+	{	"ep1_tx", 10,	},
+	{	"ep1_rx", 10,	},
+	{	"ep2_tx", 9,	},
+	{	"ep2_rx", 9,	},
+	{	"ep3_tx", 3,	},
+	{	"ep3_rx", 3,	},
+	{	"ep4_tx", 3,	},
+	{	"ep4_rx", 3,	},
+	{	"ep5_tx", 3,	},
+	{	"ep5_rx", 3,	},
+	{	"ep6_tx", 3,	},
+	{	"ep6_rx", 3,	},
+	{	"ep7_tx", 3,	},
+	{	"ep7_rx", 3,	},
+	{	"ep8_tx", 2,	},
+	{	"ep8_rx", 2,	},
+	{	"ep9_tx", 2,	},
+	{	"ep9_rx", 2,	},
+	{	"ep10_tx", 2,	},
+	{	"ep10_rx", 2,	},
+	{	"ep11_tx", 2,	},
+	{	"ep11_rx", 2,	},
+	{	"ep12_tx", 2,	},
+	{	"ep12_rx", 2,	},
+	{	"ep13_tx", 2,	},
+	{	"ep13_rx", 2,	},
+	{	"ep14_tx", 2,	},
+	{	"ep14_rx", 2,	},
+	{	"ep15_tx", 2,	},
+	{	"ep15_rx", 2,	},
+};
+
+static struct musb_hdrc_config musb_config = {
+	.multipoint	= 1,
+	.dyn_fifo	= 1,
+	.soft_con	= 1,
+	.dma		= 1,
+	.num_eps	= 16,
+	.dma_channels	= 7,
+	.dma_req_chan	= (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
+	.ram_bits	= 12,
+	.eps_bits	= musb_eps,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#ifdef CONFIG_USB_MUSB_OTG
+	.mode		= MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+	.mode		= MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+	.mode		= MUSB_PERIPHERAL,
+#endif
+	/* .clock is set dynamically */
+	.set_clock	= musb_set_clock,
+	.config		= &musb_config,
+
+	/* REVISIT charge pump on TWL4030 can supply up to
+	 * 100 mA ... but this value is board-specific, like
+	 * "mode", and should be passed to usb_musb_init().
+	 */
+	.power		= 50,			/* up to 100 mA */
+};
+
+static u64 musb_dmamask = DMA_32BIT_MASK;
+
+static struct platform_device musb_device = {
+	.name		= "musb_hdrc",
+	.id		= -1,
+	.dev = {
+		.dma_mask		= &musb_dmamask,
+		.coherent_dma_mask	= DMA_32BIT_MASK,
+		.platform_data		= &musb_plat,
+	},
+	.num_resources	= ARRAY_SIZE(musb_resources),
+	.resource	= musb_resources,
+};
+
+void __init usb_musb_init(void)
+{
+	if (cpu_is_omap243x()) {
+		musb_resources[0].start = OMAP243X_HS_BASE;
+		musb_plat.clock = "usbhs_ick";
+	} else {
+		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+		musb_plat.clock = "hsotgusb_ick";
+	}
+
+	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
+
+	if (platform_device_register(&musb_device) < 0) {
+		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
+		return;
+	}
+}
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
index a56a610..ddc0522 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/mach/usb.h
@@ -27,6 +27,14 @@
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
+#ifdef CONFIG_USB_MUSB_SOC
+extern void usb_musb_init(void);
+#else
+static inline void usb_musb_init(void)
+{
+}
+#endif
+
 #endif
 
 /*-------------------------------------------------------------------------*/

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] musb_hdrc: Set musb_resources dynamically
  2009-02-12 19:16 ` [PATCH 1/3] musb_hdrc: Set musb_resources dynamically Tony Lindgren
@ 2009-02-12 19:28   ` Felipe Balbi
  0 siblings, 0 replies; 12+ messages in thread
From: Felipe Balbi @ 2009-02-12 19:28 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Felipe Balbi, David Brownell

On Thu, Feb 12, 2009 at 11:16:55AM -0800, Tony Lindgren wrote:
> The cpu_is_omap34xx() may not be static.
> 
> Cc: Felipe Balbi <felipe.balbi@nokia.com>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

This looks ok

> ---
>  arch/arm/mach-omap2/usb-musb.c |   23 +++++++++++++----------
>  1 files changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index 5d79f89..897c07d 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -35,13 +35,7 @@
>  
>  #ifdef CONFIG_USB_MUSB_SOC
>  static struct resource musb_resources[] = {
> -	[0] = {
> -		.start	= cpu_is_omap34xx()
> -			? OMAP34XX_HSUSB_OTG_BASE
> -			: OMAP243X_HS_BASE,
> -		.end	= cpu_is_omap34xx()
> -			? OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1
> -			: OMAP243X_HS_BASE + SZ_8K - 1,
> +	[0] = { /* start and end set dynamically */
>  		.flags	= IORESOURCE_MEM,
>  	},
>  	[1] = {	/* general IRQ */
> @@ -128,9 +122,7 @@ static struct musb_hdrc_platform_data musb_plat = {
>  #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
>  	.mode		= MUSB_PERIPHERAL,
>  #endif
> -	.clock		= cpu_is_omap34xx()
> -			? "hsotgusb_ick"
> -			: "usbhs_ick",
> +	/* .clock is set dynamically */
>  	.set_clock	= musb_set_clock,
>  	.config		= &musb_config,
>  
> @@ -160,6 +152,17 @@ static struct platform_device musb_device = {
>  void __init usb_musb_init(void)
>  {
>  #ifdef CONFIG_USB_MUSB_SOC
> +
> +	if (cpu_is_omap243x()) {
> +		musb_resources[0].start = OMAP243X_HS_BASE;
> +		musb_plat.clock = "usbhs_ick";
> +	} else {
> +		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
> +		musb_plat.clock = "hsotgusb_ick";
> +	}
> +
> +	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
> +
>  	if (platform_device_register(&musb_device) < 0) {
>  		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
>  		return;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] musb_hdrc: Clean-up MUSB init code for next merge window
  2009-02-12 19:17 ` [PATCH 2/3] musb_hdrc: Clean-up MUSB init code for next merge window Tony Lindgren
@ 2009-02-12 19:30   ` Felipe Balbi
  2009-02-12 19:44     ` Tony Lindgren
  0 siblings, 1 reply; 12+ messages in thread
From: Felipe Balbi @ 2009-02-12 19:30 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Felipe Balbi, David Brownell

On Thu, Feb 12, 2009 at 11:17:08AM -0800, Tony Lindgren wrote:
> Let's just use mach/usb.h as mach/musb.h only has one entry.
> 
> Cc: Felipe Balbi <felipe.balbi@nokia.com>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/board-2430sdp.c        |    2 +-
>  arch/arm/mach-omap2/board-3430sdp.c        |    2 +-
>  arch/arm/mach-omap2/board-ldp.c            |    2 +-
>  arch/arm/mach-omap2/board-omap3beagle.c    |    2 +-
>  arch/arm/mach-omap2/board-omap3evm.c       |    2 +-
>  arch/arm/mach-omap2/board-omap3pandora.c   |    2 +-
>  arch/arm/mach-omap2/board-overo.c          |    2 +-
>  arch/arm/mach-omap2/board-rx51.c           |    2 +-
>  arch/arm/plat-omap/include/mach/usb-musb.h |   35 ----------------------------
>  arch/arm/plat-omap/include/mach/usb.h      |    4 ++-
>  10 files changed, 10 insertions(+), 45 deletions(-)
>  delete mode 100644 arch/arm/plat-omap/include/mach/usb-musb.h
> 
> diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
> index cc65b1a..aa5df72 100644
> --- a/arch/arm/mach-omap2/board-2430sdp.c
> +++ b/arch/arm/mach-omap2/board-2430sdp.c
> @@ -36,7 +36,7 @@
>  #include <mach/gpio.h>
>  #include <mach/mux.h>
>  #include <mach/board.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  #include <mach/common.h>
>  #include <mach/gpmc.h>
>  #include <mach/mcspi.h>
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
> index 8a0dba6..10be03e 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -34,7 +34,7 @@
>  #include <mach/gpio.h>
>  #include <mach/mux.h>
>  #include <mach/board.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  #include <mach/usb-ehci.h>
>  #include <mach/common.h>
>  #include <mach/dma.h>
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index 73c4504..1e1fd84 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -35,7 +35,7 @@
>  #include <mach/board.h>
>  #include <mach/common.h>
>  #include <mach/gpmc.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  
>  #include <asm/io.h>
>  #include <asm/delay.h>
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index 64c76bd..64fc613 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -38,7 +38,7 @@
>  #include <asm/mach/flash.h>
>  
>  #include <mach/board.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  #include <mach/usb-ehci.h>
>  #include <mach/common.h>
>  #include <mach/gpmc.h>
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index 775a1f3..4946463 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -31,7 +31,7 @@
>  
>  #include <mach/gpio.h>
>  #include <mach/board.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  #include <mach/usb-ehci.h>
>  #include <mach/common.h>
>  #include <mach/mcspi.h>
> diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
> index 2637641..cd90bf4 100644
> --- a/arch/arm/mach-omap2/board-omap3pandora.c
> +++ b/arch/arm/mach-omap2/board-omap3pandora.c
> @@ -45,7 +45,7 @@
>  #include <mach/hardware.h>
>  #include <mach/nand.h>
>  #include <mach/usb-ehci.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  #include <mach/mcspi.h>
>  
>  #include "sdram-micron-mt46h32m32lf-6.h"
> diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
> index c95b890..f600f70 100644
> --- a/arch/arm/mach-omap2/board-overo.c
> +++ b/arch/arm/mach-omap2/board-overo.c
> @@ -46,7 +46,7 @@
>  #include <mach/hardware.h>
>  #include <mach/nand.h>
>  #include <mach/usb-ehci.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  
>  #include "sdram-micron-mt46h32m32lf-6.h"
>  #include "twl4030-generic-scripts.h"
> diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
> index e845aac..98dfde1 100644
> --- a/arch/arm/mach-omap2/board-rx51.c
> +++ b/arch/arm/mach-omap2/board-rx51.c
> @@ -28,7 +28,7 @@
>  #include <mach/keypad.h>
>  #include <mach/dma.h>
>  #include <mach/gpmc.h>
> -#include <mach/usb-musb.h>
> +#include <mach/usb.h>
>  
>  #include <asm/io.h>
>  #include <asm/delay.h>
> diff --git a/arch/arm/plat-omap/include/mach/usb-musb.h b/arch/arm/plat-omap/include/mach/usb-musb.h
> deleted file mode 100644
> index b455b29..0000000
> --- a/arch/arm/plat-omap/include/mach/usb-musb.h
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -/*
> - * arch/arm/plat-omap/include/mach/usb-musb.h
> - *
> - * Hardware definitions for Mentor Graphics MUSBMHDRC.
> - *
> - * Initial creation by Felipe Balbi.
> - *
> - * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> - *
> - * 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.
> - */
> -
> -#ifndef __ASM_ARCH_OMAP_USB_MUSB_H
> -#define __ASM_ARCH_OMAP_USB_MUSB_H
> -
> -extern void usb_musb_init(void);
> -
> -#endif /* __ASM_ARCH_OMAP_USB_MUSB_H */
> -
> diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
> index e078155..7d7b2b0 100644
> --- a/arch/arm/plat-omap/include/mach/usb.h
> +++ b/arch/arm/plat-omap/include/mach/usb.h
> @@ -27,8 +27,8 @@
>  #define UDC_BASE			OMAP2_UDC_BASE
>  #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
>  
> -void __init usb_musb_init(void);
> -void __init usb_ehci_init(void);
> +extern void usb_musb_init(void);
> +extern void usb_ehci_init(void);

This second line has nothing to with musb, right ? You should move to
usb-ehci.h removal patch.

-- 
balbi

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] musb_hdrc: Build usb-musb based on config entry, clean-up Makefile
  2009-02-12 19:17 ` [PATCH 3/3] musb_hdrc: Build usb-musb based on config entry, clean-up Makefile Tony Lindgren
@ 2009-02-12 19:31   ` Felipe Balbi
  0 siblings, 0 replies; 12+ messages in thread
From: Felipe Balbi @ 2009-02-12 19:31 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Felipe Balbi, David Brownell

On Thu, Feb 12, 2009 at 11:17:19AM -0800, Tony Lindgren wrote:
> Build usb-musb based on config entry, clean-up Makefile
> 
> Cc: Felipe Balbi <felipe.balbi@nokia.com>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Makes sense to me

> ---
>  arch/arm/mach-omap2/Makefile          |   17 ++++++-----------
>  arch/arm/mach-omap2/usb-musb.c        |    7 -------
>  arch/arm/plat-omap/include/mach/usb.h |    7 +++++++
>  3 files changed, 13 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 631166d..fad8af4 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -44,27 +44,24 @@ obj-$(CONFIG_MACH_OMAP_H4)		+= board-h4.o board-h4-mmc.o
>  obj-$(CONFIG_MACH_OMAP_2430SDP)		+= board-2430sdp.o \
>  					   board-2430sdp-flash.o \
>  					   mmc-twl4030.o \
> -					   usb-musb.o \
>  					   usb-ehci.o
>  obj-$(CONFIG_MACH_OMAP2EVM)		+= board-omap2evm.o \
>  					   mmc-twl4030.o
>  obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o \
>  					   mmc-twl4030.o \
> -					   usb-musb.o \
>  					   usb-ehci.o \
>  					   board-3430sdp-flash.o
>  obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o \
>  					   mmc-twl4030.o \
> -					   usb-musb.o usb-ehci.o \
> +					   usb-ehci.o \
>  					   board-omap3evm-flash.o \
>  					   twl4030-generic-scripts.o
>  obj-$(CONFIG_MACH_OMAP3_BEAGLE)		+= board-omap3beagle.o \
> -					   usb-musb.o usb-ehci.o \
> +					   usb-ehci.o \
>  					   mmc-twl4030.o \
>  					   twl4030-generic-scripts.o
>  obj-$(CONFIG_MACH_OMAP_LDP)		+= board-ldp.o \
> -					   mmc-twl4030.o \
> -					   usb-musb.o
> +					   mmc-twl4030.o
>  obj-$(CONFIG_MACH_OMAP_APOLLON)		+= board-apollon.o \
>  					   board-apollon-mmc.o	\
>  					   board-apollon-keys.o
> @@ -80,19 +77,17 @@ obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o \
>  					   board-rx51-sdram.o \
>  					   board-rx51-video.o \
>  					   board-rx51-peripherals.o \
> -					   mmc-twl4030.o \
> -					   usb-musb.o
> +					   mmc-twl4030.o
>  
>  obj-$(CONFIG_MACH_OVERO)		+= board-overo.o \
>  					   mmc-twl4030.o \
> -					   usb-musb.o \
>  					   usb-ehci.o \
>  					   twl4030-generic-scripts.o
>  obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o \
>  					   mmc-twl4030.o \
> -					   usb-musb.o \
>  					   usb-ehci.o
>  
> -# TUSB 6010 chips
> +# Platform specific device init code
> +obj-$(CONFIG_USB_MUSB_SOC)		+= usb-musb.o
>  obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
>  
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index 897c07d..327af7d 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -33,7 +33,6 @@
>  #include <mach/mux.h>
>  #include <mach/usb.h>
>  
> -#ifdef CONFIG_USB_MUSB_SOC
>  static struct resource musb_resources[] = {
>  	[0] = { /* start and end set dynamically */
>  		.flags	= IORESOURCE_MEM,
> @@ -146,13 +145,9 @@ static struct platform_device musb_device = {
>  	.num_resources	= ARRAY_SIZE(musb_resources),
>  	.resource	= musb_resources,
>  };
> -#endif
> -
>  
>  void __init usb_musb_init(void)
>  {
> -#ifdef CONFIG_USB_MUSB_SOC
> -
>  	if (cpu_is_omap243x()) {
>  		musb_resources[0].start = OMAP243X_HS_BASE;
>  		musb_plat.clock = "usbhs_ick";
> @@ -167,6 +162,4 @@ void __init usb_musb_init(void)
>  		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
>  		return;
>  	}
> -#endif
>  }
> -
> diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
> index 7d7b2b0..e69c5ad 100644
> --- a/arch/arm/plat-omap/include/mach/usb.h
> +++ b/arch/arm/plat-omap/include/mach/usb.h
> @@ -27,7 +27,14 @@
>  #define UDC_BASE			OMAP2_UDC_BASE
>  #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
>  
> +#ifdef CONFIG_USB_MUSB_SOC
>  extern void usb_musb_init(void);
> +#else
> +static inline void usb_musb_init(void)
> +{
> +}
> +#endif
> +
>  extern void usb_ehci_init(void);
>  
>  #endif
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge
  2009-02-12 19:21 ` [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
@ 2009-02-12 19:35   ` Felipe Balbi
  2009-02-13 20:50   ` David Brownell
  1 sibling, 0 replies; 12+ messages in thread
From: Felipe Balbi @ 2009-02-12 19:35 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap

On Thu, Feb 12, 2009 at 11:21:01AM -0800, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [090212 11:16]:
> > Hi Felipe & Dave,
> > 
> > While creating a patch for usb-musb.c init code for mainline
> > kernel, I ended up cleaning up following stuff in the l-o tree.
> > 
> > Does it look OK to you?
> 
> And here's what the musb_init patch for the mainline. No boards are
> calling musb_init() yet, but that's easy to append.

The attached patch looks nice as well.

> The clock function might cause some merge issues.. I guess eventually
> the driver should just call clk_enable/disable once the omap2 clock
> merge is done.

Yeah, hopefully Russell's work will let us get rid of this
musb_set_clock and use only standard clk_enable/disable() calls.

We only keep that due to different clock names anyway.

-- 
balbi

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] musb_hdrc: Clean-up MUSB init code for next merge window
  2009-02-12 19:30   ` Felipe Balbi
@ 2009-02-12 19:44     ` Tony Lindgren
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2009-02-12 19:44 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap, Felipe Balbi, David Brownell

* Felipe Balbi <me@felipebalbi.com> [090212 11:32]:
> On Thu, Feb 12, 2009 at 11:17:08AM -0800, Tony Lindgren wrote:
> > Let's just use mach/usb.h as mach/musb.h only has one entry.
> > 
> > Cc: Felipe Balbi <felipe.balbi@nokia.com>
> > Cc: David Brownell <dbrownell@users.sourceforge.net>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  arch/arm/mach-omap2/board-2430sdp.c        |    2 +-
> >  arch/arm/mach-omap2/board-3430sdp.c        |    2 +-
> >  arch/arm/mach-omap2/board-ldp.c            |    2 +-
> >  arch/arm/mach-omap2/board-omap3beagle.c    |    2 +-
> >  arch/arm/mach-omap2/board-omap3evm.c       |    2 +-
> >  arch/arm/mach-omap2/board-omap3pandora.c   |    2 +-
> >  arch/arm/mach-omap2/board-overo.c          |    2 +-
> >  arch/arm/mach-omap2/board-rx51.c           |    2 +-
> >  arch/arm/plat-omap/include/mach/usb-musb.h |   35 ----------------------------
> >  arch/arm/plat-omap/include/mach/usb.h      |    4 ++-
> >  10 files changed, 10 insertions(+), 45 deletions(-)
> >  delete mode 100644 arch/arm/plat-omap/include/mach/usb-musb.h
> > 
> > diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
> > index cc65b1a..aa5df72 100644
> > --- a/arch/arm/mach-omap2/board-2430sdp.c
> > +++ b/arch/arm/mach-omap2/board-2430sdp.c
> > @@ -36,7 +36,7 @@
> >  #include <mach/gpio.h>
> >  #include <mach/mux.h>
> >  #include <mach/board.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  #include <mach/common.h>
> >  #include <mach/gpmc.h>
> >  #include <mach/mcspi.h>
> > diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
> > index 8a0dba6..10be03e 100644
> > --- a/arch/arm/mach-omap2/board-3430sdp.c
> > +++ b/arch/arm/mach-omap2/board-3430sdp.c
> > @@ -34,7 +34,7 @@
> >  #include <mach/gpio.h>
> >  #include <mach/mux.h>
> >  #include <mach/board.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  #include <mach/usb-ehci.h>
> >  #include <mach/common.h>
> >  #include <mach/dma.h>
> > diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> > index 73c4504..1e1fd84 100644
> > --- a/arch/arm/mach-omap2/board-ldp.c
> > +++ b/arch/arm/mach-omap2/board-ldp.c
> > @@ -35,7 +35,7 @@
> >  #include <mach/board.h>
> >  #include <mach/common.h>
> >  #include <mach/gpmc.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  
> >  #include <asm/io.h>
> >  #include <asm/delay.h>
> > diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> > index 64c76bd..64fc613 100644
> > --- a/arch/arm/mach-omap2/board-omap3beagle.c
> > +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> > @@ -38,7 +38,7 @@
> >  #include <asm/mach/flash.h>
> >  
> >  #include <mach/board.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  #include <mach/usb-ehci.h>
> >  #include <mach/common.h>
> >  #include <mach/gpmc.h>
> > diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> > index 775a1f3..4946463 100644
> > --- a/arch/arm/mach-omap2/board-omap3evm.c
> > +++ b/arch/arm/mach-omap2/board-omap3evm.c
> > @@ -31,7 +31,7 @@
> >  
> >  #include <mach/gpio.h>
> >  #include <mach/board.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  #include <mach/usb-ehci.h>
> >  #include <mach/common.h>
> >  #include <mach/mcspi.h>
> > diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
> > index 2637641..cd90bf4 100644
> > --- a/arch/arm/mach-omap2/board-omap3pandora.c
> > +++ b/arch/arm/mach-omap2/board-omap3pandora.c
> > @@ -45,7 +45,7 @@
> >  #include <mach/hardware.h>
> >  #include <mach/nand.h>
> >  #include <mach/usb-ehci.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  #include <mach/mcspi.h>
> >  
> >  #include "sdram-micron-mt46h32m32lf-6.h"
> > diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
> > index c95b890..f600f70 100644
> > --- a/arch/arm/mach-omap2/board-overo.c
> > +++ b/arch/arm/mach-omap2/board-overo.c
> > @@ -46,7 +46,7 @@
> >  #include <mach/hardware.h>
> >  #include <mach/nand.h>
> >  #include <mach/usb-ehci.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  
> >  #include "sdram-micron-mt46h32m32lf-6.h"
> >  #include "twl4030-generic-scripts.h"
> > diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
> > index e845aac..98dfde1 100644
> > --- a/arch/arm/mach-omap2/board-rx51.c
> > +++ b/arch/arm/mach-omap2/board-rx51.c
> > @@ -28,7 +28,7 @@
> >  #include <mach/keypad.h>
> >  #include <mach/dma.h>
> >  #include <mach/gpmc.h>
> > -#include <mach/usb-musb.h>
> > +#include <mach/usb.h>
> >  
> >  #include <asm/io.h>
> >  #include <asm/delay.h>
> > diff --git a/arch/arm/plat-omap/include/mach/usb-musb.h b/arch/arm/plat-omap/include/mach/usb-musb.h
> > deleted file mode 100644
> > index b455b29..0000000
> > --- a/arch/arm/plat-omap/include/mach/usb-musb.h
> > +++ /dev/null
> > @@ -1,35 +0,0 @@
> > -/*
> > - * arch/arm/plat-omap/include/mach/usb-musb.h
> > - *
> > - * Hardware definitions for Mentor Graphics MUSBMHDRC.
> > - *
> > - * Initial creation by Felipe Balbi.
> > - *
> > - * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> > - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> > - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> > - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> > - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> > - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> > - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> > - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> > - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> > - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > - *
> > - * 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.
> > - */
> > -
> > -#ifndef __ASM_ARCH_OMAP_USB_MUSB_H
> > -#define __ASM_ARCH_OMAP_USB_MUSB_H
> > -
> > -extern void usb_musb_init(void);
> > -
> > -#endif /* __ASM_ARCH_OMAP_USB_MUSB_H */
> > -
> > diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
> > index e078155..7d7b2b0 100644
> > --- a/arch/arm/plat-omap/include/mach/usb.h
> > +++ b/arch/arm/plat-omap/include/mach/usb.h
> > @@ -27,8 +27,8 @@
> >  #define UDC_BASE			OMAP2_UDC_BASE
> >  #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
> >  
> > -void __init usb_musb_init(void);
> > -void __init usb_ehci_init(void);
> > +extern void usb_musb_init(void);
> > +extern void usb_ehci_init(void);
> 
> This second line has nothing to with musb, right ? You should move to
> usb-ehci.h removal patch.

OK, good point, I'll get rid of usb-ehci.h as well then.

Tony

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge
  2009-02-12 19:16 [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
                   ` (3 preceding siblings ...)
  2009-02-12 19:21 ` [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
@ 2009-02-12 20:49 ` David Brownell
  4 siblings, 0 replies; 12+ messages in thread
From: David Brownell @ 2009-02-12 20:49 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap

On Thursday 12 February 2009, Tony Lindgren wrote:
> While creating a patch for usb-musb.c init code for mainline
> kernel, I ended up cleaning up following stuff in the l-o tree.
> 
> Does it look OK to you?

It all looked fine to me.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge
  2009-02-12 19:21 ` [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
  2009-02-12 19:35   ` Felipe Balbi
@ 2009-02-13 20:50   ` David Brownell
  1 sibling, 0 replies; 12+ messages in thread
From: David Brownell @ 2009-02-13 20:50 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap

On Thursday 12 February 2009, Tony Lindgren wrote:
> And here's what the musb_init patch for the mainline. No boards are
> calling musb_init() yet, but that's easy to append.
> 

Looks fair to me -- though I didn't try it.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-02-13 20:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-12 19:16 [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
2009-02-12 19:16 ` [PATCH 1/3] musb_hdrc: Set musb_resources dynamically Tony Lindgren
2009-02-12 19:28   ` Felipe Balbi
2009-02-12 19:17 ` [PATCH 2/3] musb_hdrc: Clean-up MUSB init code for next merge window Tony Lindgren
2009-02-12 19:30   ` Felipe Balbi
2009-02-12 19:44     ` Tony Lindgren
2009-02-12 19:17 ` [PATCH 3/3] musb_hdrc: Build usb-musb based on config entry, clean-up Makefile Tony Lindgren
2009-02-12 19:31   ` Felipe Balbi
2009-02-12 19:21 ` [PATCH 0/3] musb_hdrc: Clean-up init code for mainline merge Tony Lindgren
2009-02-12 19:35   ` Felipe Balbi
2009-02-13 20:50   ` David Brownell
2009-02-12 20:49 ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox