summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRajesh Bhagat <rajesh.bhagat@nxp.com>2016-08-04 09:26:53 (GMT)
committerPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>2017-07-19 05:46:35 (GMT)
commite1b1fc55b529b121c3b94843d0388f79e536c909 (patch)
tree5b77dd598b43e806afab14fb6a66cf45d2eafa50 /drivers
parenta836ef446fe14fc61526e7300994f978e21cec43 (diff)
downloadu-boot-e1b1fc55b529b121c3b94843d0388f79e536c909.tar.xz
usb: ums: support multiple controllers using controller_index
Adds a new field in fsg_common namely controller_index to support multiple controllers usb gadget support. Signed-off-by: Rajat Srivastava <rajat.srivastava@nxp.com> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 1ecb92a..27ca5fe 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -362,6 +362,7 @@ struct fsg_common {
char inquiry_string[8 + 16 + 4 + 1];
struct kref ref;
+ unsigned int controller_index;
};
struct fsg_config {
@@ -691,7 +692,7 @@ static int sleep_thread(struct fsg_common *common)
k = 0;
}
- usb_gadget_handle_interrupts(0);
+ usb_gadget_handle_interrupts(common->controller_index);
}
common->thread_wakeup_needed = 0;
return rc;
@@ -2402,10 +2403,14 @@ static void handle_exception(struct fsg_common *common)
/*-------------------------------------------------------------------------*/
-int fsg_main_thread(void *common_)
+int fsg_main_thread(unsigned int controller_index)
{
int ret;
struct fsg_common *common = the_fsg_common;
+
+ /* update the controller_index */
+ common->controller_index = controller_index;
+
/* The main loop */
do {
if (exception_in_progress(common)) {
@@ -2476,6 +2481,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
common->ops = NULL;
common->private_data = NULL;
+ common->controller_index = 0;
common->gadget = gadget;
common->ep0 = gadget->ep0;
@@ -2770,6 +2776,7 @@ int fsg_add(struct usb_configuration *c)
fsg_common->ops = NULL;
fsg_common->private_data = NULL;
+ fsg_common->controller_index = 0;
the_fsg_common = fsg_common;