dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume
authorViresh Kumar <viresh.kumar@st.com>
Thu, 17 Nov 2011 10:31:29 +0000 (15:31 +0530)
committerSimone Willett <swillett@nvidia.com>
Tue, 3 Apr 2012 16:36:18 +0000 (09:36 -0700)
commit1d7e9f1a028573c73380a57285b9af01e3025b23
tree47c32264e45cdc332d7cf1de512811d2139ba298
parentff27e02b2ca48beb0330473427fa8e0be64c15ab
dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume

In S2R all DMA registers are reset by hardware and thus they are required to be
reprogrammed. The channels which aren't reprogrammed are channel configuration
and interrupt enable registers, which are currently programmed at chan_alloc
time.

This patch creates another routine to initialize a channel. It will try to
initialize channel on every dwc_dostart() call. If channel is already
initialised then it simply returns, otherwise it configures registers.

This routine will also initialize registers on wakeup from S2R, as we mark
channels as uninitialized on suspend.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
cherry-picked from mainline 61e183f8306934a9f66557f69f1f0f56f18dca06

Change-Id: I4ede3e1db8844533161bd4a836b1fece0d0ee716
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/93784
Reviewed-by: Automatic_Commit_Validation_User
drivers/dma/dw_dmac.c
drivers/dma/dw_dmac_regs.h