From: Joe Perches <joe@perches.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: balbi@ti.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2 v2] usb: gadget: net2280: Add support for PLX USB338X
Date: Wed, 14 May 2014 10:59:12 -0700 [thread overview]
Message-ID: <1400090352.30384.19.camel@joe-AO725> (raw)
In-Reply-To: <1400089197-18427-1-git-send-email-ricardo.ribalda@gmail.com>
On Wed, 2014-05-14 at 19:39 +0200, Ricardo Ribalda Delgado wrote:
> This patch adds support for the PLX USB3380 and USB3382.
>
> This driver is based on the driver from the manufacturer.
>
> Since USB338X is register compatible with NET2280, I thought that it
> would be better to include this hardware into net2280 driver.
>
> Manufacturer's driver only supported the USB33X, did not follow the
> Kernel Style and contain some trivial errors. This patch has tried to
> address this issues.
>
> This patch has only been tested on USB338x hardware, but the merge has
> been done trying to not affect the behaviour of NET2280.
trivial notes:
> diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
[]
> @@ -148,6 +155,10 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
> struct net2280_ep *ep;
> u32 max, tmp;
> unsigned long flags;
> + static const u32 ep_bit[9] = { 0, 17, 2, 19, 4, 1, 18, 3, 20 };
[]
> @@ -361,6 +407,56 @@ static void ep_reset (struct net2280_regs __iomem *regs, struct net2280_ep *ep)
[]
> +static void ep_reset_338x(struct net2280_regs __iomem *regs,
> + struct net2280_ep *ep)
> +{
> + u32 tmp, dmastat;
> + static const u32 ep_bit[9] = { 0, 17, 2, 19, 4, 1, 18, 3, 20 };
To avoid duplication, perhaps ep_bit should be
declared static const to the module instead of
declared in multiple functions.
> @@ -874,8 +991,23 @@ net2280_queue (struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
>
> /* kickstart this i/o queue? */
> if (list_empty (&ep->queue) && !ep->stopped) {
> + /* DMA request while EP halted */
> + if (ep->dma
> + && (readl(&ep->regs->ep_rsp) & (1 << CLEAR_ENDPOINT_HALT))
> + && (dev->pdev->vendor == 0x10b5)) {
Generally logical continuations are at the end-of-line like
if (ep->dma &&
(readl(&ep->regs->ep_rsp) & (1 << CLEAR_ENDPOINT_HALT)) &&
(dev->pdev->vendor == 0x10b5)) {
[]
> @@ -1820,7 +2149,122 @@ static void usb_reinit (struct net2280 *dev)
[]
> + if (dev->enhanced_mode) {
> + ep->cfg = &dev->epregs[ne[i]];
> + ep->regs =
> + (struct net2280_ep_regs __iomem
> + *)(((unsigned char *)&dev->epregs[ne[i]]) +
> + ep_reg_addr[i]);
I find this pretty difficult to read.
Temporaries might help.
Or maybe cast ep->cfg like
ep->regs = (struct net2280_ep_regs __iomem *)
((unsigned char *)ep->cfg + ep_reg_addr[i]);
[]
> + /* AA_AB Errata. Issue 4. Workaround for SuperSpeed USB
> + Hot Reset Exit Handshake may Fail in Specific Case using
> + Default Register Settings. Workaround for Enumeration test.
> + */
linux-kernel multi-line comment style is generally:
/*
* comments...
*/
next prev parent reply other threads:[~2014-05-14 17:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 17:39 Ricardo Ribalda Delgado
2014-05-14 17:59 ` Joe Perches [this message]
2014-05-14 19:27 ` Ricardo Ribalda Delgado
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=1400090352.30384.19.camel@joe-AO725 \
--to=joe@perches.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ricardo.ribalda@gmail.com \
/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
all inboxes | Powered by JetHome®