[PATCH 14/27] usb: musb: simplify musb_ep_select&MUSB_EP_OFFSET for different hardware

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tom.leiming
Date: Sunday, December 12, 2010 - 10:02 am

From: Ming Lei <tom.leiming@gmail.com>

In fact, for tusb, musb_ep_select and MUSB_EP_OFFSET are same with
that for indexed mapping, so merge the two cases to simplify
definition of the two helpers.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/usb/musb/musb_core.h |    8 +-------
 drivers/usb/musb/musb_regs.h |    3 ---
 2 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 042b7fc..2e558d4 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -224,14 +224,8 @@ enum musb_g_ep0_state {
 #define	MUSB_FLAT_REG
 #endif
 
-/* TUSB mapping: "flat" plus ep0 special cases */
-#if	defined(CONFIG_USB_MUSB_TUSB6010)
-#define musb_ep_select(_mbase, _epnum) \
-	musb_writeb((_mbase), MUSB_INDEX, (_epnum))
-#define	MUSB_EP_OFFSET			MUSB_TUSB_OFFSET
-
 /* "flat" mapping: each endpoint has its own i/o address */
-#elif	defined(MUSB_FLAT_REG)
+#ifdef	MUSB_FLAT_REG
 #define musb_ep_select(_mbase, _epnum)	(((void)(_mbase)), ((void)(_epnum)))
 #define	MUSB_EP_OFFSET			MUSB_FLAT_OFFSET
 
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index edc0cca..3321bae 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -292,9 +292,6 @@
 #define MUSB_FLAT_OFFSET(_epnum, _offset)	\
 	(0x100 + (0x10*(_epnum)) + (_offset))
 
-/* TUSB6010 EP0 configuration register is special */
-#define MUSB_TUSB_OFFSET(_epnum, _offset)	\
-	(0x10 + _offset)
 #include "tusb6010.h"		/* Needed "only" for TUSB_EP0_CONF */
 
 #define MUSB_TXCSR_MODE			0x2000
-- 
1.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/28] usb: musb: musb cleanup, tom.leiming, (Sun Dec 12, 10:01 am)
[PATCH 11/28] usb: musb: remove musb_in_tusb, tom.leiming, (Sun Dec 12, 10:01 am)
[PATCH 12/27] usb: musb: remove musb_in_tusb, tom.leiming, (Sun Dec 12, 10:01 am)
[PATCH 14/27] usb: musb: simplify musb_ep_select&MUSB_EP_O ..., tom.leiming, (Sun Dec 12, 10:02 am)
[PATCH 21/28] usb: musb: print dma type in runtime way, tom.leiming, (Sun Dec 12, 10:02 am)
[PATCH 22/27] usb: musb: print dma type in runtime way, tom.leiming, (Sun Dec 12, 10:02 am)
RE: [PATCH 0/28] usb: musb: musb cleanup, Gupta, Ajay Kumar, (Mon Dec 13, 12:55 am)
Re: [PATCH 0/28] usb: musb: musb cleanup, Ming Lei, (Mon Dec 13, 3:17 am)
Re: [PATCH 0/28] usb: musb: musb cleanup, Ming Lei, (Mon Dec 13, 3:18 am)