diff mbox

[3/4] usb: renesas_usbhs: add a new macro for extending DnFIFOs

Message ID 1415617367-3828-4-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Awaiting Upstream
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Yoshihiro Shimoda Nov. 10, 2014, 11:02 a.m. UTC
To extend DnFIFOs in the future, this patch adds a new macro because
some SoCs don't the "port" address for DnFIFOs.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/usb/renesas_usbhs/fifo.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 6c775b7..bc9a050 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -1201,11 +1201,11 @@  void usbhs_fifo_quit(struct usbhs_priv *priv)
 	mod->irq_brdysts	= 0;
 }
 
-#define USBHS_DFIFO_INIT(priv, fifo, channel)				\
+#define __USBHS_DFIFO_INIT(priv, fifo, channel, fifo_port)		\
 do {									\
 	fifo = usbhsf_get_dnfifo(priv, channel);			\
 	fifo->name	= "D"#channel"FIFO";				\
-	fifo->port	= D##channel##FIFO;				\
+	fifo->port	= fifo_port;					\
 	fifo->sel	= D##channel##FIFOSEL;				\
 	fifo->ctr	= D##channel##FIFOCTR;				\
 	fifo->tx_slave.shdma_slave.slave_id =				\
@@ -1215,6 +1215,11 @@  do {									\
 	usbhsf_dma_init(priv, fifo);					\
 } while (0)
 
+#define USBHS_DFIFO_INIT(priv, fifo, channel)				\
+		__USBHS_DFIFO_INIT(priv, fifo, channel, D##channel##FIFO)
+#define USBHS_DFIFO_INIT_NO_PORT(priv, fifo, channel)			\
+		__USBHS_DFIFO_INIT(priv, fifo, channel, 0)
+
 int usbhs_fifo_probe(struct usbhs_priv *priv)
 {
 	struct usbhs_fifo *fifo;