Lines Matching refs:dmamux
64 struct stm32_dmamux_data *dmamux = dev_get_drvdata(dev); in stm32_dmamux_free() local
69 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_free()
71 stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), 0); in stm32_dmamux_free()
72 clear_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_free()
76 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_free()
88 struct stm32_dmamux_data *dmamux = platform_get_drvdata(pdev); in stm32_dmamux_route_allocate() local
99 if (dma_spec->args[0] > dmamux->dmamux_requests) { in stm32_dmamux_route_allocate()
109 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
110 mux->chan_id = find_first_zero_bit(dmamux->dma_inuse, in stm32_dmamux_route_allocate()
111 dmamux->dma_requests); in stm32_dmamux_route_allocate()
113 if (mux->chan_id == dmamux->dma_requests) { in stm32_dmamux_route_allocate()
114 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
119 set_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_route_allocate()
120 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
123 for (i = 1, min = 0, max = dmamux->dma_reqs[i]; in stm32_dmamux_route_allocate()
124 i <= dmamux->dma_reqs[0]; in stm32_dmamux_route_allocate()
125 min += dmamux->dma_reqs[i], max += dmamux->dma_reqs[++i]) in stm32_dmamux_route_allocate()
139 spin_lock_irqsave(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
142 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
145 spin_unlock_irqrestore(&dmamux->lock, flags); in stm32_dmamux_route_allocate()
156 stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), in stm32_dmamux_route_allocate()
164 clear_bit(mux->chan_id, dmamux->dma_inuse); in stm32_dmamux_route_allocate()