struct admhcd {
spinlock_t lock;
- spinlock_t dma_lock;
- u32 dma_state;
/*
* I/O memory used to communicate with the HC (dma-consistent)
#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...) \
#else
# define admhc_vdbg(ahcd, fmt, args...) do { } while (0)
#endif
-#endif
/*-------------------------------------------------------------------------*/
#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 */
}
#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? */
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)
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");
}