On Thu, Nov 18, 2010 at 05:28:16AM +0800, Greg KH wrote: > On Tue, Nov 16, 2010 at 01:24:07PM +0800, andy.luo wrote: > > This patch adds test mode support for Langwell gadget driver. > > > > Change-Id: Icaf402c0afd497265c53a81af6f691fb81181ed4 > > That is not a valid field for a kernel patch, please remove it. Also, > where in the world did it come from? oops, will pay more attention about it. > > Signed-off-by: Henry Yuan <hang.yuan@xxxxxxxxx> > > Signed-off-by: Andy Luo <yifei.luo@xxxxxxxxx> > > --- > > drivers/usb/gadget/langwell_udc.c | 23 +++++++++++++++++++++++ > > 1 files changed, 23 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c > > index 0a9348b..507e79d 100644 > > --- a/drivers/usb/gadget/langwell_udc.c > > +++ b/drivers/usb/gadget/langwell_udc.c > > @@ -2263,6 +2263,7 @@ static void handle_setup_packet(struct langwell_udc *dev, > > u16 wValue = le16_to_cpu(setup->wValue); > > u16 wIndex = le16_to_cpu(setup->wIndex); > > u16 wLength = le16_to_cpu(setup->wLength); > > + u32 portsc1; > > > > dev_vdbg(&dev->pdev->dev, "---> %s()\n", __func__); > > > > @@ -2363,6 +2364,28 @@ static void handle_setup_packet(struct langwell_udc *dev, > > dev->gadget.a_alt_hnp_support = 1; > > dev->dev_status |= (1 << wValue); > > break; > > + case USB_DEVICE_TEST_MODE: > > + dev_dbg(&dev->pdev->dev, "SETUP: TEST MODE\n"); > > + if ((wIndex & 0xff) || > > + (dev->gadget.speed != USB_SPEED_HIGH)) > > + ep0_stall(dev); > > + > > + switch (wIndex >> 8) { > > + case 1: > > + case 2: > > + case 3: > > + case 4: > > + case 5: > > What do these values mean? I will define some macros in "ch9.h" for clarifing these meanings. > > + if (prime_status_phase(dev, EP_DIR_IN)) > > + ep0_stall(dev); > > + portsc1 = readl(&dev->op_regs->portsc1); > > + portsc1 |= (wIndex & 0xf00) << 8; > > + writel(portsc1, &dev->op_regs->portsc1); > > + goto end; > > Not 'break' here? Use "goto end" instead as already check the status phase completion. Thanks, Andy -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html