usb: renesas_usbhs: add support for requesting DT DMA
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 19 Jan 2015 03:53:17 +0000 (12:53 +0900)
committerFelipe Balbi <balbi@ti.com>
Tue, 27 Jan 2015 15:34:58 +0000 (09:34 -0600)
This patch adds dma_request_slave_channel_reason() calling to request
dma slave channels for multiplatform environment.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Documentation/devicetree/bindings/usb/renesas_usbhs.txt
drivers/usb/renesas_usbhs/fifo.c

index b08c903f866853747e58de898141bc10d85d4fda..61b045b6d50e56ae139b31468f2b95f85e8f1651 100644 (file)
@@ -14,6 +14,8 @@ Optional properties:
                         function should be enabled
   - phys: phandle + phy specifier pair
   - phy-names: must be "usb"
+  - dmas: Must contain a list of references to DMA specifiers.
+  - dma-names : Must contain a list of DMA names, "tx" or "rx".
 
 Example:
        usbhs: usb@e6590000 {
index 48e31b94313d3531e0ea9ded20e942a6c9d5f930..4c086b1cda0495daa110ffb741f1ba8865015046 100644 (file)
@@ -1069,12 +1069,21 @@ static void usbhsf_dma_init_pdev(struct usbhs_fifo *fifo)
                                            &fifo->rx_slave);
 }
 
+static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo)
+{
+       fifo->tx_chan = dma_request_slave_channel_reason(dev, "tx");
+       fifo->rx_chan = dma_request_slave_channel_reason(dev, "rx");
+}
+
 static void usbhsf_dma_init(struct usbhs_priv *priv,
                            struct usbhs_fifo *fifo)
 {
        struct device *dev = usbhs_priv_to_dev(priv);
 
-       usbhsf_dma_init_pdev(fifo);
+       if (dev->of_node)
+               usbhsf_dma_init_dt(dev, fifo);
+       else
+               usbhsf_dma_init_pdev(fifo);
 
        if (fifo->tx_chan || fifo->rx_chan)
                dev_dbg(dev, "enable DMAEngine (%s%s%s)\n",