Commit 7a96b784 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Felipe Balbi

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: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent fbdecad9
...@@ -15,7 +15,10 @@ Optional properties: ...@@ -15,7 +15,10 @@ Optional properties:
- phys: phandle + phy specifier pair - phys: phandle + phy specifier pair
- phy-names: must be "usb" - phy-names: must be "usb"
- dmas: Must contain a list of references to DMA specifiers. - dmas: Must contain a list of references to DMA specifiers.
- dma-names : Must contain a list of DMA names, "tx" or "rx". - dma-names : Must contain a list of DMA names:
- tx0 ... tx<n>
- rx0 ... rx<n>
- This <n> means DnFIFO in USBHS module.
Example: Example:
usbhs: usb@e6590000 { usbhs: usb@e6590000 {
......
...@@ -1069,23 +1069,29 @@ static void usbhsf_dma_init_pdev(struct usbhs_fifo *fifo) ...@@ -1069,23 +1069,29 @@ static void usbhsf_dma_init_pdev(struct usbhs_fifo *fifo)
&fifo->rx_slave); &fifo->rx_slave);
} }
static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo) static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo,
int channel)
{ {
fifo->tx_chan = dma_request_slave_channel_reason(dev, "tx"); char name[16];
snprintf(name, sizeof(name), "tx%d", channel);
fifo->tx_chan = dma_request_slave_channel_reason(dev, name);
if (IS_ERR(fifo->tx_chan)) if (IS_ERR(fifo->tx_chan))
fifo->tx_chan = NULL; fifo->tx_chan = NULL;
fifo->rx_chan = dma_request_slave_channel_reason(dev, "rx");
snprintf(name, sizeof(name), "rx%d", channel);
fifo->rx_chan = dma_request_slave_channel_reason(dev, name);
if (IS_ERR(fifo->rx_chan)) if (IS_ERR(fifo->rx_chan))
fifo->rx_chan = NULL; fifo->rx_chan = NULL;
} }
static void usbhsf_dma_init(struct usbhs_priv *priv, static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo,
struct usbhs_fifo *fifo) int channel)
{ {
struct device *dev = usbhs_priv_to_dev(priv); struct device *dev = usbhs_priv_to_dev(priv);
if (dev->of_node) if (dev->of_node)
usbhsf_dma_init_dt(dev, fifo); usbhsf_dma_init_dt(dev, fifo, channel);
else else
usbhsf_dma_init_pdev(fifo); usbhsf_dma_init_pdev(fifo);
...@@ -1231,7 +1237,7 @@ do { \ ...@@ -1231,7 +1237,7 @@ do { \
usbhs_get_dparam(priv, d##channel##_tx_id); \ usbhs_get_dparam(priv, d##channel##_tx_id); \
fifo->rx_slave.shdma_slave.slave_id = \ fifo->rx_slave.shdma_slave.slave_id = \
usbhs_get_dparam(priv, d##channel##_rx_id); \ usbhs_get_dparam(priv, d##channel##_rx_id); \
usbhsf_dma_init(priv, fifo); \ usbhsf_dma_init(priv, fifo, channel); \
} while (0) } while (0)
#define USBHS_DFIFO_INIT(priv, fifo, channel) \ #define USBHS_DFIFO_INIT(priv, fifo, channel) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment