History

dmaengine: pl330: remove pdata based initialization

This driver is now used only on platforms which support device tree, so it is safe to remove legacy platform data based initialization code.

Marek Szyprowski committed 9 years ago

Commit e8bb4671 parent c1ae3cf3 files · +8 −70Browse files

Unified · Split

3 files
  1. arch/arm/plat-samsung/devs.c +0 −1
  2. drivers/dma/pl330.c +8 −34
  3. include/linux/amba/pl330.h +0 −35
arch/arm/plat-samsung/devs.c+0−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
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>
drivers/dma/pl330.c+8−34
@@ -22,7 +22,6 @@ · 21 unmodified lines
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) · 2048 unmodified lines
2077 }2076 }
2078}2077}
2079 2078
2080bool 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}
2090EXPORT_SYMBOL(pl330_filter);
2091
2092static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec,2079static 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); · 738 unmodified lines
2833static int2820static int
2834pl330_probe(struct amba_device *adev, const struct amba_id *id)2821pl330_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) · 3 unmodified lines
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) · 6 unmodified lines
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) · 37 unmodified lines
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) · 5 unmodified lines
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) · 6 unmodified lines
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;
include/linux/amba/pl330.h+0−35
@@ -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
17struct 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
34extern bool pl330_filter(struct dma_chan *chan, void *param);
35#endif /* __AMBA_PL330_H_ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t