void free_dma(unsigned int channel)
{
-
pr_debug("freedma() : BEGIN \n");
BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
&& channel < MAX_BLACKFIN_DMA_CHANNEL));
void dma_enable_irq(unsigned int channel)
{
pr_debug("dma_enable_irq() : BEGIN \n");
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
enable_irq(dma_ch[channel].irq);
}
EXPORT_SYMBOL(dma_enable_irq);
void dma_disable_irq(unsigned int channel)
{
pr_debug("dma_disable_irq() : BEGIN \n");
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
disable_irq(dma_ch[channel].irq);
}
EXPORT_SYMBOL(dma_disable_irq);
void disable_dma(unsigned int channel)
{
pr_debug("stop_dma() : BEGIN \n");
-
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->cfg &= ~DMAEN; /* Clean the enable bit */
SSYNC();
dma_ch[channel].chan_status = DMA_CHANNEL_REQUESTED;
void enable_dma(unsigned int channel)
{
pr_debug("enable_dma() : BEGIN \n");
-
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].chan_status = DMA_CHANNEL_ENABLED;
dma_ch[channel].regs->curr_x_count = 0;
dma_ch[channel].regs->curr_y_count = 0;
void set_dma_start_addr(unsigned int channel, unsigned long addr)
{
pr_debug("set_dma_start_addr() : BEGIN \n");
-
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->start_addr = addr;
pr_debug("set_dma_start_addr() : END\n");
}
void set_dma_next_desc_addr(unsigned int channel, unsigned long addr)
{
pr_debug("set_dma_next_desc_addr() : BEGIN \n");
-
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->next_desc_ptr = addr;
pr_debug("set_dma_next_desc_addr() : END\n");
}
void set_dma_curr_desc_addr(unsigned int channel, unsigned long addr)
{
pr_debug("set_dma_curr_desc_addr() : BEGIN \n");
-
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->curr_desc_ptr = addr;
pr_debug("set_dma_curr_desc_addr() : END\n");
}
void set_dma_x_count(unsigned int channel, unsigned short x_count)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->x_count = x_count;
}
EXPORT_SYMBOL(set_dma_x_count);
void set_dma_y_count(unsigned int channel, unsigned short y_count)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->y_count = y_count;
}
EXPORT_SYMBOL(set_dma_y_count);
void set_dma_x_modify(unsigned int channel, short x_modify)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->x_modify = x_modify;
}
EXPORT_SYMBOL(set_dma_x_modify);
void set_dma_y_modify(unsigned int channel, short y_modify)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->y_modify = y_modify;
}
EXPORT_SYMBOL(set_dma_y_modify);
void set_dma_config(unsigned int channel, unsigned short config)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->cfg = config;
-
}
EXPORT_SYMBOL(set_dma_config);
void set_dma_sg(unsigned int channel, struct dmasg *sg, int nr_sg)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->cfg |= ((nr_sg & 0x0F) << 8);
-
dma_ch[channel].regs->next_desc_ptr = (unsigned int)sg;
}
EXPORT_SYMBOL(set_dma_sg);
void set_dma_curr_addr(unsigned int channel, unsigned long addr)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
dma_ch[channel].regs->curr_addr_ptr = addr;
}
EXPORT_SYMBOL(set_dma_curr_addr);
*-----------------------------------------------------------------------------*/
unsigned short get_dma_curr_irqstat(unsigned int channel)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
return dma_ch[channel].regs->irq_status;
}
EXPORT_SYMBOL(get_dma_curr_irqstat);
*-----------------------------------------------------------------------------*/
void clear_dma_irqstat(unsigned int channel)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
dma_ch[channel].regs->irq_status |= 3;
}
EXPORT_SYMBOL(clear_dma_irqstat);
*-----------------------------------------------------------------------------*/
unsigned short get_dma_curr_xcount(unsigned int channel)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
return dma_ch[channel].regs->curr_x_count;
}
EXPORT_SYMBOL(get_dma_curr_xcount);
*-----------------------------------------------------------------------------*/
unsigned short get_dma_curr_ycount(unsigned int channel)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
return dma_ch[channel].regs->curr_y_count;
}
EXPORT_SYMBOL(get_dma_curr_ycount);
unsigned long get_dma_next_desc_ptr(unsigned int channel)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
return dma_ch[channel].regs->next_desc_ptr;
}
EXPORT_SYMBOL(get_dma_next_desc_ptr);
unsigned long get_dma_curr_desc_ptr(unsigned int channel)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
return dma_ch[channel].regs->curr_desc_ptr;
}
EXPORT_SYMBOL(get_dma_curr_desc_ptr);
unsigned long get_dma_curr_addr(unsigned int channel)
{
- BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
- && channel < MAX_BLACKFIN_DMA_CHANNEL));
-
return dma_ch[channel].regs->curr_addr_ptr;
}
EXPORT_SYMBOL(get_dma_curr_addr);