From c7e3b2b58636704d504ac270031d87b716d8b273 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Wed, 26 Sep 2012 00:14:34 +0200 Subject: usb: lowlevel interface change to support multiple controllers Carry an index in the lowlevel usb functions to make specify the respective usb controller. Also pass through an controller struct from lowlevel_init to the creation of the root usb device of this controller. Signed-off-by: Lucas Stach Reviewed-by: Marek Vasut --- include/usb.h | 10 +++++++--- include/usb/mv_udc.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/usb.h b/include/usb.h index ba3d169..292a042 100644 --- a/include/usb.h +++ b/include/usb.h @@ -140,6 +140,8 @@ struct usb_device { int portnr; struct usb_device *parent; struct usb_device *children[USB_MAXCHILDREN]; + + void *controller; /* hardware controller private data */ }; /********************************************************************** @@ -153,8 +155,9 @@ struct usb_device { defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \ defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X) -int usb_lowlevel_init(void); -int usb_lowlevel_stop(void); +int usb_lowlevel_init(int index, void **controller); +int usb_lowlevel_stop(int index); + int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len); int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, @@ -382,7 +385,8 @@ void usb_hub_reset(void); int hub_port_reset(struct usb_device *dev, int port, unsigned short *portstat); -struct usb_device *usb_alloc_new_device(void); +struct usb_device *usb_alloc_new_device(void *controller); + int usb_new_device(struct usb_device *dev); #endif /*_USB_H_ */ diff --git a/include/usb/mv_udc.h b/include/usb/mv_udc.h index 51d36c3..221e626 100644 --- a/include/usb/mv_udc.h +++ b/include/usb/mv_udc.h @@ -147,5 +147,5 @@ struct ept_queue_item { #define INFO_BUFFER_ERROR (1 << 5) #define INFO_TX_ERROR (1 << 3) -extern int usb_lowlevel_init(void); +extern int usb_lowlevel_init(int index, void **controller); #endif /* __MV_UDC_H__ */ -- cgit v1.1