Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375732

[PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode

From Roger Quadros <rogerq@ti.com>
Newsgroups linux.kernel
Subject [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode
Date 2016-04-11 13:40 +0200
Message-ID <rmIme-57L-23@gated-at.bofh.it> (permalink)
References <rmIme-57L-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Gadget controller might not be always active during suspend/
resume when we are operating in dual-role/otg mode.
Check if we're active and only if we are then perform
necessary actions during suspend/resume.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/dwc3/gadget.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 83d5c57..1ca5ac0 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2952,6 +2952,9 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
 
 int dwc3_gadget_suspend(struct dwc3 *dwc)
 {
+	if (!dwc->gadget_driver)
+		return 0;
+
 	if (dwc->pullups_connected) {
 		dwc3_gadget_disable_irq(dwc);
 		dwc3_gadget_run_stop(dwc, true, true);
@@ -2970,6 +2973,9 @@ int dwc3_gadget_resume(struct dwc3 *dwc)
 	struct dwc3_ep		*dep;
 	int			ret;
 
+	if (!dwc->gadget_driver)
+		return 0;
+
 	/* Start with SuperSpeed Default */
 	dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);
 
-- 
2.5.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-11 13:40 +0200
  Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Felipe Balbi <balbi@kernel.org> - 2016-04-11 14:30 +0200
    Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during  dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-11 15:20 +0200
      Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Felipe Balbi <balbi@kernel.org> - 2016-04-11 15:30 +0200
        Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during  dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-11 16:00 +0200
          Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Felipe Balbi <balbi@kernel.org> - 2016-04-12 10:10 +0200
            Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during  dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-12 10:30 +0200

csiph-web