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