Commit 5a294e54 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Felipe Balbi

usb: renesas_usbhs: Revise the binding document about the dma-names

Since the DT should describe the hardware (not the driver limitation),
This patch revises the binding document about the dma-names to change
simple numbering as "ch%d" instead of "tx<n>" and "rx<n>".

Also this patch fixes the actual code of renesas_usbhs driver to handle
the new dma-names.
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 4e39acab
...@@ -15,10 +15,8 @@ Optional properties: ...@@ -15,10 +15,8 @@ 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: - dma-names : named "ch%d", where %d is the channel number ranging from zero
- tx0 ... tx<n> to the number of channels (DnFIFOs) minus one.
- rx0 ... rx<n>
- This <n> means DnFIFO in USBHS module.
Example: Example:
usbhs: usb@e6590000 { usbhs: usb@e6590000 {
......
...@@ -1227,15 +1227,21 @@ static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo, ...@@ -1227,15 +1227,21 @@ static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo,
{ {
char name[16]; char name[16];
snprintf(name, sizeof(name), "tx%d", channel); /*
* To avoid complex handing for DnFIFOs, the driver uses each
* DnFIFO as TX or RX direction (not bi-direction).
* So, the driver uses odd channels for TX, even channels for RX.
*/
snprintf(name, sizeof(name), "ch%d", channel);
if (channel & 1) {
fifo->tx_chan = dma_request_slave_channel_reason(dev, name); 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;
} else {
snprintf(name, sizeof(name), "rx%d", channel);
fifo->rx_chan = dma_request_slave_channel_reason(dev, name); 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, struct usbhs_fifo *fifo, static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo,
......
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