diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2007-11-08 12:28:27 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2007-11-08 12:28:27 +0000 |
commit | cda3dc3ae1a21fb9c1e8729d2fcc84967e42dd2b (patch) | |
tree | 7405ae8f7dd7e736698d9047438081029b6ef147 /target/linux/adm5120/files/drivers/usb/host/adm5120.h | |
parent | 64e1a619c22e12d3fe9d30699a2baf4842501892 (diff) | |
download | mtk-20170518-cda3dc3ae1a21fb9c1e8729d2fcc84967e42dd2b.zip mtk-20170518-cda3dc3ae1a21fb9c1e8729d2fcc84967e42dd2b.tar.gz mtk-20170518-cda3dc3ae1a21fb9c1e8729d2fcc84967e42dd2b.tar.bz2 |
USB driver fixes
SVN-Revision: 9513
Diffstat (limited to 'target/linux/adm5120/files/drivers/usb/host/adm5120.h')
-rw-r--r-- | target/linux/adm5120/files/drivers/usb/host/adm5120.h | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120.h b/target/linux/adm5120/files/drivers/usb/host/adm5120.h index 3707225..bdfdbc7 100644 --- a/target/linux/adm5120/files/drivers/usb/host/adm5120.h +++ b/target/linux/adm5120/files/drivers/usb/host/adm5120.h @@ -369,8 +369,6 @@ struct urb_priv { struct admhcd { spinlock_t lock; - spinlock_t dma_lock; - u32 dma_state; /* * I/O memory used to communicate with the HC (dma-consistent) @@ -438,22 +436,6 @@ static inline struct usb_hcd *admhcd_to_hcd(const struct admhcd *ahcd) #define STUB_DEBUG_FILES #endif /* DEBUG */ -#if 0 -#define admhc_dbg(ahcd, fmt, args...) \ - dev_dbg(admhcd_to_hcd(ahcd)->self.controller , fmt , ## args ) -#define admhc_err(ahcd, fmt, args...) \ - dev_err(admhcd_to_hcd(ahcd)->self.controller , fmt , ## args ) -#define ahcd_info(ahcd, fmt, args...) \ - dev_info(admhcd_to_hcd(ahcd)->self.controller , fmt , ## args ) -#define admhc_warn(ahcd, fmt, args...) \ - dev_warn(admhcd_to_hcd(ahcd)->self.controller , fmt , ## args ) - -#ifdef ADMHC_VERBOSE_DEBUG -# define admhc_vdbg admhc_dbg -#else -# define admhc_vdbg(ahcd, fmt, args...) do { } while (0) -#endif -#else #define admhc_dbg(ahcd, fmt, args...) \ printk(KERN_DEBUG "adm5120-hcd: " fmt , ## args ) #define admhc_err(ahcd, fmt, args...) \ @@ -468,7 +450,6 @@ static inline struct usb_hcd *admhcd_to_hcd(const struct admhcd *ahcd) #else # define admhc_vdbg(ahcd, fmt, args...) do { } while (0) #endif -#endif /*-------------------------------------------------------------------------*/ @@ -564,14 +545,6 @@ static inline void admhc_writel(const struct admhcd *ahcd, #endif } -static inline void admhc_writel_flush(const struct admhcd *ahcd) -{ -#if 0 /* TODO: needed? */ - (void) admhc_readl(ahcd, &ahcd->regs->control); -#endif -} - - /*-------------------------------------------------------------------------*/ /* cpu to ahcd */ @@ -659,13 +632,12 @@ static inline void admhc_disable(struct admhcd *ahcd) } #define FI 0x2edf /* 12000 bits per frame (-1) */ -#define FSLDP(fi) (0x7fff & ((6 * ((fi) - 210)) / 7)) +#define FSLDP(fi) (0x7fff & ((6 * ((fi) - 1200)) / 7)) #define FIT ADMHC_SFI_FIT #define LSTHRESH 0x628 /* lowspeed bit threshold */ static inline void periodic_reinit(struct admhcd *ahcd) { - u32 fi = ahcd->fminterval & ADMHC_SFI_FI_MASK; u32 fit = admhc_readl(ahcd, &ahcd->regs->fminterval) & FIT; /* TODO: adjust FSLargestDataPacket value too? */ @@ -724,7 +696,7 @@ static inline void admhc_dma_enable(struct admhcd *ahcd) t |= ADMHC_HC_DMAE; admhc_writel(ahcd, t, &ahcd->regs->host_control); - admhc_dbg(ahcd,"DMA enabled\n"); + admhc_vdbg(ahcd,"DMA enabled\n"); } static inline void admhc_dma_disable(struct admhcd *ahcd) @@ -737,24 +709,5 @@ static inline void admhc_dma_disable(struct admhcd *ahcd) t &= ~ADMHC_HC_DMAE; admhc_writel(ahcd, t, &ahcd->regs->host_control); - admhc_dbg(ahcd,"DMA disabled\n"); -} - -static inline void admhc_dma_lock(struct admhcd *ahcd) -{ - spin_lock(ahcd->dma_lock); - - ahcd->dma_state = admhc_readl(ahcd, &ahcd->regs->host_control); - admhc_writel(ahcd, 0, &ahcd->regs->hosthead); - admhc_writel(ahcd, ahcd->dma_state & ~ADMHC_HC_DMAE, - &ahcd->regs->host_control); - admhc_dbg(ahcd,"DMA locked\n"); -} - -static inline void admhc_dma_unlock(struct admhcd *ahcd) -{ - admhc_writel(ahcd, (u32)ahcd->ed_head->dma, &ahcd->regs->hosthead); - admhc_writel(ahcd, ahcd->dma_state, &ahcd->regs->host_control); - admhc_dbg(ahcd,"DMA unlocked\n"); - spin_unlock(ahcd->dma_lock); + admhc_vdbg(ahcd,"DMA disabled\n"); } |