From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 11 Aug 2013 20:04:51 +0200 Subject: [U-Boot] [RFC 01/10] New board-specific USB initialization interface In-Reply-To: <1375786242-11734-2-git-send-email-m.zalega@samsung.com> References: <1375786242-11734-1-git-send-email-m.zalega@samsung.com> <1375786242-11734-2-git-send-email-m.zalega@samsung.com> Message-ID: <201308112004.51765.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mateusz Zalega, > This commit unifies board-specific USB initialization implementations > under one symbol (usb_board_init), declaration of which is available in > usb.h. > > Signed-off-by: Mateusz Zalega > Signed-off-by: Kyungmin Park > Reviewed-by: Lukasz Majewski > Cc: Marek Vasut > --- > common/cmd_dfu.c | 5 ++--- > common/cmd_usb_mass_storage.c | 3 ++- > common/usb.c | 5 +++++ > drivers/usb/host/ehci-omap.c | 8 +------- > drivers/usb/host/ehci-tegra.c | 2 +- > drivers/usb/host/ohci-hcd.c | 4 ++-- > drivers/usb/host/ohci.h | 12 +++++------- > include/g_dnl.h | 2 -- > include/usb.h | 17 ++++++++++++++++- > include/usb_mass_storage.h | 12 +++++------- > 10 files changed, 39 insertions(+), 31 deletions(-) [...] > --- a/include/usb.h > +++ b/include/usb.h > @@ -165,10 +165,25 @@ int submit_int_msg(struct usb_device *dev, unsigned > long pipe, void *buffer, > > extern void udc_disconnect(void); > > -#else > +#elif !defined(CONFIG_USB_GADGET) > #error USB Lowlevel not defined > #endif > > +/* You can initialize platform's USB host, device or both > + * capabilities by passing this enum as an argument to > + * board_usb_init(). > + */ The comment style is wrong, please fix. Did the patchset pass checkpatch ? /* * multi * line * comment */ > +enum board_usb_init_type { > + USB_INIT_ALL, > + USB_INIT_HOST, > + USB_INIT_DEVICE > +}; > + > +/* board-specific hardware initialization, called by > + * usb drivers and u-boot commands > + */ > +int board_usb_init(enum board_usb_init_type what_to_init); > + > #ifdef CONFIG_USB_STORAGE > > #define USB_MAX_STOR_DEV 5 > diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h > index 35cdcc3..de31b0e 100644 > --- a/include/usb_mass_storage.h > +++ b/include/usb_mass_storage.h > @@ -30,13 +30,11 @@ struct ums_board_info { > struct ums_device ums_dev; > }; > > -extern void board_usb_init(void); > - > -extern int fsg_init(struct ums_board_info *); > -extern void fsg_cleanup(void); > -extern struct ums_board_info *board_ums_init(unsigned int, > +int fsg_init(struct ums_board_info *); > +void fsg_cleanup(void); > +struct ums_board_info *board_ums_init(unsigned int, > unsigned int, unsigned int); > -extern int usb_gadget_handle_interrupts(void); > -extern int fsg_main_thread(void *); > +int usb_gadget_handle_interrupts(void); > +int fsg_main_thread(void *); > > #endif /* __USB_MASS_STORAGE_H__ */ Best regards, Marek Vasut