Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'topic/pl330' into for-linus

+8 -70
-1
arch/arm/plat-samsung/devs.c
··· 10 10 * published by the Free Software Foundation. 11 11 */ 12 12 13 - #include <linux/amba/pl330.h> 14 13 #include <linux/kernel.h> 15 14 #include <linux/types.h> 16 15 #include <linux/interrupt.h>
+8 -34
drivers/dma/pl330.c
··· 22 22 #include <linux/dma-mapping.h> 23 23 #include <linux/dmaengine.h> 24 24 #include <linux/amba/bus.h> 25 - #include <linux/amba/pl330.h> 26 25 #include <linux/scatterlist.h> 27 26 #include <linux/of.h> 28 27 #include <linux/of_dma.h> ··· 2076 2077 } 2077 2078 } 2078 2079 2079 - bool pl330_filter(struct dma_chan *chan, void *param) 2080 - { 2081 - u8 *peri_id; 2082 - 2083 - if (chan->device->dev->driver != &pl330_driver.drv) 2084 - return false; 2085 - 2086 - peri_id = chan->private; 2087 - return *peri_id == (unsigned long)param; 2088 - } 2089 - EXPORT_SYMBOL(pl330_filter); 2090 - 2091 2080 static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, 2092 2081 struct of_dma *ofdma) 2093 2082 { ··· 2820 2833 static int 2821 2834 pl330_probe(struct amba_device *adev, const struct amba_id *id) 2822 2835 { 2823 - struct dma_pl330_platdata *pdat; 2824 2836 struct pl330_config *pcfg; 2825 2837 struct pl330_dmac *pl330; 2826 2838 struct dma_pl330_chan *pch, *_p; ··· 2828 2842 int i, ret, irq; 2829 2843 int num_chan; 2830 2844 struct device_node *np = adev->dev.of_node; 2831 - 2832 - pdat = dev_get_platdata(&adev->dev); 2833 2845 2834 2846 ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32)); 2835 2847 if (ret) ··· 2841 2857 pd = &pl330->ddma; 2842 2858 pd->dev = &adev->dev; 2843 2859 2844 - pl330->mcbufsz = pdat ? pdat->mcbuf_sz : 0; 2860 + pl330->mcbufsz = 0; 2845 2861 2846 2862 /* get quirk */ 2847 2863 for (i = 0; i < ARRAY_SIZE(of_quirks); i++) ··· 2885 2901 INIT_LIST_HEAD(&pd->channels); 2886 2902 2887 2903 /* Initialize channel parameters */ 2888 - if (pdat) 2889 - num_chan = max_t(int, pdat->nr_valid_peri, pcfg->num_chan); 2890 - else 2891 - num_chan = max_t(int, pcfg->num_peri, pcfg->num_chan); 2904 + num_chan = max_t(int, pcfg->num_peri, pcfg->num_chan); 2892 2905 2893 2906 pl330->num_peripherals = num_chan; 2894 2907 ··· 2897 2916 2898 2917 for (i = 0; i < num_chan; i++) { 2899 2918 pch = &pl330->peripherals[i]; 2900 - if (!adev->dev.of_node) 2901 - pch->chan.private = pdat ? &pdat->peri_id[i] : NULL; 2902 - else 2903 - pch->chan.private = adev->dev.of_node; 2904 2919 2920 + pch->chan.private = adev->dev.of_node; 2905 2921 INIT_LIST_HEAD(&pch->submitted_list); 2906 2922 INIT_LIST_HEAD(&pch->work_list); 2907 2923 INIT_LIST_HEAD(&pch->completed_list); ··· 2911 2933 list_add_tail(&pch->chan.device_node, &pd->channels); 2912 2934 } 2913 2935 2914 - if (pdat) { 2915 - pd->cap_mask = pdat->cap_mask; 2916 - } else { 2917 - dma_cap_set(DMA_MEMCPY, pd->cap_mask); 2918 - if (pcfg->num_peri) { 2919 - dma_cap_set(DMA_SLAVE, pd->cap_mask); 2920 - dma_cap_set(DMA_CYCLIC, pd->cap_mask); 2921 - dma_cap_set(DMA_PRIVATE, pd->cap_mask); 2922 - } 2936 + dma_cap_set(DMA_MEMCPY, pd->cap_mask); 2937 + if (pcfg->num_peri) { 2938 + dma_cap_set(DMA_SLAVE, pd->cap_mask); 2939 + dma_cap_set(DMA_CYCLIC, pd->cap_mask); 2940 + dma_cap_set(DMA_PRIVATE, pd->cap_mask); 2923 2941 } 2924 2942 2925 2943 pd->device_alloc_chan_resources = pl330_alloc_chan_resources;
-35
include/linux/amba/pl330.h
··· 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_ */