usb: gadget: fix crash on USB cable disconnection

Crash was observed (9x15) when USB cable was
disconnected. Root cause was NULL pointer and
USB BAM reset due to USB PHY reset. On 9x15 no
reset on disconnect will be performed.

CRs-Fixed: 326999
Change-Id: I006afb8dcd225caf9280dd915f8af3edfaebff5a
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index eb2c543..409e697 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -159,6 +159,8 @@
  *              dfab_usb_hs_clk in case of 8660 and 8960.
  * @pmic_id_irq: IRQ number assigned for PMIC USB ID line.
  * @mhl_enable: indicates MHL connector or not.
+ * @disable_reset_on_disconnect: perform USB PHY and LINK reset
+ *              on USB cable disconnection.
  * @swfi_latency: miminum latency to allow swfi.
  */
 struct msm_otg_platform_data {
@@ -173,6 +175,7 @@
 	const char *pclk_src_name;
 	int pmic_id_irq;
 	bool mhl_enable;
+	bool disable_reset_on_disconnect;
 	u32 swfi_latency;
 };
 
@@ -263,6 +266,7 @@
 #define PHY_RETENTIONED			BIT(1)
 #define PHY_OTG_COMP_DISABLED		BIT(2)
 	struct pm_qos_request_list pm_qos_req_dma;
+	int reset_counter;
 };
 
 struct msm_hsic_host_platform_data {