internal.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Driver for the Synopsys DesignWare DMA Controller
  4. *
  5. * Copyright (C) 2013 Intel Corporation
  6. */
  7. #ifndef _DMA_DW_INTERNAL_H
  8. #define _DMA_DW_INTERNAL_H
  9. #include <linux/dma/dw.h>
  10. #include "regs.h"
  11. int do_dma_probe(struct dw_dma_chip *chip);
  12. int do_dma_remove(struct dw_dma_chip *chip);
  13. void do_dw_dma_on(struct dw_dma *dw);
  14. void do_dw_dma_off(struct dw_dma *dw);
  15. int do_dw_dma_disable(struct dw_dma_chip *chip);
  16. int do_dw_dma_enable(struct dw_dma_chip *chip);
  17. extern bool dw_dma_filter(struct dma_chan *chan, void *param);
  18. #ifdef CONFIG_ACPI
  19. void dw_dma_acpi_controller_register(struct dw_dma *dw);
  20. void dw_dma_acpi_controller_free(struct dw_dma *dw);
  21. #else /* !CONFIG_ACPI */
  22. static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
  23. static inline void dw_dma_acpi_controller_free(struct dw_dma *dw) {}
  24. #endif /* !CONFIG_ACPI */
  25. struct platform_device;
  26. #ifdef CONFIG_OF
  27. struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev);
  28. void dw_dma_of_controller_register(struct dw_dma *dw);
  29. void dw_dma_of_controller_free(struct dw_dma *dw);
  30. #else
  31. static inline struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev)
  32. {
  33. return NULL;
  34. }
  35. static inline void dw_dma_of_controller_register(struct dw_dma *dw) {}
  36. static inline void dw_dma_of_controller_free(struct dw_dma *dw) {}
  37. #endif
  38. struct dw_dma_chip_pdata {
  39. const struct dw_dma_platform_data *pdata;
  40. int (*probe)(struct dw_dma_chip *chip);
  41. int (*remove)(struct dw_dma_chip *chip);
  42. struct dw_dma_chip *chip;
  43. };
  44. static __maybe_unused const struct dw_dma_chip_pdata dw_dma_chip_pdata = {
  45. .probe = dw_dma_probe,
  46. .remove = dw_dma_remove,
  47. };
  48. static const struct dw_dma_platform_data idma32_pdata = {
  49. .nr_channels = 8,
  50. .chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
  51. .chan_priority = CHAN_PRIORITY_ASCENDING,
  52. .block_size = 131071,
  53. .nr_masters = 1,
  54. .data_width = {4},
  55. .multi_block = {1, 1, 1, 1, 1, 1, 1, 1},
  56. };
  57. static __maybe_unused const struct dw_dma_chip_pdata idma32_chip_pdata = {
  58. .pdata = &idma32_pdata,
  59. .probe = idma32_dma_probe,
  60. .remove = idma32_dma_remove,
  61. };
  62. static const struct dw_dma_platform_data xbar_pdata = {
  63. .nr_channels = 8,
  64. .chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
  65. .chan_priority = CHAN_PRIORITY_ASCENDING,
  66. .block_size = 131071,
  67. .nr_masters = 1,
  68. .data_width = {4},
  69. .quirks = DW_DMA_QUIRK_XBAR_PRESENT,
  70. };
  71. static __maybe_unused const struct dw_dma_chip_pdata xbar_chip_pdata = {
  72. .pdata = &xbar_pdata,
  73. .probe = idma32_dma_probe,
  74. .remove = idma32_dma_remove,
  75. };
  76. #endif /* _DMA_DW_INTERNAL_H */