0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _DMA_DW_INTERNAL_H
0009 #define _DMA_DW_INTERNAL_H
0010
0011 #include <linux/dma/dw.h>
0012
0013 #include "regs.h"
0014
0015 int do_dma_probe(struct dw_dma_chip *chip);
0016 int do_dma_remove(struct dw_dma_chip *chip);
0017
0018 void do_dw_dma_on(struct dw_dma *dw);
0019 void do_dw_dma_off(struct dw_dma *dw);
0020
0021 int do_dw_dma_disable(struct dw_dma_chip *chip);
0022 int do_dw_dma_enable(struct dw_dma_chip *chip);
0023
0024 extern bool dw_dma_filter(struct dma_chan *chan, void *param);
0025
0026 #ifdef CONFIG_ACPI
0027 void dw_dma_acpi_controller_register(struct dw_dma *dw);
0028 void dw_dma_acpi_controller_free(struct dw_dma *dw);
0029 #else
0030 static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
0031 static inline void dw_dma_acpi_controller_free(struct dw_dma *dw) {}
0032 #endif
0033
0034 struct platform_device;
0035
0036 #ifdef CONFIG_OF
0037 struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev);
0038 void dw_dma_of_controller_register(struct dw_dma *dw);
0039 void dw_dma_of_controller_free(struct dw_dma *dw);
0040 #else
0041 static inline struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev)
0042 {
0043 return NULL;
0044 }
0045 static inline void dw_dma_of_controller_register(struct dw_dma *dw) {}
0046 static inline void dw_dma_of_controller_free(struct dw_dma *dw) {}
0047 #endif
0048
0049 struct dw_dma_chip_pdata {
0050 const struct dw_dma_platform_data *pdata;
0051 int (*probe)(struct dw_dma_chip *chip);
0052 int (*remove)(struct dw_dma_chip *chip);
0053 struct dw_dma_chip *chip;
0054 };
0055
0056 static __maybe_unused const struct dw_dma_chip_pdata dw_dma_chip_pdata = {
0057 .probe = dw_dma_probe,
0058 .remove = dw_dma_remove,
0059 };
0060
0061 static const struct dw_dma_platform_data idma32_pdata = {
0062 .nr_channels = 8,
0063 .chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
0064 .chan_priority = CHAN_PRIORITY_ASCENDING,
0065 .block_size = 131071,
0066 .nr_masters = 1,
0067 .data_width = {4},
0068 .multi_block = {1, 1, 1, 1, 1, 1, 1, 1},
0069 };
0070
0071 static __maybe_unused const struct dw_dma_chip_pdata idma32_chip_pdata = {
0072 .pdata = &idma32_pdata,
0073 .probe = idma32_dma_probe,
0074 .remove = idma32_dma_remove,
0075 };
0076
0077 static const struct dw_dma_platform_data xbar_pdata = {
0078 .nr_channels = 8,
0079 .chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
0080 .chan_priority = CHAN_PRIORITY_ASCENDING,
0081 .block_size = 131071,
0082 .nr_masters = 1,
0083 .data_width = {4},
0084 .quirks = DW_DMA_QUIRK_XBAR_PRESENT,
0085 };
0086
0087 static __maybe_unused const struct dw_dma_chip_pdata xbar_chip_pdata = {
0088 .pdata = &xbar_pdata,
0089 .probe = idma32_dma_probe,
0090 .remove = idma32_dma_remove,
0091 };
0092
0093 #endif