0390-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. From ef68b1e7c830c23cf87a927474b5e53da14d9bac Mon Sep 17 00:00:00 2001
  2. From: Martin Sperl <kernel@martin.sperl.org>
  3. Date: Fri, 22 Apr 2016 17:17:30 +0000
  4. Subject: [PATCH] Revert "dmaengine: bcm2835: Load driver early and support
  5. legacy API"
  6. This reverts commit 6f56fff39c811953809b011f59c49a2122c4d173.
  7. ---
  8. drivers/dma/Kconfig | 2 +-
  9. drivers/dma/bcm2835-dma.c | 30 ++++++------------------------
  10. 2 files changed, 7 insertions(+), 25 deletions(-)
  11. --- a/drivers/dma/Kconfig
  12. +++ b/drivers/dma/Kconfig
  13. @@ -108,7 +108,7 @@ config COH901318
  14. config DMA_BCM2835
  15. tristate "BCM2835 DMA engine support"
  16. - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
  17. + depends on ARCH_BCM2835
  18. select DMA_ENGINE
  19. select DMA_VIRTUAL_CHANNELS
  20. --- a/drivers/dma/bcm2835-dma.c
  21. +++ b/drivers/dma/bcm2835-dma.c
  22. @@ -36,7 +36,6 @@
  23. #include <linux/interrupt.h>
  24. #include <linux/list.h>
  25. #include <linux/module.h>
  26. -#include <linux/platform_data/dma-bcm2708.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/slab.h>
  29. #include <linux/io.h>
  30. @@ -787,10 +786,6 @@ static int bcm2835_dma_probe(struct plat
  31. if (IS_ERR(base))
  32. return PTR_ERR(base);
  33. - rc = bcm_dmaman_probe(pdev, base, BCM2835_DMA_BULK_MASK);
  34. - if (rc)
  35. - dev_err(&pdev->dev, "Failed to initialize the legacy API\n");
  36. -
  37. od->base = base;
  38. dma_cap_set(DMA_SLAVE, od->ddev.cap_mask);
  39. @@ -823,8 +818,11 @@ static int bcm2835_dma_probe(struct plat
  40. goto err_no_dma;
  41. }
  42. - /* Channel 0 is used by the legacy API */
  43. - chans_available &= ~BCM2835_DMA_BULK_MASK;
  44. + /*
  45. + * Do not use the FIQ and BULK channels,
  46. + * because they are used by the GPU.
  47. + */
  48. + chans_available &= ~(BCM2835_DMA_FIQ_MASK | BCM2835_DMA_BULK_MASK);
  49. for (i = 0; i < pdev->num_resources; i++) {
  50. irq = platform_get_irq(pdev, i);
  51. @@ -868,7 +866,6 @@ static int bcm2835_dma_remove(struct pla
  52. {
  53. struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
  54. - bcm_dmaman_remove(pdev);
  55. dma_async_device_unregister(&od->ddev);
  56. bcm2835_dma_free(od);
  57. @@ -884,22 +881,7 @@ static struct platform_driver bcm2835_dm
  58. },
  59. };
  60. -static int bcm2835_dma_init(void)
  61. -{
  62. - return platform_driver_register(&bcm2835_dma_driver);
  63. -}
  64. -
  65. -static void bcm2835_dma_exit(void)
  66. -{
  67. - platform_driver_unregister(&bcm2835_dma_driver);
  68. -}
  69. -
  70. -/*
  71. - * Load after serial driver (arch_initcall) so we see the messages if it fails,
  72. - * but before drivers (module_init) that need a DMA channel.
  73. - */
  74. -subsys_initcall(bcm2835_dma_init);
  75. -module_exit(bcm2835_dma_exit);
  76. +module_platform_driver(bcm2835_dma_driver);
  77. MODULE_ALIAS("platform:bcm2835-dma");
  78. MODULE_DESCRIPTION("BCM2835 DMA engine driver");