Lines Matching refs:dmamux
66 struct stm32_dmamux_data *dmamux = dev_get_drvdata(dev); in stm32_dmamux_free() local
71 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_free()
73 stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), 0); in stm32_dmamux_free()
74 clear_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_free()
78 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_free()
90 struct stm32_dmamux_data *dmamux = platform_get_drvdata(pdev); in stm32_dmamux_route_allocate() local
101 if (dma_spec->args[0] > dmamux->dmamux_requests) { in stm32_dmamux_route_allocate()
111 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
112 mux->chan_id = find_first_zero_bit(dmamux->dma_inuse, in stm32_dmamux_route_allocate()
113 dmamux->dma_requests); in stm32_dmamux_route_allocate()
115 if (mux->chan_id == dmamux->dma_requests) { in stm32_dmamux_route_allocate()
116 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
121 set_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_route_allocate()
122 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
125 for (i = 1, min = 0, max = dmamux->dma_reqs[i]; in stm32_dmamux_route_allocate()
126 i <= dmamux->dma_reqs[0]; in stm32_dmamux_route_allocate()
127 min += dmamux->dma_reqs[i], max += dmamux->dma_reqs[++i]) in stm32_dmamux_route_allocate()
141 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
144 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
147 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
158 stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), in stm32_dmamux_route_allocate()
166 clear_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_route_allocate()