Re: [PATCH] [RESUBMIT] Add Intel Langwell USB Device Controller driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, balbi

Thanks for your kindly review and good suggestion, I will add these
modification in bug fixing patch in future.

Regards
Xiaochen

On Thu, Jun 04, 2009 at 04:38:35PM +0800, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Jun 04, 2009 at 09:34:49AM +0200, ext Xiaochen Shen wrote:
> > diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
> > index 39a51d7..5ff5ead 100644
> > --- a/drivers/usb/gadget/Makefile
> > +++ b/drivers/usb/gadget/Makefile
> > @@ -21,6 +21,7 @@ obj-$(CONFIG_USB_FSL_USB2)    += fsl_usb2_udc.o
> >  obj-$(CONFIG_USB_M66592)       += m66592-udc.o
> >  obj-$(CONFIG_USB_FSL_QE)       += fsl_qe_udc.o
> >  obj-$(CONFIG_USB_CI13XXX)      += ci13xxx_udc.o
> > +obj-$(CONFIG_USB_LANGWELL)      += langwell_udc.o
> > 
> >  #
> >  # USB gadget drivers
> > diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
> > index ec6d439..8e0e9a0 100644
> > --- a/drivers/usb/gadget/gadget_chips.h
> > +++ b/drivers/usb/gadget/gadget_chips.h
> > @@ -137,6 +137,12 @@
> >  #define gadget_is_musbhdrc(g)  0
> >  #endif
> > 
> > +#ifdef CONFIG_USB_GADGET_LANGWELL
> > +#define gadget_is_langwell(g)  (!strcmp("langwell_udc", (g)->name))
> > +#else
> > +#define gadget_is_langwell(g)  0
> > +#endif
> > +
> >  /* from Montavista kernel (?) */
> >  #ifdef CONFIG_USB_GADGET_MPC8272
> >  #define gadget_is_mpc8272(g)   !strcmp("mpc8272_udc", (g)->name)
> > @@ -231,6 +237,8 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
> >                 return 0x22;
> >         else if (gadget_is_ci13xxx(gadget))
> >                 return 0x23;
> > +       else if (gadget_is_langwell(gadget))
> > +               return 0x24;
> >         return -ENOENT;
> >  }
> 
> i guess this part should be a third patch.
> 
> > +#ifdef VERBOSE
> > +static inline void print_all_registers(struct langwell_udc *dev)
> > +{
> > +       int     i;
> > +
> > +       /* Capability Registers */
> > +       printk(KERN_DEBUG "Capability Registers (offset: "
> > +                       "0x%04x, length: 0x%08x)\n",
> > +                       CAP_REG_OFFSET,
> > +                       (u32)sizeof(struct langwell_cap_regs));
> 
> could all of this be converted to dev_vdbg() ??
> 
> > +#define        DIR_STRING(bAddress)    (((bAddress) & USB_DIR_IN) ? "in" : "out")
> 
> DIR_STRING(desc)	(usb_endpoint_dir_in(desc) ? "in" : "out")
> 
> > +
> > +#define is_in(ep)      (((ep)->ep_num == 0) ? ((ep)->dev->ep0_dir == \
> > +                       USB_DIR_IN) : ((ep)->desc->bEndpointAddress \
> > +                       & USB_DIR_IN) == USB_DIR_IN)
> 
> this could be using usb_endpoint_dir_in() and usb_endpoint_num()
> 
> > +
> > +
> > +#ifdef DEBUG
> > +static char *type_string(u8 bmAttributes)
> 
> static char *type_string(struct usb_endpoint_descriptor *desc)
> 
> > +{
> > +       switch ((bmAttributes) & USB_ENDPOINT_XFERTYPE_MASK) {
> 
> usb_endopint_type(desc)
> 
> > +       switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
> 
> switch(usb_endpoint_type(desc)) {
> 
> > +       ep->ep_num = desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
> 
> usb_endpoint_num(desc);
> 
> > +       ep_reset(ep, ep->ep_num, is_in(ep), ep->ep_type);
> 
> ep_reset(ep, ep->ep_num, usb_endpoint_dir_in(desc), ep->type);
> 
> > +
> > +       DBG(dev, "enabled %s (ep%d%s-%s), max %04x\n",
> > +                       _ep->name,
> > +                       ep->ep_num,
> > +                       DIR_STRING(desc->bEndpointAddress),
> 
> DIR_STRING(desc),
> 
> -- 
> balbi
--
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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux