From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 3/4] drivers: musb-new: Add USB DRC driver for Microchip PIC32 OTG controller.
Date: Fri, 18 Mar 2016 15:21:54 +0100 [thread overview]
Message-ID: <56EC0F02.5080503@denx.de> (raw)
In-Reply-To: <1458309016-27459-4-git-send-email-purna.mandal@microchip.com>
On 03/18/2016 02:50 PM, Purna Chandra Mandal wrote:
> This driver adds support of PIC32 MUSB OTG controller as dual role device.
> It implements platform specific glue to reuse musb core.
>
> Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
> Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
>
> ---
>
> Changes in v4:
> - add support to handle multiple MUSB controllers.
> - remove unaligned buffer handling in musb_read_fifo
> - update comment and error prints
Nice, thanks.
> Changes in v3: None
> Changes in v2: None
>
> drivers/usb/musb-new/Kconfig | 7 +
> drivers/usb/musb-new/Makefile | 1 +
> drivers/usb/musb-new/musb_core.c | 2 +-
> drivers/usb/musb-new/pic32.c | 288 +++++++++++++++++++++++++++++++++++++++
> 4 files changed, 297 insertions(+), 1 deletion(-)
> create mode 100644 drivers/usb/musb-new/pic32.c
[...]
> +static irqreturn_t pic32_interrupt(int irq, void *hci)
> +{
> + struct musb *musb = hci;
> + irqreturn_t ret = IRQ_NONE;
> + u32 epintr, usbintr;
> +
> + /* ack usb core interrupts */
> + musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
> + if (musb->int_usb)
> + musb_writeb(musb->mregs, MUSB_INTRUSB, musb->int_usb);
> +
> + /* ack endpoint interrupts */
> + musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX) & PIC32_RX_EP_MASK;
> + if (musb->int_rx)
> + musb_writew(musb->mregs, MUSB_INTRRX, musb->int_rx);
> +
> + musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX) & PIC32_TX_EP_MASK;
> + if (musb->int_tx)
> + musb_writew(musb->mregs, MUSB_INTRTX, musb->int_tx);
> +
> + /* drop spurious RX and TX if device is disconnected */
> + if (musb->int_usb & MUSB_INTR_DISCONNECT) {
> + musb->int_tx = 0;
> + musb->int_rx = 0;
> + }
> +
> + if (musb->int_tx || musb->int_rx || musb->int_usb)
> + ret |= musb_interrupt(musb);
Use ret = , don't ORR the return value as that's wrong and can produce
completely mangled return value.
> + return ret;
> +}
[...]
The rest is good, thanks for persevering :) Please drop me a V5 so I can
apply the series.
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2016-03-18 14:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 13:50 [U-Boot] [PATCH v4 0/4] This series add MUSB support on PIC32MZDA Starter Kit Purna Chandra Mandal
2016-03-18 13:50 ` [U-Boot] [PATCH v4 1/4] arm: add missing writes[bwql], reads[bwql] Purna Chandra Mandal
2016-03-18 13:50 ` [U-Boot] [PATCH v4 2/4] drivers: remove writes{b, w, l, q} and reads{b, w, l, q} Purna Chandra Mandal
2016-03-18 18:03 ` Scott Wood
2016-03-18 13:50 ` [U-Boot] [PATCH v4 3/4] drivers: musb-new: Add USB DRC driver for Microchip PIC32 OTG controller Purna Chandra Mandal
2016-03-18 14:21 ` Marek Vasut [this message]
2016-03-18 13:50 ` [U-Boot] [PATCH v4 4/4] board: pic32mzda: enable USB-host, USB-storage support Purna Chandra Mandal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56EC0F02.5080503@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox