Heiko Stuebner | ddeccb8 | 2013-10-08 06:42:10 +0900 | [diff] [blame] | 1 | /* |
| 2 | * S3C24XX DMA handling |
| 3 | * |
| 4 | * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the Free |
| 8 | * Software Foundation; either version 2 of the License, or (at your option) |
| 9 | * any later version. |
| 10 | */ |
| 11 | |
Heiko Stuebner | 1fecf89 | 2013-10-21 05:32:48 +0900 | [diff] [blame] | 12 | /* Helper to encode the source selection constraints for early s3c socs. */ |
| 13 | #define S3C24XX_DMA_CHANREQ(src, chan) ((BIT(3) | src) << chan * 4) |
| 14 | |
Heiko Stuebner | ddeccb8 | 2013-10-08 06:42:10 +0900 | [diff] [blame] | 15 | enum s3c24xx_dma_bus { |
| 16 | S3C24XX_DMA_APB, |
| 17 | S3C24XX_DMA_AHB, |
| 18 | }; |
| 19 | |
| 20 | /** |
| 21 | * @bus: on which bus does the peripheral reside - AHB or APB. |
| 22 | * @handshake: is a handshake with the peripheral necessary |
| 23 | * @chansel: channel selection information, depending on variant; reqsel for |
| 24 | * s3c2443 and later and channel-selection map for earlier SoCs |
| 25 | * see CHANSEL doc in s3c2443-dma.c |
| 26 | */ |
| 27 | struct s3c24xx_dma_channel { |
| 28 | enum s3c24xx_dma_bus bus; |
| 29 | bool handshake; |
| 30 | u16 chansel; |
| 31 | }; |
| 32 | |
Sam Van Den Berge | 34681d8 | 2016-09-22 20:51:15 +0200 | [diff] [blame] | 33 | struct dma_slave_map; |
| 34 | |
Heiko Stuebner | ddeccb8 | 2013-10-08 06:42:10 +0900 | [diff] [blame] | 35 | /** |
| 36 | * struct s3c24xx_dma_platdata - platform specific settings |
| 37 | * @num_phy_channels: number of physical channels |
| 38 | * @channels: array of virtual channel descriptions |
| 39 | * @num_channels: number of virtual channels |
Sam Van Den Berge | 34681d8 | 2016-09-22 20:51:15 +0200 | [diff] [blame] | 40 | * @slave_map: dma slave map matching table |
| 41 | * @slavecnt: number of elements in slave_map |
Heiko Stuebner | ddeccb8 | 2013-10-08 06:42:10 +0900 | [diff] [blame] | 42 | */ |
| 43 | struct s3c24xx_dma_platdata { |
| 44 | int num_phy_channels; |
| 45 | struct s3c24xx_dma_channel *channels; |
| 46 | int num_channels; |
Sam Van Den Berge | 34681d8 | 2016-09-22 20:51:15 +0200 | [diff] [blame] | 47 | const struct dma_slave_map *slave_map; |
| 48 | int slavecnt; |
Heiko Stuebner | ddeccb8 | 2013-10-08 06:42:10 +0900 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | struct dma_chan; |
| 52 | bool s3c24xx_dma_filter(struct dma_chan *chan, void *param); |