void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd) { unsigned long irq_flags; unsigned int status; spin_lock_irqsave(&msm_dmov_lock, irq_flags); status = readl(DMOV_STATUS(id)); if (list_empty(&ready_commands[id]) && (status & DMOV_STATUS_CMD_PTR_RDY)) { #if 0 if (list_empty(&active_commands[id])) { PRINT_FLOW("msm_dmov_enqueue_cmd(%d), enable interrupt\n", id); writel(DMOV_CONFIG_IRQ_EN, DMOV_CONFIG(id)); } #endif PRINT_IO("msm_dmov_enqueue_cmd(%d), start command, status %x\n", id, status); list_add_tail(&cmd->list, &active_commands[id]); if (!channel_active) enable_irq(INT_ADM_AARM); channel_active |= 1U << id; writel(cmd->cmdptr, DMOV_CMD_PTR(id)); } else { if (list_empty(&active_commands[id])) PRINT_ERROR("msm_dmov_enqueue_cmd(%d), error datamover stalled, status %x\n", id, status); PRINT_IO("msm_dmov_enqueue_cmd(%d), enqueue command, status %x\n", id, status); list_add_tail(&cmd->list, &ready_commands[id]); } spin_unlock_irqrestore(&msm_dmov_lock, irq_flags); }
void MachineQSD8xxx::shutdownDMA() { for (int i=0; i < MSM_DMOV_CHANNEL_COUNT; i++) { uint32 volatile *dmaChannelConfig = (uint32*)memPhysMap(DMOV_CONFIG(i)); *dmaChannelConfig = 0; } }