/* For P->M transfers, disable the peripheral first to stop it filling the DMAC FIFO, and then pause the DMAC.  */
static void pl08x_pause_phy_chan(struct pl08x_phy_chan *ch)
/* For P->M transfers, disable the peripheral first to stop it filling the DMAC FIFO, and then pause the DMAC.  */
static void pl08x_pause_phy_chan(struct pl08x_phy_chan *ch)
{
	u32 val;
	int timeout;
	val = readl(ch->base + PL080_CH_CONFIG);
	val |= PL080_CONFIG_HALT;
	writel(val, ch->base + PL080_CH_CONFIG);
	for (timeout = 1000; timeout; timeout--) {
		if (!pl08x_phy_channel_busy(ch))
			break;
		udelay(1);
	}
	if (pl08x_phy_channel_busy(ch))
		pr_err("pl08x: channel%u timeout waiting for pause\n", ch->id);
}