public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/14] usb: ums: support multiple controllers using controller_index
Date: Tue, 16 May 2017 23:00:03 +0200	[thread overview]
Message-ID: <20170516230003.41368e07@jawa> (raw)
In-Reply-To: <20170516193158.GL5701@bill-the-cat>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 3879 bytes --]

Hi Tom,

> On Tue, May 16, 2017 at 08:16:29PM +0800, yinbo.zhu wrote:
> 
> > From: Rajesh Bhagat <rajesh.bhagat@nxp.com>
> > 
> > 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>

I've already acked this patch :-)

Best regards,
Łukasz

> > ---
> >  cmd/usb_mass_storage.c              |  2 +-
> >  drivers/usb/gadget/f_mass_storage.c | 11 +++++++++--
> >  include/usb_mass_storage.h          |  2 +-
> >  3 files changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c
> > index 86398fc..139b537 100644
> > --- a/cmd/usb_mass_storage.c
> > +++ b/cmd/usb_mass_storage.c
> > @@ -214,7 +214,7 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int
> > flag, while (1) {
> >  		usb_gadget_handle_interrupts(controller_index);
> >  
> > -		rc = fsg_main_thread(NULL);
> > +		rc = fsg_main_thread(controller_index);
> >  		if (rc) {
> >  			/* Check I/O error */
> >  			if (rc == -EIO)
> > 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;
> >  
> > diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
> > index 8229f62..f21cc7a 100644
> > --- a/include/usb_mass_storage.h
> > +++ b/include/usb_mass_storage.h
> > @@ -28,6 +28,6 @@ struct ums {
> >  
> >  int fsg_init(struct ums *ums_devs, int count);
> >  void fsg_cleanup(void);
> > -int fsg_main_thread(void *);
> > +int fsg_main_thread(unsigned int);
> >  int fsg_add(struct usb_configuration *c);
> >  #endif /* __USB_MASS_STORAGE_H__ */
> 
> Lukasz?
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170516/d7ae2497/attachment.sig>

  reply	other threads:[~2017-05-16 21:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 12:16 [U-Boot] [PATCH 01/14] armv7: Add workaround for USB erratum A-009008 yinbo.zhu
2017-05-16 12:16 ` [U-Boot] [PATCH] uboot: Kconfig: add ERRATUM config to Kconfig for solve compile issue yinbo.zhu
2017-05-16 12:16 ` [U-Boot] [PATCH 02/14] armv7: Add workaround for USB erratum A-009798 yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 03/14] armv7: Add workaround for USB erratum A-008997 yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 04/14] armv7: Add workaround for USB erratum A-009007 yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 05/14] armv8: Add workaround for USB erratum A-009798 yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 06/14] armv8: Add workaround for USB erratum A-008997 yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 07/14] armv8: Add workaround for USB erratum A-009007 yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 08/14] usb: dwc3: Add helper functions to enable snooping and burst settings yinbo.zhu
2017-05-16 19:32   ` Tom Rini
2017-05-18  9:20     ` Marek Vasut
2017-05-16 12:16 ` [U-Boot] [PATCH 09/14] usb: ums: support multiple controllers using controller_index yinbo.zhu
2017-05-16 19:31   ` Tom Rini
2017-05-16 21:00     ` Lukasz Majewski [this message]
2017-05-16 21:07       ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 10/14] config: ls1012aqds: Add USB EHCI support for ls1012aqds yinbo.zhu
2017-05-16 12:16 ` [U-Boot] [PATCH 11/14] armv8: Add workaround for USB erratum A-009008 yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 12/14] armv8/fsl-layerscape: add dwc3 gadget driver support yinbo.zhu
2017-05-16 19:33   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 13/14] drivers:usb:xhci:fsl: Implement Erratum A-010151 for FSL USB3 controller yinbo.zhu
2017-05-16 19:30   ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 14/14] uboot: Kconfig: add ERRATUM config to Kconfig for solve compile issue yinbo.zhu
2017-05-16 19:33 ` [U-Boot] [PATCH 01/14] armv7: Add workaround for USB erratum A-009008 Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2017-05-17 11:06 yinbo.zhu
2017-05-17 11:06 ` [U-Boot] [PATCH 09/14] usb: ums: support multiple controllers using controller_index yinbo.zhu
2017-05-17 12:04 [U-Boot] [PATCH 01/14] armv7: Add workaround for USB erratum A-009008 yinbo.zhu
2017-05-17 12:05 ` [U-Boot] [PATCH 09/14] usb: ums: support multiple controllers using controller_index yinbo.zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170516230003.41368e07@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox