UPSTREAM: usb: dwc2: gadget: don't overwrite DCTL register on NAKEFF interrupts
authorGregory Herrero <gregory.herrero@intel.com>
Mon, 7 Dec 2015 11:07:31 +0000 (12:07 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 3 Jan 2017 10:47:43 +0000 (18:47 +0800)
commit263c63c383c1d74ba463fb57a21e2b2c885f3183
tree0c6ed428e42c339cbf1257c69b37ef2e34eb9764
parent43d87e60ebae4f8b6bc9be89aeb5d541547f6d55
UPSTREAM: usb: dwc2: gadget: don't overwrite DCTL register on NAKEFF interrupts

When receiving GINTSTS_GINNAKEFF or GINTSTS_GOUTNAKEFF interrupt,
DCTL will be overwritten with DCTL_CGOUTNAK or DCTL_CGNPINNAK values.
Instead of overwriting it, write only needed bits.

It could cause an issue if GINTSTS_GINNAKEFF or GINTSTS_GOUTNAKEFF
interrupt is received after dwc2 disabled pullup by writing
DCTL_SFTDISCON bit.
Pullup will then be re-enabled whereas it should not.

Change-Id: Idd93b20c3d780fffdf03cc30481eb4aed9aafe1e
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 3be99cd0e882dd2127b8cfe3942f5e464915aeba)
drivers/usb/dwc2/gadget.c