brcm2708-gpu-fw: update to latest version
[oweals/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0391-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch
1 From 7d58feb7f06a5e05aa3b99b32b4bba4b927b7b3f 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
7 This reverts commit 6f56fff39c811953809b011f59c49a2122c4d173.
8 ---
9  drivers/dma/Kconfig       |  2 +-
10  drivers/dma/bcm2835-dma.c | 30 ++++++------------------------
11  2 files changed, 7 insertions(+), 25 deletions(-)
12
13 --- a/drivers/dma/Kconfig
14 +++ b/drivers/dma/Kconfig
15 @@ -108,7 +108,7 @@ config COH901318
16  
17  config DMA_BCM2835
18         tristate "BCM2835 DMA engine support"
19 -       depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
20 +       depends on ARCH_BCM2835
21         select DMA_ENGINE
22         select DMA_VIRTUAL_CHANNELS
23  
24 --- a/drivers/dma/bcm2835-dma.c
25 +++ b/drivers/dma/bcm2835-dma.c
26 @@ -36,7 +36,6 @@
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>
33  #include <linux/io.h>
34 @@ -787,10 +786,6 @@ static int bcm2835_dma_probe(struct plat
35         if (IS_ERR(base))
36                 return PTR_ERR(base);
37  
38 -       rc = bcm_dmaman_probe(pdev, base, BCM2835_DMA_BULK_MASK);
39 -       if (rc)
40 -               dev_err(&pdev->dev, "Failed to initialize the legacy API\n");
41 -
42         od->base = base;
43  
44         dma_cap_set(DMA_SLAVE, od->ddev.cap_mask);
45 @@ -823,8 +818,11 @@ static int bcm2835_dma_probe(struct plat
46                 goto err_no_dma;
47         }
48  
49 -       /* Channel 0 is used by the legacy API */
50 -       chans_available &= ~BCM2835_DMA_BULK_MASK;
51 +       /*
52 +        * Do not use the FIQ and BULK channels,
53 +        * because they are used by the GPU.
54 +        */
55 +       chans_available &= ~(BCM2835_DMA_FIQ_MASK | BCM2835_DMA_BULK_MASK);
56  
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
60  {
61         struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
62  
63 -       bcm_dmaman_remove(pdev);
64         dma_async_device_unregister(&od->ddev);
65         bcm2835_dma_free(od);
66  
67 @@ -884,22 +881,7 @@ static struct platform_driver bcm2835_dm
68         },
69  };
70  
71 -static int bcm2835_dma_init(void)
72 -{
73 -       return platform_driver_register(&bcm2835_dma_driver);
74 -}
75 -
76 -static void bcm2835_dma_exit(void)
77 -{
78 -       platform_driver_unregister(&bcm2835_dma_driver);
79 -}
80 -
81 -/*
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.
84 - */
85 -subsys_initcall(bcm2835_dma_init);
86 -module_exit(bcm2835_dma_exit);
87 +module_platform_driver(bcm2835_dma_driver);
88  
89  MODULE_ALIAS("platform:bcm2835-dma");
90  MODULE_DESCRIPTION("BCM2835 DMA engine driver");