Revert "USB: msm72k_udc: Check if the ep is not disabled before queuing it"

This reverts commit 71de1dab4b9bfd436804327f1ca17474288b726f.

Change-Id: I7c76ca229b10b1c12b351dbdc6dd5bee4cc74994
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: msm72k_udc: Check if the ep is not disabled before queuing it

Queuing a request on a disabled endpoint during composition switch leads
to prime failure. Hence return -EINVAL if a request is queued on a disabled
endpoint.

Also, in f_mtp, block queuing a request in OUT ep in receive_file_work, if
the device state is STATE_OFFLINE.

CRs-Fixed: 378207
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
(cherry picked from commit 7c3c45b9a4b51f422db4434c87e7951102ec2841)

Change-Id: I10cb8457997a8cb80d1694326e646dac6772459a
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: msm72k_udc: set QMULT for ISO endpoints

Currently not setting QMULT for ISO endpoints. Set this
value to indicate to the USB controller the number
of transactions to be done in microframe.

Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
(cherry picked from commit aa64446d5013033fac6cfed5271c6ebc195ac74c)

Change-Id: I4a238dfc92862513bba7983259147a9561e7500c
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: msm72k_udc: Disable all usb interrupts & acknowledge them

USB OTG and UDC driver share the same interrupt line. UDC driver free
the IRQ as part of cable disconnect processing. A spurious device specific
interrupts (USBSTS) occur and is ignored by OTG driver.
This is leading to "irq nobody cared" warning as USB interrupt is disabled.

Disable and acknowledge all device specific interrupts in UDC driver before
freeing the IRQ.

CRs-Fixed: 437553
Change-Id: Ia3bee62bdd0311c8df3308e69b860d71f1dce4e8
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>

Conflicts:

	drivers/usb/gadget/msm72k_udc.c
USB: msm72k_udc: Don't handle asynchronous interrupt

USB enter low power mode after detecting the wall charger. When
wall-charger is disconnected, USB hardware generate asynchronous interrupt
for notifying B-Session Valid low condition. OTG and UDC share the same
interrupt line. The OTG interrupt handler is called first and it disable
the IRQ and schedule the resume work. As the interrupt is received,
the kernel will invoke all shared interrupt handlers though the IRQ is
disabled by the first handler.

The UDC interrupt handler is accessing USB registers before clocks are
turned on. Avoid unclocked access by ignoring the asynchronous interrupt.

CRs-Fixed: 442012
Change-Id: I58c6a6e192ce274ab265b5d7c8d95ad84dc55efd
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
USB: msm72k_udc: Flush both control out and in requests on _dequeue

NULL pointer dereference crash is observed, while pending control requests
of rndis are dequeued as a part of usb reset interrupt, during composition
switch.

So during composition switch, check if there are any pending control
requests on both control-in and control-out endpoints and flush them in
msm72k_dequeue, before we receive an usb reset interrupt.

Also, don't queue further requests if usb gadget is disconnected.

CRs-Fixed: 438065
Change-Id: I78b6d5fa96766060ceff6bb40aef7ee4698d7be3
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>