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
7 This reverts commit 6f56fff39c811953809b011f59c49a2122c4d173.
9 drivers/dma/Kconfig | 2 +-
10 drivers/dma/bcm2835-dma.c | 30 ++++++------------------------
11 2 files changed, 7 insertions(+), 25 deletions(-)
13 --- a/drivers/dma/Kconfig
14 +++ b/drivers/dma/Kconfig
15 @@ -108,7 +108,7 @@ config COH901318
18 tristate "BCM2835 DMA engine support"
19 - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
20 + depends on ARCH_BCM2835
22 select DMA_VIRTUAL_CHANNELS
24 --- a/drivers/dma/bcm2835-dma.c
25 +++ b/drivers/dma/bcm2835-dma.c
27 #include <linux/interrupt.h>
28 #include <linux/list.h>
29 #include <linux/module.h>
30 -#include <linux/platform_data/dma-bcm2708.h>
31 #include <linux/platform_device.h>
32 #include <linux/slab.h>
34 @@ -787,10 +786,6 @@ static int bcm2835_dma_probe(struct plat
38 - rc = bcm_dmaman_probe(pdev, base, BCM2835_DMA_BULK_MASK);
40 - dev_err(&pdev->dev, "Failed to initialize the legacy API\n");
44 dma_cap_set(DMA_SLAVE, od->ddev.cap_mask);
45 @@ -823,8 +818,11 @@ static int bcm2835_dma_probe(struct plat
49 - /* Channel 0 is used by the legacy API */
50 - chans_available &= ~BCM2835_DMA_BULK_MASK;
52 + * Do not use the FIQ and BULK channels,
53 + * because they are used by the GPU.
55 + chans_available &= ~(BCM2835_DMA_FIQ_MASK | BCM2835_DMA_BULK_MASK);
57 for (i = 0; i < pdev->num_resources; i++) {
58 irq = platform_get_irq(pdev, i);
59 @@ -868,7 +866,6 @@ static int bcm2835_dma_remove(struct pla
61 struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
63 - bcm_dmaman_remove(pdev);
64 dma_async_device_unregister(&od->ddev);
67 @@ -884,22 +881,7 @@ static struct platform_driver bcm2835_dm
71 -static int bcm2835_dma_init(void)
73 - return platform_driver_register(&bcm2835_dma_driver);
76 -static void bcm2835_dma_exit(void)
78 - platform_driver_unregister(&bcm2835_dma_driver);
82 - * Load after serial driver (arch_initcall) so we see the messages if it fails,
83 - * but before drivers (module_init) that need a DMA channel.
85 -subsys_initcall(bcm2835_dma_init);
86 -module_exit(bcm2835_dma_exit);
87 +module_platform_driver(bcm2835_dma_driver);
89 MODULE_ALIAS("platform:bcm2835-dma");
90 MODULE_DESCRIPTION("BCM2835 DMA engine driver");