libpayload udc: Deconfigure device when necessary

SET_CONFIGURATION(0) stops operation and is moves the
device to addressed mode.

BRANCH=none
BUG=none
TEST=USB device mode still works

Change-Id: I964d90ba8440b6f428896acc9fe63e1114390da6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 402bc907222d07765b3438967edf26cc1a79d775
Original-Change-Id: Iebad024e1ed2e344dba73b73a9b385a4ac4cb450
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/250791
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9785
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Patrick Georgi
2015-02-16 17:00:59 +01:00
parent ea0bdf2d54
commit bd6901e18f
2 changed files with 21 additions and 7 deletions

View File

@@ -138,6 +138,14 @@ static void chipidea_halt_ep(struct usbdev_ctrl *this, int ep, int in_dir)
while (readl(&p->opreg->epflush))
;
clrbits_le32(&p->opreg->epctrl[ep], 1 << (7 + (in_dir ? 16 : 0)));
while (!SIMPLEQ_EMPTY(&p->job_queue[ep][in_dir])) {
struct job *job = SIMPLEQ_FIRST(&p->job_queue[ep][in_dir]);
if (job->autofree)
free(job->data);
SIMPLEQ_REMOVE_HEAD(&p->job_queue[ep][in_dir], queue);
}
}
static void chipidea_start_ep(struct usbdev_ctrl *this,