aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2015-03-12 02:35:18 -0400
committerFelipe Balbi <balbi@ti.com>2015-03-13 11:41:08 -0400
commit7a96b78464bd8ba72c1c3095c543c1402db59e35 (patch)
tree4c86826f2309f4790c8db44dd3c926796284d82b
parentfbdecad99c3f37346ed868fec0c3a9c2809f78e9 (diff)
usb: renesas_usbhs: add the channel number in dma-names
To connect the channel of USB-DMAC to USBHS DnFIFO number, this patch adds this channel/FIFO number in dma-names. Otherwise, this driver needs to add analysis code for device tree. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--Documentation/devicetree/bindings/usb/renesas_usbhs.txt5
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c20
2 files changed, 17 insertions, 8 deletions
diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 61b045b6d50e..dc2a18f0b3a1 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -15,7 +15,10 @@ Optional properties:
15 - phys: phandle + phy specifier pair 15 - phys: phandle + phy specifier pair
16 - phy-names: must be "usb" 16 - phy-names: must be "usb"
17 - dmas: Must contain a list of references to DMA specifiers. 17 - dmas: Must contain a list of references to DMA specifiers.
18 - dma-names : Must contain a list of DMA names, "tx" or "rx". 18 - dma-names : Must contain a list of DMA names:
19 - tx0 ... tx<n>
20 - rx0 ... rx<n>
21 - This <n> means DnFIFO in USBHS module.
19 22
20Example: 23Example:
21 usbhs: usb@e6590000 { 24 usbhs: usb@e6590000 {
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index d891bff39d66..28d10eb432d5 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -1069,23 +1069,29 @@ static void usbhsf_dma_init_pdev(struct usbhs_fifo *fifo)
1069 &fifo->rx_slave); 1069 &fifo->rx_slave);
1070} 1070}
1071 1071
1072static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo) 1072static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo,
1073 int channel)
1073{ 1074{
1074 fifo->tx_chan = dma_request_slave_channel_reason(dev, "tx"); 1075 char name[16];
1076
1077 snprintf(name, sizeof(name), "tx%d", channel);
1078 fifo->tx_chan = dma_request_slave_channel_reason(dev, name);
1075 if (IS_ERR(fifo->tx_chan)) 1079 if (IS_ERR(fifo->tx_chan))
1076 fifo->tx_chan = NULL; 1080 fifo->tx_chan = NULL;
1077 fifo->rx_chan = dma_request_slave_channel_reason(dev, "rx"); 1081
1082 snprintf(name, sizeof(name), "rx%d", channel);
1083 fifo->rx_chan = dma_request_slave_channel_reason(dev, name);
1078 if (IS_ERR(fifo->rx_chan)) 1084 if (IS_ERR(fifo->rx_chan))
1079 fifo->rx_chan = NULL; 1085 fifo->rx_chan = NULL;
1080} 1086}
1081 1087
1082static void usbhsf_dma_init(struct usbhs_priv *priv, 1088static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo,
1083 struct usbhs_fifo *fifo) 1089 int channel)
1084{ 1090{
1085 struct device *dev = usbhs_priv_to_dev(priv); 1091 struct device *dev = usbhs_priv_to_dev(priv);
1086 1092
1087 if (dev->of_node) 1093 if (dev->of_node)
1088 usbhsf_dma_init_dt(dev, fifo); 1094 usbhsf_dma_init_dt(dev, fifo, channel);
1089 else 1095 else
1090 usbhsf_dma_init_pdev(fifo); 1096 usbhsf_dma_init_pdev(fifo);
1091 1097
@@ -1231,7 +1237,7 @@ do { \
1231 usbhs_get_dparam(priv, d##channel##_tx_id); \ 1237 usbhs_get_dparam(priv, d##channel##_tx_id); \
1232 fifo->rx_slave.shdma_slave.slave_id = \ 1238 fifo->rx_slave.shdma_slave.slave_id = \
1233 usbhs_get_dparam(priv, d##channel##_rx_id); \ 1239 usbhs_get_dparam(priv, d##channel##_rx_id); \
1234 usbhsf_dma_init(priv, fifo); \ 1240 usbhsf_dma_init(priv, fifo, channel); \
1235} while (0) 1241} while (0)
1236 1242
1237#define USBHS_DFIFO_INIT(priv, fifo, channel) \ 1243#define USBHS_DFIFO_INIT(priv, fifo, channel) \