USB: dwc3_otg: Set peripheral mode before re-initializing core
USB: dwc3_otg: Set peripheral mode before re-initializing core

Moving from host to peripheral mode requires performing hardware
reset and re-initializing core. DWC3 core mode must be changed to
peripheral before DEVICE specific initialization, otherwise,
EP0 initialization would fail due to mode set to HOST and USB
wouldn't enumerate in peripheral mode.

Change-Id: I615442f885e602560d07e2278876d60744b6bd87
CRs-fixed: 469608
Signed-off-by: Manu Gautam <51907cac86db5f2ed57a4ac58c042ecc27c0b352@codeaurora.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas