aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/usb.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-03 10:31:56 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-23 15:11:51 -0400
commit26955c07dcf3c36b6427e52fec0f725300ca079e (patch)
treeeb6a3ff98566809292403701019bdf1a42e151f1 /arch/arm/mach-ux500/usb.c
parent4f8fc46c797015dddc1d4c76e1b485b57373683b (diff)
dmaengine: ste_dma40: Amalgamate DMA source and destination channel numbers
Devices which utilise DMA use the same device numbers for transmitting and receiving. In this patch we encode the source and destination information into one single attribute. We can subsequently exploit the direction attribute to see which of the transfer directions are being described. This also lessens the burden on platform data. Cc: Dan Williams <djbw@fb.com> Cc: Per Forlin <per.forlin@stericsson.com> Cc: Rabin Vincent <rabin@rab.in> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/usb.c')
-rw-r--r--arch/arm/mach-ux500/usb.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c
index 2dfc72f7cd8a..45af3031dfef 100644
--- a/arch/arm/mach-ux500/usb.c
+++ b/arch/arm/mach-ux500/usb.c
@@ -15,7 +15,6 @@
15#define MUSB_DMA40_RX_CH { \ 15#define MUSB_DMA40_RX_CH { \
16 .mode = STEDMA40_MODE_LOGICAL, \ 16 .mode = STEDMA40_MODE_LOGICAL, \
17 .dir = STEDMA40_PERIPH_TO_MEM, \ 17 .dir = STEDMA40_PERIPH_TO_MEM, \
18 .dst_dev_type = STEDMA40_DEV_DST_MEMORY, \
19 .src_info.data_width = STEDMA40_WORD_WIDTH, \ 18 .src_info.data_width = STEDMA40_WORD_WIDTH, \
20 .dst_info.data_width = STEDMA40_WORD_WIDTH, \ 19 .dst_info.data_width = STEDMA40_WORD_WIDTH, \
21 .src_info.psize = STEDMA40_PSIZE_LOG_16, \ 20 .src_info.psize = STEDMA40_PSIZE_LOG_16, \
@@ -25,7 +24,6 @@
25#define MUSB_DMA40_TX_CH { \ 24#define MUSB_DMA40_TX_CH { \
26 .mode = STEDMA40_MODE_LOGICAL, \ 25 .mode = STEDMA40_MODE_LOGICAL, \
27 .dir = STEDMA40_MEM_TO_PERIPH, \ 26 .dir = STEDMA40_MEM_TO_PERIPH, \
28 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, \
29 .src_info.data_width = STEDMA40_WORD_WIDTH, \ 27 .src_info.data_width = STEDMA40_WORD_WIDTH, \
30 .dst_info.data_width = STEDMA40_WORD_WIDTH, \ 28 .dst_info.data_width = STEDMA40_WORD_WIDTH, \
31 .src_info.psize = STEDMA40_PSIZE_LOG_16, \ 29 .src_info.psize = STEDMA40_PSIZE_LOG_16, \
@@ -125,20 +123,20 @@ struct platform_device ux500_musb_device = {
125 .resource = usb_resources, 123 .resource = usb_resources,
126}; 124};
127 125
128static inline void ux500_usb_dma_update_rx_ch_config(int *src_dev_type) 126static inline void ux500_usb_dma_update_rx_ch_config(int *dev_type)
129{ 127{
130 u32 idx; 128 u32 idx;
131 129
132 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++) 130 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++)
133 musb_dma_rx_ch[idx].src_dev_type = src_dev_type[idx]; 131 musb_dma_rx_ch[idx].dev_type = dev_type[idx];
134} 132}
135 133
136static inline void ux500_usb_dma_update_tx_ch_config(int *dst_dev_type) 134static inline void ux500_usb_dma_update_tx_ch_config(int *dev_type)
137{ 135{
138 u32 idx; 136 u32 idx;
139 137
140 for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++) 138 for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++)
141 musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx]; 139 musb_dma_tx_ch[idx].dev_type = dev_type[idx];
142} 140}
143 141
144void ux500_add_usb(struct device *parent, resource_size_t base, int irq, 142void ux500_add_usb(struct device *parent, resource_size_t base, int irq,