diff options
Diffstat (limited to 'drivers/usb/host/isp1362.h')
| -rw-r--r-- | drivers/usb/host/isp1362.h | 53 | 
1 files changed, 5 insertions, 48 deletions
diff --git a/drivers/usb/host/isp1362.h b/drivers/usb/host/isp1362.h index 0f97820e65b..3b0b4847c3a 100644 --- a/drivers/usb/host/isp1362.h +++ b/drivers/usb/host/isp1362.h @@ -76,14 +76,14 @@ static inline void delayed_insw(unsigned int addr, void *buf, int len)  #define ISP1362_REG_WRITE_OFFSET	0x80 -#ifdef ISP1362_DEBUG -typedef const unsigned int isp1362_reg_t; -  #define REG_WIDTH_16			0x000  #define REG_WIDTH_32			0x100  #define REG_WIDTH_MASK			0x100  #define REG_NO_MASK			0x0ff +#ifdef ISP1362_DEBUG +typedef const unsigned int isp1362_reg_t; +  #define REG_ACCESS_R			0x200  #define REG_ACCESS_W			0x400  #define REG_ACCESS_RW			0x600 @@ -91,9 +91,6 @@ typedef const unsigned int isp1362_reg_t;  #define ISP1362_REG_NO(r)		((r) & REG_NO_MASK) -#define _BUG_ON(x)	BUG_ON(x) -#define _WARN_ON(x)	WARN_ON(x) -  #define ISP1362_REG(name, addr, width, rw) \  static isp1362_reg_t ISP1362_REG_##name = ((addr) | (width) | (rw)) @@ -102,8 +99,6 @@ static isp1362_reg_t ISP1362_REG_##name = ((addr) | (width) | (rw))  #else  typedef const unsigned char isp1362_reg_t;  #define ISP1362_REG_NO(r)		(r) -#define _BUG_ON(x)			do {} while (0) -#define _WARN_ON(x)			do {} while (0)  #define ISP1362_REG(name, addr, width, rw) \  static isp1362_reg_t ISP1362_REG_##name = addr @@ -485,7 +480,7 @@ struct isp1362_hcd {  	struct isp1362_platform_data *board; -	struct proc_dir_entry	*pde; +	struct dentry		*debug_file;  	unsigned long		stat1, stat2, stat4, stat8, stat16;  	/* HC registers */ @@ -587,21 +582,11 @@ static inline struct usb_hcd *isp1362_hcd_to_hcd(struct isp1362_hcd *isp1362_hcd   * ISP1362 HW Interface   */ -#ifdef ISP1362_DEBUG  #define DBG(level, fmt...) \  	do { \  		if (dbg_level > level) \  			pr_debug(fmt); \  	} while (0) -#define _DBG(level, fmt...)	\ -	do { \ -		if (dbg_level > level) \ -			printk(fmt); \ -	} while (0) -#else -#define DBG(fmt...)		do {} while (0) -#define _DBG DBG -#endif  #ifdef VERBOSE  #    define VDBG(fmt...)	DBG(3, fmt) @@ -645,9 +630,7 @@ static inline struct usb_hcd *isp1362_hcd_to_hcd(struct isp1362_hcd *isp1362_hcd   */  static void isp1362_write_addr(struct isp1362_hcd *isp1362_hcd, isp1362_reg_t reg)  { -	/*_BUG_ON((reg & ISP1362_REG_WRITE_OFFSET) && !(reg & REG_ACCESS_W));*/  	REG_ACCESS_TEST(reg); -	_BUG_ON(!irqs_disabled());  	DUMMY_DELAY_ACCESS;  	writew(ISP1362_REG_NO(reg), isp1362_hcd->addr_reg);  	DUMMY_DELAY_ACCESS; @@ -656,7 +639,6 @@ static void isp1362_write_addr(struct isp1362_hcd *isp1362_hcd, isp1362_reg_t re  static void isp1362_write_data16(struct isp1362_hcd *isp1362_hcd, u16 val)  { -	_BUG_ON(!irqs_disabled());  	DUMMY_DELAY_ACCESS;  	writew(val, isp1362_hcd->data_reg);  } @@ -665,7 +647,6 @@ static u16 isp1362_read_data16(struct isp1362_hcd *isp1362_hcd)  {  	u16 val; -	_BUG_ON(!irqs_disabled());  	DUMMY_DELAY_ACCESS;  	val = readw(isp1362_hcd->data_reg); @@ -674,7 +655,6 @@ static u16 isp1362_read_data16(struct isp1362_hcd *isp1362_hcd)  static void isp1362_write_data32(struct isp1362_hcd *isp1362_hcd, u32 val)  { -	_BUG_ON(!irqs_disabled());  #if USE_32BIT  	DUMMY_DELAY_ACCESS;  	writel(val, isp1362_hcd->data_reg); @@ -690,7 +670,6 @@ static u32 isp1362_read_data32(struct isp1362_hcd *isp1362_hcd)  {  	u32 val; -	_BUG_ON(!irqs_disabled());  #if USE_32BIT  	DUMMY_DELAY_ACCESS;  	val = readl(isp1362_hcd->data_reg); @@ -713,8 +692,6 @@ static void isp1362_read_fifo(struct isp1362_hcd *isp1362_hcd, void *buf, u16 le  	if (!len)  		return; -	_BUG_ON(!irqs_disabled()); -  	RDBG("%s: Reading %d byte from fifo to mem @ %p\n", __func__, len, buf);  #if USE_32BIT  	if (len >= 4) { @@ -760,8 +737,6 @@ static void isp1362_write_fifo(struct isp1362_hcd *isp1362_hcd, void *buf, u16 l  		return;  	} -	_BUG_ON(!irqs_disabled()); -  	RDBG("%s: Writing %d byte to fifo from memory @%p\n", __func__, len, buf);  #if USE_32BIT  	if (len >= 4) { @@ -854,7 +829,6 @@ static void isp1362_write_fifo(struct isp1362_hcd *isp1362_hcd, void *buf, u16 l  		isp1362_write_reg32(d, r, __v & ~m);	\  } -#ifdef ISP1362_DEBUG  #define isp1362_show_reg(d, r) {								\  	if ((ISP1362_REG_##r & REG_WIDTH_MASK) == REG_WIDTH_32)			\  		DBG(0, "%-12s[%02x]: %08x\n", #r,					\ @@ -863,9 +837,6 @@ static void isp1362_write_fifo(struct isp1362_hcd *isp1362_hcd, void *buf, u16 l  		DBG(0, "%-12s[%02x]:     %04x\n", #r,					\  			ISP1362_REG_NO(ISP1362_REG_##r), isp1362_read_reg16(d, r));	\  } -#else -#define isp1362_show_reg(d, r)	do {} while (0) -#endif  static void __attribute__((__unused__)) isp1362_show_regs(struct isp1362_hcd *isp1362_hcd)  { @@ -923,10 +894,6 @@ static void __attribute__((__unused__)) isp1362_show_regs(struct isp1362_hcd *is  static void isp1362_write_diraddr(struct isp1362_hcd *isp1362_hcd, u16 offset, u16 len)  { -	_BUG_ON(offset & 1); -	_BUG_ON(offset >= ISP1362_BUF_SIZE); -	_BUG_ON(len > ISP1362_BUF_SIZE); -	_BUG_ON(offset + len > ISP1362_BUF_SIZE);  	len = (len + 1) & ~1;  	isp1362_clr_mask16(isp1362_hcd, HCDMACFG, HCDMACFG_CTR_ENABLE); @@ -936,42 +903,32 @@ static void isp1362_write_diraddr(struct isp1362_hcd *isp1362_hcd, u16 offset, u  static void isp1362_read_buffer(struct isp1362_hcd *isp1362_hcd, void *buf, u16 offset, int len)  { -	_BUG_ON(offset & 1); -  	isp1362_write_diraddr(isp1362_hcd, offset, len);  	DBG(3, "%s: Reading %d byte from buffer @%04x to memory @ %p\n",  	    __func__, len, offset, buf);  	isp1362_write_reg16(isp1362_hcd, HCuPINT, HCuPINT_EOT); -	_WARN_ON((isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));  	isp1362_write_addr(isp1362_hcd, ISP1362_REG_HCDIRDATA);  	isp1362_read_fifo(isp1362_hcd, buf, len); -	_WARN_ON(!(isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));  	isp1362_write_reg16(isp1362_hcd, HCuPINT, HCuPINT_EOT); -	_WARN_ON((isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));  }  static void isp1362_write_buffer(struct isp1362_hcd *isp1362_hcd, void *buf, u16 offset, int len)  { -	_BUG_ON(offset & 1); -  	isp1362_write_diraddr(isp1362_hcd, offset, len);  	DBG(3, "%s: Writing %d byte to buffer @%04x from memory @ %p\n",  	    __func__, len, offset, buf);  	isp1362_write_reg16(isp1362_hcd, HCuPINT, HCuPINT_EOT); -	_WARN_ON((isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));  	isp1362_write_addr(isp1362_hcd, ISP1362_REG_HCDIRDATA | ISP1362_REG_WRITE_OFFSET);  	isp1362_write_fifo(isp1362_hcd, buf, len); -	_WARN_ON(!(isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));  	isp1362_write_reg16(isp1362_hcd, HCuPINT, HCuPINT_EOT); -	_WARN_ON((isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));  }  static void __attribute__((unused)) dump_data(char *buf, int len) @@ -1002,7 +959,7 @@ static void __attribute__((unused)) dump_data(char *buf, int len)  	}  } -#if defined(ISP1362_DEBUG) && defined(PTD_TRACE) +#if defined(PTD_TRACE)  static void dump_ptd(struct ptd *ptd)  {  | 
