USB: ci13xxx_udc: Fix ENDPOINT PRIME failure issue

while queueing requests to USB HW, waiting till EP PRIME bit
get cleared after setting it leads to wathdog timeout. Fix
this by implementing timer based solution instead of infinite
PRIME check loop.

CRs-Fixed: 397907
Change-Id: I74e9acbfdfcd2030896d1fa813e66803ece7d5bd
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>

Conflicts:
	drivers/usb/gadget/ci13xxx_udc.c
USB: ci13xxx_udc: Add timeout of 100ms for endpoint flush loop

Currently completion of endpoint flush operation is checked after
setting that endpoint bit with ENDPTFLUSH register and polling the
same to get it clear. It has been observed that sometime this flush
operation takes huge amount of time which results into watchdog
timeout issue due to this busy loop without any time-out. Hence add
time-out of 100ms for endpoint flush operation completion and also
add 100us delay before checking ENDPTFLUSH register for endpoint bit
clear or not.

Also print important usb status register and flushed endpoint dtds
at the time of issue.

CRs-Fixed: 409382
Change-Id: I7ae57cc436077f8a03051b92750bdca9a571da2b
Signed-off-by: Mayank Rana <mrana@codeaurora.org>

Conflicts:
	drivers/usb/gadget/ci13xxx_udc.c
usb: gadget: ci13xxx_msm: Allow BAM enable and disable

There are scenarios where the USB BAM has to be reset.
For example, when the peer BAM is being reset, the USB BAM
must be reset as well, otherwise the BAM-BAM connection will
go out of sync.

In order to reset the USB BAM, the USB controller has to disable
the BAM first. After the USB BAM reset is completed, the USB
controller has to re-enable the USB BAM.

So this change adds the support for USB BAM enable/disable.
This is done by adding an API to ci13xxx_msm. A function driver can
ask for BAM enable/disable by calling this API.

This change doesn't add the support for the USB BAM reset sequence.

CRs-Fixed: 424867
Change-Id: Ib5518fafe3765f86bb09d1ce10723ec733543b35
Signed-off-by: Amit Blay <ablay@codeaurora.org>

Conflicts:
	include/linux/usb/msm_hsusb.h

Conflicts:
	include/linux/usb/msm_hsusb.h
net: usb: Prevent suspend if response available notification received

There is a possibility of interface suspend after receiving response
available notification from mdm device. In this case driver unlinks
the rx urb and do not send GET_ENCAPSULATED_RESPONSE setup packet to
mdm. Response to mdm gets delayed up until interface resumes and mdm
sends response available notification again. Hence resume interface
after receiving response available notification if it is suspended.
Allow interface suspend only after completing
GET_ENCAPSULATED_RESPONSE.

Change-Id: Ib52e64b1cc7b6d5edfe3ada9651ec56526cf4852
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>