diff options
| author | Wolfgang Denk <wd@denx.de> | 2012-05-20 22:51:41 +0200 |
|---|---|---|
| committer | Wolfgang Denk <wd@denx.de> | 2012-05-20 22:51:41 +0200 |
| commit | 2ab5be7af009b4a40efe2fa5471497c97e70ed28 (patch) | |
| tree | 7c489b7db4927ef433d83d10a26fe48e2e9d1a4a /include/usb | |
| parent | 8fa3d2b8161bb73b759c9db5c811c885ca5ec60c (diff) | |
| parent | 5f0ffea4559abe3fc83a6023717658a50b22e66c (diff) | |
| download | olio-uboot-2014.01-2ab5be7af009b4a40efe2fa5471497c97e70ed28.tar.xz olio-uboot-2014.01-2ab5be7af009b4a40efe2fa5471497c97e70ed28.zip | |
Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb:
USB: S5P: Add ehci support
usb:udc:samsung Add functions for storing private gadget data in UDC driver
usb:gadget:composite: Support for composite at gadget.h
usb:gadget:composite USB composite gadget support
usb:udc:samsung:cleanup Replace DEBUG_* macros with debug_cond() calls
usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file
USB: Document the QH and qTD antics in EHCI-HCD
USB: Drop cache flush bloat in EHCI-HCD
USB: Drop ehci_alloc/ehci_free in ehci-hcd
USB: Align buffers at cacheline
usb: use noinline define
Diffstat (limited to 'include/usb')
| -rw-r--r-- | include/usb/lin_gadget_compat.h | 19 | ||||
| -rw-r--r-- | include/usb/s3c_udc.h | 49 |
2 files changed, 20 insertions, 48 deletions
diff --git a/include/usb/lin_gadget_compat.h b/include/usb/lin_gadget_compat.h index 8287b9de9..5bdcb8d79 100644 --- a/include/usb/lin_gadget_compat.h +++ b/include/usb/lin_gadget_compat.h @@ -44,6 +44,25 @@ #define ENOTSUPP 524 /* Operation is not supported */ +#define BITS_PER_BYTE 8 +#define BITS_TO_LONGS(nr) \ + DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) +#define DECLARE_BITMAP(name, bits) \ + unsigned long name[BITS_TO_LONGS(bits)] + +#define small_const_nbits(nbits) \ + (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) + +static inline void bitmap_zero(unsigned long *dst, int nbits) +{ + if (small_const_nbits(nbits)) + *dst = 0UL; + else { + int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); + memset(dst, 0, len); + } +} + #define dma_cache_maint(addr, size, mode) cache_flush() void cache_flush(void); diff --git a/include/usb/s3c_udc.h b/include/usb/s3c_udc.h index 6c973b699..6a8fd4424 100644 --- a/include/usb/s3c_udc.h +++ b/include/usb/s3c_udc.h @@ -24,6 +24,7 @@ #include <asm/errno.h> #include <linux/usb/ch9.h> +#include <usbdescriptors.h> #include <linux/usb/gadget.h> #include <linux/list.h> #include <usb/lin_gadget_compat.h> @@ -111,54 +112,6 @@ extern struct s3c_udc *the_controller; #define ep_index(EP) ((EP)->bEndpointAddress&0xF) #define ep_maxpacket(EP) ((EP)->ep.maxpacket) -/*-------------------------------------------------------------------------*/ -/* #define DEBUG_UDC */ -#ifdef DEBUG_UDC -#define DBG(stuff...) printf("udc: " stuff) -#else -#define DBG(stuff...) do {} while (0) -#endif - -#ifdef DEBUG_S3C_UDC_SETUP -#define DEBUG_SETUP(fmt, args...) printk(fmt, ##args) -#else -#define DEBUG_SETUP(fmt, args...) do {} while (0) -#endif - -#ifdef DEBUG_S3C_UDC_EP0 -#define DEBUG_EP0(fmt, args...) printk(fmt, ##args) -#else -#define DEBUG_EP0(fmt, args...) do {} while (0) -#endif - -#ifdef DEBUG_S3C_UDC_ISR -#define DEBUG_ISR 1 -#else -#define DEBUG_ISR 0 -#endif - -#ifdef DEBUG_S3C_UDC_OUT_EP -#define DEBUG_OUT_EP(fmt, args...) printk(fmt, ##args) -#else -#define DEBUG_OUT_EP(fmt, args...) do {} while (0) -#endif - -#ifdef DEBUG_S3C_UDC_IN_EP -#define DEBUG_IN_EP 1 -#else -#define DEBUG_IN_EP 0 -#endif - -#if defined(DEBUG_S3C_UDC_SETUP) || defined(DEBUG_S3C_UDC_EP0) || \ - defined(DEBUG_S3C_UDC_ISR) || defined(DEBUG_S3C_UDC_OUT_EP) || \ - defined(DEBUG_S3C_UDC_IN_EP) || defined(DEBUG_S3C_UDC) -#define DEBUG -#endif - -#define ERR(stuff...) printf("ERR udc: " stuff) -#define WARN(stuff...) printf("WARNING udc: " stuff) -#define INFO(stuff...) printf("INFO udc: " stuff) - extern void otg_phy_init(struct s3c_udc *dev); extern void otg_phy_off(struct s3c_udc *dev); |