Lines Matching refs:dmamux
62 struct stm32_dmamux_data *dmamux = dev_get_drvdata(dev); in stm32_dmamux_free() local
67 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_free()
69 stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), 0); in stm32_dmamux_free()
70 clear_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_free()
74 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_free()
86 struct stm32_dmamux_data *dmamux = platform_get_drvdata(pdev); in stm32_dmamux_route_allocate() local
97 if (dma_spec->args[0] > dmamux->dmamux_requests) { in stm32_dmamux_route_allocate()
107 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
108 mux->chan_id = find_first_zero_bit(dmamux->dma_inuse, in stm32_dmamux_route_allocate()
109 dmamux->dma_requests); in stm32_dmamux_route_allocate()
111 if (mux->chan_id == dmamux->dma_requests) { in stm32_dmamux_route_allocate()
112 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
117 set_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_route_allocate()
118 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
121 for (i = 1, min = 0, max = dmamux->dma_reqs[i]; in stm32_dmamux_route_allocate()
122 i <= dmamux->dma_reqs[0]; in stm32_dmamux_route_allocate()
123 min += dmamux->dma_reqs[i], max += dmamux->dma_reqs[++i]) in stm32_dmamux_route_allocate()
137 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
140 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
143 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
154 stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), in stm32_dmamux_route_allocate()
162 clear_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_route_allocate()