aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2015-12-09 03:18:10 -0500
committerVinod Koul <vinod.koul@intel.com>2015-12-09 22:01:10 -0500
commitecb7deceff2a51d3be50518969bc06411f485a62 (patch)
tree84152d7383723f36d7446a350537e6bc0bfbc63e
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
dmaengine: edma: DT: Change memcpy channel array from 16bit to 32bit type
This change makes the DT file to be easier to read since the memcpy channels array does not need the '/bits/ 16' to be specified, which might confuse some people. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--Documentation/devicetree/bindings/dma/ti-edma.txt5
-rw-r--r--drivers/dma/edma.c22
-rw-r--r--include/linux/platform_data/edma.h2
3 files changed, 13 insertions, 16 deletions
diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt b/Documentation/devicetree/bindings/dma/ti-edma.txt
index d3d0a4fb1c73..ae8b8f1d6e69 100644
--- a/Documentation/devicetree/bindings/dma/ti-edma.txt
+++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
@@ -22,8 +22,7 @@ Required properties:
22Optional properties: 22Optional properties:
23- ti,hwmods: Name of the hwmods associated to the eDMA CC 23- ti,hwmods: Name of the hwmods associated to the eDMA CC
24- ti,edma-memcpy-channels: List of channels allocated to be used for memcpy, iow 24- ti,edma-memcpy-channels: List of channels allocated to be used for memcpy, iow
25 these channels will be SW triggered channels. The list must 25 these channels will be SW triggered channels. See example.
26 contain 16 bits numbers, see example.
27- ti,edma-reserved-slot-ranges: PaRAM slot ranges which should not be used by 26- ti,edma-reserved-slot-ranges: PaRAM slot ranges which should not be used by
28 the driver, they are allocated to be used by for example the 27 the driver, they are allocated to be used by for example the
29 DSP. See example. 28 DSP. See example.
@@ -56,7 +55,7 @@ edma: edma@49000000 {
56 ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 7>, <&edma_tptc2 0>; 55 ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 7>, <&edma_tptc2 0>;
57 56
58 /* Channel 20 and 21 is allocated for memcpy */ 57 /* Channel 20 and 21 is allocated for memcpy */
59 ti,edma-memcpy-channels = /bits/ 16 <20 21>; 58 ti,edma-memcpy-channels = <20 21>;
60 /* The following PaRAM slots are reserved: 35-45 and 100-110 */ 59 /* The following PaRAM slots are reserved: 35-45 and 100-110 */
61 ti,edma-reserved-slot-ranges = /bits/ 16 <35 10>, 60 ti,edma-reserved-slot-ranges = /bits/ 16 <35 10>,
62 /bits/ 16 <100 10>; 61 /bits/ 16 <100 10>;
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 6b03e4e84e6b..3da20291db56 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -1752,16 +1752,14 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
1752 return ret; 1752 return ret;
1753} 1753}
1754 1754
1755static bool edma_is_memcpy_channel(int ch_num, u16 *memcpy_channels) 1755static bool edma_is_memcpy_channel(int ch_num, s32 *memcpy_channels)
1756{ 1756{
1757 s16 *memcpy_ch = memcpy_channels;
1758
1759 if (!memcpy_channels) 1757 if (!memcpy_channels)
1760 return false; 1758 return false;
1761 while (*memcpy_ch != -1) { 1759 while (*memcpy_channels != -1) {
1762 if (*memcpy_ch == ch_num) 1760 if (*memcpy_channels == ch_num)
1763 return true; 1761 return true;
1764 memcpy_ch++; 1762 memcpy_channels++;
1765 } 1763 }
1766 return false; 1764 return false;
1767} 1765}
@@ -1775,7 +1773,7 @@ static void edma_dma_init(struct edma_cc *ecc, bool legacy_mode)
1775{ 1773{
1776 struct dma_device *s_ddev = &ecc->dma_slave; 1774 struct dma_device *s_ddev = &ecc->dma_slave;
1777 struct dma_device *m_ddev = NULL; 1775 struct dma_device *m_ddev = NULL;
1778 s16 *memcpy_channels = ecc->info->memcpy_channels; 1776 s32 *memcpy_channels = ecc->info->memcpy_channels;
1779 int i, j; 1777 int i, j;
1780 1778
1781 dma_cap_zero(s_ddev->cap_mask); 1779 dma_cap_zero(s_ddev->cap_mask);
@@ -1996,16 +1994,16 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
1996 prop = of_find_property(dev->of_node, "ti,edma-memcpy-channels", &sz); 1994 prop = of_find_property(dev->of_node, "ti,edma-memcpy-channels", &sz);
1997 if (prop) { 1995 if (prop) {
1998 const char pname[] = "ti,edma-memcpy-channels"; 1996 const char pname[] = "ti,edma-memcpy-channels";
1999 size_t nelm = sz / sizeof(s16); 1997 size_t nelm = sz / sizeof(s32);
2000 s16 *memcpy_ch; 1998 s32 *memcpy_ch;
2001 1999
2002 memcpy_ch = devm_kcalloc(dev, nelm + 1, sizeof(s16), 2000 memcpy_ch = devm_kcalloc(dev, nelm + 1, sizeof(s32),
2003 GFP_KERNEL); 2001 GFP_KERNEL);
2004 if (!memcpy_ch) 2002 if (!memcpy_ch)
2005 return ERR_PTR(-ENOMEM); 2003 return ERR_PTR(-ENOMEM);
2006 2004
2007 ret = of_property_read_u16_array(dev->of_node, pname, 2005 ret = of_property_read_u32_array(dev->of_node, pname,
2008 (u16 *)memcpy_ch, nelm); 2006 (u32 *)memcpy_ch, nelm);
2009 if (ret) 2007 if (ret)
2010 return ERR_PTR(ret); 2008 return ERR_PTR(ret);
2011 2009
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
index e2878baeb90e..4299f4ba03bd 100644
--- a/include/linux/platform_data/edma.h
+++ b/include/linux/platform_data/edma.h
@@ -72,7 +72,7 @@ struct edma_soc_info {
72 struct edma_rsv_info *rsv; 72 struct edma_rsv_info *rsv;
73 73
74 /* List of channels allocated for memcpy, terminated with -1 */ 74 /* List of channels allocated for memcpy, terminated with -1 */
75 s16 *memcpy_channels; 75 s32 *memcpy_channels;
76 76
77 s8 (*queue_priority_mapping)[2]; 77 s8 (*queue_priority_mapping)[2];
78 const s16 (*xbar_chans)[2]; 78 const s16 (*xbar_chans)[2];