forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/dma/dw/internal.h
....@@ -1,11 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Driver for the Synopsys DesignWare DMA Controller
34 *
45 * Copyright (C) 2013 Intel Corporation
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 */
107
118 #ifndef _DMA_DW_INTERNAL_H
....@@ -15,9 +12,66 @@
1512
1613 #include "regs.h"
1714
18
-int dw_dma_disable(struct dw_dma_chip *chip);
19
-int dw_dma_enable(struct dw_dma_chip *chip);
15
+int do_dma_probe(struct dw_dma_chip *chip);
16
+int do_dma_remove(struct dw_dma_chip *chip);
17
+
18
+void do_dw_dma_on(struct dw_dma *dw);
19
+void do_dw_dma_off(struct dw_dma *dw);
20
+
21
+int do_dw_dma_disable(struct dw_dma_chip *chip);
22
+int do_dw_dma_enable(struct dw_dma_chip *chip);
2023
2124 extern bool dw_dma_filter(struct dma_chan *chan, void *param);
2225
26
+#ifdef CONFIG_ACPI
27
+void dw_dma_acpi_controller_register(struct dw_dma *dw);
28
+void dw_dma_acpi_controller_free(struct dw_dma *dw);
29
+#else /* !CONFIG_ACPI */
30
+static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
31
+static inline void dw_dma_acpi_controller_free(struct dw_dma *dw) {}
32
+#endif /* !CONFIG_ACPI */
33
+
34
+struct platform_device;
35
+
36
+#ifdef CONFIG_OF
37
+struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev);
38
+void dw_dma_of_controller_register(struct dw_dma *dw);
39
+void dw_dma_of_controller_free(struct dw_dma *dw);
40
+#else
41
+static inline struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev)
42
+{
43
+ return NULL;
44
+}
45
+static inline void dw_dma_of_controller_register(struct dw_dma *dw) {}
46
+static inline void dw_dma_of_controller_free(struct dw_dma *dw) {}
47
+#endif
48
+
49
+struct dw_dma_chip_pdata {
50
+ const struct dw_dma_platform_data *pdata;
51
+ int (*probe)(struct dw_dma_chip *chip);
52
+ int (*remove)(struct dw_dma_chip *chip);
53
+ struct dw_dma_chip *chip;
54
+};
55
+
56
+static __maybe_unused const struct dw_dma_chip_pdata dw_dma_chip_pdata = {
57
+ .probe = dw_dma_probe,
58
+ .remove = dw_dma_remove,
59
+};
60
+
61
+static const struct dw_dma_platform_data idma32_pdata = {
62
+ .nr_channels = 8,
63
+ .chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
64
+ .chan_priority = CHAN_PRIORITY_ASCENDING,
65
+ .block_size = 131071,
66
+ .nr_masters = 1,
67
+ .data_width = {4},
68
+ .multi_block = {1, 1, 1, 1, 1, 1, 1, 1},
69
+};
70
+
71
+static __maybe_unused const struct dw_dma_chip_pdata idma32_chip_pdata = {
72
+ .pdata = &idma32_pdata,
73
+ .probe = idma32_dma_probe,
74
+ .remove = idma32_dma_remove,
75
+};
76
+
2377 #endif /* _DMA_DW_INTERNAL_H */