Lines Matching refs:dwc
36 static unsigned int idma32_get_slave_devfn(struct dw_dma_chan *dwc) in idma32_get_slave_devfn() argument
38 struct device *slave = dwc->chan.slave; in idma32_get_slave_devfn()
46 static void idma32_initialize_chan_xbar(struct dw_dma_chan *dwc) in idma32_initialize_chan_xbar() argument
48 struct dw_dma *dw = to_dw_dma(dwc->chan.device); in idma32_initialize_chan_xbar()
58 value |= dwc->chan.chan_id; in idma32_initialize_chan_xbar()
63 value = readl(misc + DMA_CTL_CH(dwc->chan.chan_id)); in idma32_initialize_chan_xbar()
69 switch (dwc->direction) { in idma32_initialize_chan_xbar()
88 writel(value, misc + DMA_CTL_CH(dwc->chan.chan_id)); in idma32_initialize_chan_xbar()
91 value = readl(misc + DMA_XBAR_SEL(dwc->chan.chan_id)); in idma32_initialize_chan_xbar()
95 value |= idma32_get_slave_devfn(dwc); in idma32_initialize_chan_xbar()
97 switch (dwc->direction) { in idma32_initialize_chan_xbar()
109 writel(value, misc + DMA_XBAR_SEL(dwc->chan.chan_id)); in idma32_initialize_chan_xbar()
112 switch (dwc->direction) { in idma32_initialize_chan_xbar()
114 dst_id = dwc->chan.chan_id; in idma32_initialize_chan_xbar()
115 src_id = dwc->dws.src_id; in idma32_initialize_chan_xbar()
118 dst_id = dwc->dws.dst_id; in idma32_initialize_chan_xbar()
119 src_id = dwc->chan.chan_id; in idma32_initialize_chan_xbar()
137 channel_writel(dwc, CFG_LO, cfglo); in idma32_initialize_chan_xbar()
138 channel_writel(dwc, CFG_HI, cfghi); in idma32_initialize_chan_xbar()
141 static void idma32_initialize_chan_generic(struct dw_dma_chan *dwc) in idma32_initialize_chan_generic() argument
150 cfghi |= IDMA32C_CFGH_DST_PER(dwc->dws.dst_id & 0xf); in idma32_initialize_chan_generic()
151 cfghi |= IDMA32C_CFGH_SRC_PER(dwc->dws.src_id & 0xf); in idma32_initialize_chan_generic()
154 cfghi |= IDMA32C_CFGH_DST_PER_EXT(dwc->dws.dst_id >> 4 & 0x3); in idma32_initialize_chan_generic()
155 cfghi |= IDMA32C_CFGH_SRC_PER_EXT(dwc->dws.src_id >> 4 & 0x3); in idma32_initialize_chan_generic()
157 channel_writel(dwc, CFG_LO, cfglo); in idma32_initialize_chan_generic()
158 channel_writel(dwc, CFG_HI, cfghi); in idma32_initialize_chan_generic()
161 static void idma32_suspend_chan(struct dw_dma_chan *dwc, bool drain) in idma32_suspend_chan() argument
163 u32 cfglo = channel_readl(dwc, CFG_LO); in idma32_suspend_chan()
168 channel_writel(dwc, CFG_LO, cfglo | DWC_CFGL_CH_SUSP); in idma32_suspend_chan()
171 static void idma32_resume_chan(struct dw_dma_chan *dwc, bool drain) in idma32_resume_chan() argument
173 u32 cfglo = channel_readl(dwc, CFG_LO); in idma32_resume_chan()
178 channel_writel(dwc, CFG_LO, cfglo & ~DWC_CFGL_CH_SUSP); in idma32_resume_chan()
181 static u32 idma32_bytes2block(struct dw_dma_chan *dwc, in idma32_bytes2block() argument
186 if (bytes > dwc->block_size) { in idma32_bytes2block()
187 block = dwc->block_size; in idma32_bytes2block()
188 *len = dwc->block_size; in idma32_bytes2block()
197 static size_t idma32_block2bytes(struct dw_dma_chan *dwc, u32 block, u32 width) in idma32_block2bytes() argument
202 static u32 idma32_prepare_ctllo(struct dw_dma_chan *dwc) in idma32_prepare_ctllo() argument
204 struct dma_slave_config *sconfig = &dwc->dma_sconfig; in idma32_prepare_ctllo()
205 u8 smsize = (dwc->direction == DMA_DEV_TO_MEM) ? sconfig->src_maxburst : 0; in idma32_prepare_ctllo()
206 u8 dmsize = (dwc->direction == DMA_MEM_TO_DEV) ? sconfig->dst_maxburst : 0; in idma32_prepare_ctllo()
212 static void idma32_encode_maxburst(struct dw_dma_chan *dwc, u32 *maxburst) in idma32_encode_maxburst() argument