From: Kim Phillips <kim.phillips@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] Support for PXA27X UDC.
Date: Mon, 9 Mar 2009 18:46:20 -0500 [thread overview]
Message-ID: <20090309184620.1a9e84dd.kim.phillips@freescale.com> (raw)
In-Reply-To: <1236604127-11799-1-git-send-email-vivek.kutal@azingo.com>
On Mon, 9 Mar 2009 18:38:47 +0530
Vivek Kutal <vivek.kutal@azingo.com> wrote:
> +#ifdef USBDDBG
> +static void udc_dump_buffer(char *name, u8 *buf, int len)
> +{
> + int i, p, flag = 1;
> +
> + usbdbg("%s - buf %p, len %d", name, buf, len);
> + for (i = p = 0; i < len; i++, p++) {
> + if (p == 0) {
> + flag = 0;
> + usbdbg("\t");
> + }
> +
> + usbdbg("%02x ", buf[i]);
> +
> + if (p == 15) {
> + flag = 1;
> + usbdbg("\n");
> + p = -1;
> + }
> + }
> + if (!flag)
> + usbdbg("\n");
> +}
> +#else
> +#define udc_dump_buffer(name, buf, len) /* void */
> +#endif
can we not reinvent the wheel here and use
lib_generic/display_options.c's print_buffer()?
> +static int udc_write_urb(struct usb_endpoint_instance *endpoint)
> +{
> + struct urb *urb = endpoint->tx_urb;
> + int ep_num = endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK;
> +
no blank line here please.
> + u32 *addr32 = (u32 *) &UDCDN(ep_num),
> + *data32 = (u32 *) urb->buffer;
> + u8 *addr8 = (u8 *) &UDCDN(ep_num),
> + *data8 = (u8 *) urb->buffer;
alignment (or give data* their own entire line).
> + /* Check direction */
> + if (ep0_urb->device_request.bmRequestType &
> + USB_REQ_DIRECTION_MASK == USB_REQ_HOST2DEVICE) {
alignment. Might need to add parens for clarity.
Kim
next prev parent reply other threads:[~2009-03-09 23:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-23 16:05 [U-Boot] [PATCH v2] Support for PXA27X UDC Vivek Kutal
2009-03-05 11:15 ` Remy Bohmer
2009-03-06 11:55 ` Vivek Kutal
2009-03-06 14:26 ` Remy Bohmer
2009-03-09 13:08 ` Vivek Kutal
2009-03-09 23:46 ` Kim Phillips [this message]
2009-03-10 11:20 ` Vivek Kutal
2009-04-03 21:28 ` Wolfgang Denk
2009-04-04 16:04 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-05 8:00 ` Remy Bohmer
2009-04-06 18:46 ` Remy Bohmer
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=20090309184620.1a9e84dd.kim.phillips@freescale.com \
--to=kim.phillips@freescale.com \
--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