/* Returns current physical destination address for the given DMA channel. If the channel is running the caller must disable interrupts prior calling this function and process the returned value before re-enabling interrupt to prevent races with the interrupt handler. Note that in continuous mode there is a chance for CDSA_L register overflow inbetween the two reads resulting in incorrect return value.  */
dma_addr_t omap_get_dma_dst_pos(int lch)
/* Returns current physical destination address for the given DMA channel. If the channel is running the caller must disable interrupts prior calling this function and process the returned value before re-enabling interrupt to prevent races with the interrupt handler. Note that in continuous mode there is a chance for CDSA_L register overflow inbetween the two reads resulting in incorrect return value.  */
dma_addr_t omap_get_dma_dst_pos(int lch)
{
	dma_addr_t offset = 0;
	if (cpu_is_omap15xx())
		offset = dma_read(CPC(lch));
	else
		offset = dma_read(CDAC(lch));
	if (!cpu_is_omap15xx() && offset == 0)
		offset = dma_read(CDAC(lch));
	if (cpu_class_is_omap1())
		offset |= (dma_read(CDSA_U(lch)) << 16);
	return offset;
}