/* See mxs_dma_append() for details on how DMA command blocks must be configured to maintain the expected behavior of the semaphore's value.  */
static int mxs_dma_read_semaphore(int channel)
/* See mxs_dma_append() for details on how DMA command blocks must be configured to maintain the expected behavior of the semaphore's value.  */
static int mxs_dma_read_semaphore(int channel)
{
	struct mxs_apbh_regs *apbh_regs =
		(struct mxs_apbh_regs *)MXS_APBH_BASE;
	uint32_t tmp;
	int ret;
	ret = mxs_dma_validate_chan(channel);
	if (ret)
		return ret;
	tmp = readl(&apbh_regs->ch[channel].hw_apbh_ch_sema);
	tmp &= APBH_CHn_SEMA_PHORE_MASK;
	tmp >>= APBH_CHn_SEMA_PHORE_OFFSET;
	return tmp;
}