usb: dwc2: gadget: add mutex to serialize init/deinit calls
This patch adds mutex, which protects initialization and
deinitialization procedures against suspend/resume methods. This mutex
will be needed by the updated suspend/resume calls, which tracks gadget
state.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 2cb0ac3..6b19755 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -576,6 +576,7 @@
struct regulator_bulk_data supplies[ARRAY_SIZE(s3c_hsotg_supply_names)];
spinlock_t lock;
+ struct mutex init_mutex;
void *priv;
int irq;
struct clk *clk;