diff options
-rw-r--r-- | arch/arm/plat-samsung/devs.c | 1 | ||||
-rw-r--r-- | drivers/dma/pl330.c | 42 | ||||
-rw-r--r-- | include/linux/amba/pl330.h | 35 |
3 files changed, 8 insertions, 70 deletions
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 03fac123676d..dc269d9143bc 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -10,7 +10,6 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/amba/pl330.h> | ||
14 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
15 | #include <linux/types.h> | 14 | #include <linux/types.h> |
16 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index f37f4978dabb..8b0da7fa520d 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/dma-mapping.h> | 22 | #include <linux/dma-mapping.h> |
23 | #include <linux/dmaengine.h> | 23 | #include <linux/dmaengine.h> |
24 | #include <linux/amba/bus.h> | 24 | #include <linux/amba/bus.h> |
25 | #include <linux/amba/pl330.h> | ||
26 | #include <linux/scatterlist.h> | 25 | #include <linux/scatterlist.h> |
27 | #include <linux/of.h> | 26 | #include <linux/of.h> |
28 | #include <linux/of_dma.h> | 27 | #include <linux/of_dma.h> |
@@ -2077,18 +2076,6 @@ static void pl330_tasklet(unsigned long data) | |||
2077 | } | 2076 | } |
2078 | } | 2077 | } |
2079 | 2078 | ||
2080 | bool pl330_filter(struct dma_chan *chan, void *param) | ||
2081 | { | ||
2082 | u8 *peri_id; | ||
2083 | |||
2084 | if (chan->device->dev->driver != &pl330_driver.drv) | ||
2085 | return false; | ||
2086 | |||
2087 | peri_id = chan->private; | ||
2088 | return *peri_id == (unsigned long)param; | ||
2089 | } | ||
2090 | EXPORT_SYMBOL(pl330_filter); | ||
2091 | |||
2092 | static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, | 2079 | static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, |
2093 | struct of_dma *ofdma) | 2080 | struct of_dma *ofdma) |
2094 | { | 2081 | { |
@@ -2833,7 +2820,6 @@ static SIMPLE_DEV_PM_OPS(pl330_pm, pl330_suspend, pl330_resume); | |||
2833 | static int | 2820 | static int |
2834 | pl330_probe(struct amba_device *adev, const struct amba_id *id) | 2821 | pl330_probe(struct amba_device *adev, const struct amba_id *id) |
2835 | { | 2822 | { |
2836 | struct dma_pl330_platdata *pdat; | ||
2837 | struct pl330_config *pcfg; | 2823 | struct pl330_config *pcfg; |
2838 | struct pl330_dmac *pl330; | 2824 | struct pl330_dmac *pl330; |
2839 | struct dma_pl330_chan *pch, *_p; | 2825 | struct dma_pl330_chan *pch, *_p; |
@@ -2843,8 +2829,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2843 | int num_chan; | 2829 | int num_chan; |
2844 | struct device_node *np = adev->dev.of_node; | 2830 | struct device_node *np = adev->dev.of_node; |
2845 | 2831 | ||
2846 | pdat = dev_get_platdata(&adev->dev); | ||
2847 | |||
2848 | ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32)); | 2832 | ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32)); |
2849 | if (ret) | 2833 | if (ret) |
2850 | return ret; | 2834 | return ret; |
@@ -2857,7 +2841,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2857 | pd = &pl330->ddma; | 2841 | pd = &pl330->ddma; |
2858 | pd->dev = &adev->dev; | 2842 | pd->dev = &adev->dev; |
2859 | 2843 | ||
2860 | pl330->mcbufsz = pdat ? pdat->mcbuf_sz : 0; | 2844 | pl330->mcbufsz = 0; |
2861 | 2845 | ||
2862 | /* get quirk */ | 2846 | /* get quirk */ |
2863 | for (i = 0; i < ARRAY_SIZE(of_quirks); i++) | 2847 | for (i = 0; i < ARRAY_SIZE(of_quirks); i++) |
@@ -2901,10 +2885,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2901 | INIT_LIST_HEAD(&pd->channels); | 2885 | INIT_LIST_HEAD(&pd->channels); |
2902 | 2886 | ||
2903 | /* Initialize channel parameters */ | 2887 | /* Initialize channel parameters */ |
2904 | if (pdat) | 2888 | num_chan = max_t(int, pcfg->num_peri, pcfg->num_chan); |
2905 | num_chan = max_t(int, pdat->nr_valid_peri, pcfg->num_chan); | ||
2906 | else | ||
2907 | num_chan = max_t(int, pcfg->num_peri, pcfg->num_chan); | ||
2908 | 2889 | ||
2909 | pl330->num_peripherals = num_chan; | 2890 | pl330->num_peripherals = num_chan; |
2910 | 2891 | ||
@@ -2916,11 +2897,8 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2916 | 2897 | ||
2917 | for (i = 0; i < num_chan; i++) { | 2898 | for (i = 0; i < num_chan; i++) { |
2918 | pch = &pl330->peripherals[i]; | 2899 | pch = &pl330->peripherals[i]; |
2919 | if (!adev->dev.of_node) | ||
2920 | pch->chan.private = pdat ? &pdat->peri_id[i] : NULL; | ||
2921 | else | ||
2922 | pch->chan.private = adev->dev.of_node; | ||
2923 | 2900 | ||
2901 | pch->chan.private = adev->dev.of_node; | ||
2924 | INIT_LIST_HEAD(&pch->submitted_list); | 2902 | INIT_LIST_HEAD(&pch->submitted_list); |
2925 | INIT_LIST_HEAD(&pch->work_list); | 2903 | INIT_LIST_HEAD(&pch->work_list); |
2926 | INIT_LIST_HEAD(&pch->completed_list); | 2904 | INIT_LIST_HEAD(&pch->completed_list); |
@@ -2933,15 +2911,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2933 | list_add_tail(&pch->chan.device_node, &pd->channels); | 2911 | list_add_tail(&pch->chan.device_node, &pd->channels); |
2934 | } | 2912 | } |
2935 | 2913 | ||
2936 | if (pdat) { | 2914 | dma_cap_set(DMA_MEMCPY, pd->cap_mask); |
2937 | pd->cap_mask = pdat->cap_mask; | 2915 | if (pcfg->num_peri) { |
2938 | } else { | 2916 | dma_cap_set(DMA_SLAVE, pd->cap_mask); |
2939 | dma_cap_set(DMA_MEMCPY, pd->cap_mask); | 2917 | dma_cap_set(DMA_CYCLIC, pd->cap_mask); |
2940 | if (pcfg->num_peri) { | 2918 | dma_cap_set(DMA_PRIVATE, pd->cap_mask); |
2941 | dma_cap_set(DMA_SLAVE, pd->cap_mask); | ||
2942 | dma_cap_set(DMA_CYCLIC, pd->cap_mask); | ||
2943 | dma_cap_set(DMA_PRIVATE, pd->cap_mask); | ||
2944 | } | ||
2945 | } | 2919 | } |
2946 | 2920 | ||
2947 | pd->device_alloc_chan_resources = pl330_alloc_chan_resources; | 2921 | pd->device_alloc_chan_resources = pl330_alloc_chan_resources; |
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h deleted file mode 100644 index fe93758e8403..000000000000 --- a/include/linux/amba/pl330.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* linux/include/linux/amba/pl330.h | ||
2 | * | ||
3 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
4 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __AMBA_PL330_H_ | ||
13 | #define __AMBA_PL330_H_ | ||
14 | |||
15 | #include <linux/dmaengine.h> | ||
16 | |||
17 | struct dma_pl330_platdata { | ||
18 | /* | ||
19 | * Number of valid peripherals connected to DMAC. | ||
20 | * This may be different from the value read from | ||
21 | * CR0, as the PL330 implementation might have 'holes' | ||
22 | * in the peri list or the peri could also be reached | ||
23 | * from another DMAC which the platform prefers. | ||
24 | */ | ||
25 | u8 nr_valid_peri; | ||
26 | /* Array of valid peripherals */ | ||
27 | u8 *peri_id; | ||
28 | /* Operational capabilities */ | ||
29 | dma_cap_mask_t cap_mask; | ||
30 | /* Bytes to allocate for MC buffer */ | ||
31 | unsigned mcbuf_sz; | ||
32 | }; | ||
33 | |||
34 | extern bool pl330_filter(struct dma_chan *chan, void *param); | ||
35 | #endif /* __AMBA_PL330_H_ */ | ||