From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kim Phillips Date: Mon, 9 Mar 2009 18:46:20 -0500 Subject: [U-Boot] [PATCH v2] Support for PXA27X UDC. In-Reply-To: <1236604127-11799-1-git-send-email-vivek.kutal@azingo.com> References: <3efb10970903050315y267e13fapb08dda54daaa6c38@mail.gmail.com> <1236604127-11799-1-git-send-email-vivek.kutal@azingo.com> Message-ID: <20090309184620.1a9e84dd.kim.phillips@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 9 Mar 2009 18:38:47 +0530 Vivek Kutal 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