Hi, On Mon, Sep 26, 2011 at 05:43:02PM +0900, Yoshihiro Shimoda wrote: > SH7757 has a USB function with internal DMA controller (SUDMAC). > This patch supports the SUDMAC. The SUDMAC is incompatible with > general-purpose DMAC. So, it doesn't use dmaengine. > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> > --- > drivers/usb/gadget/r8a66597-udc.c | 359 +++++++++++++++++++++++++++++++++++-- > drivers/usb/gadget/r8a66597-udc.h | 26 +++- > include/linux/usb/r8a66597.h | 60 ++++++ > 3 files changed, 425 insertions(+), 20 deletions(-) > > diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c > index cd2cd16..4d27cb3 100644 > --- a/drivers/usb/gadget/r8a66597-udc.c > +++ b/drivers/usb/gadget/r8a66597-udc.c > @@ -28,13 +28,14 @@ > #include <linux/clk.h> > #include <linux/err.h> > #include <linux/slab.h> > +#include <linux/dma-mapping.h> > > #include <linux/usb/ch9.h> > #include <linux/usb/gadget.h> > > #include "r8a66597-udc.h" > > -#define DRIVER_VERSION "2009-08-18" > +#define DRIVER_VERSION "2011-09-26" > > static const char udc_name[] = "r8a66597_udc"; > static const char *r8a66597_ep_name[] = { > @@ -186,6 +187,51 @@ static inline void control_reg_sqclr(struct r8a66597 *r8a66597, u16 pipenum) > printk(KERN_ERR "unexpect pipe num(%d)\n", pipenum); > } > > +static void control_reg_sqset(struct r8a66597 *r8a66597, u16 pipenum) > +{ > + unsigned long offset; > + > + pipe_stop(r8a66597, pipenum); > + > + if (pipenum == 0) > + r8a66597_bset(r8a66597, SQSET, DCPCTR); > + else if (pipenum < R8A66597_MAX_NUM_PIPE) { > + offset = get_pipectr_addr(pipenum); > + r8a66597_bset(r8a66597, SQSET, offset); > + } else > + printk(KERN_ERR "unexpect pipe num(%d)\n", pipenum); according to CodingStyle, if one branch as braces, all of them should have. Also, try to avoid printk(), I guess you have a *dev here to use dev_err(). Besides this, I guess it looks fine. -- balbi
Attachment:
signature.asc
Description: Digital signature