diff options
author | Patrick Georgi <pgeorgi@google.com> | 2015-02-16 17:00:59 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-18 08:40:58 +0200 |
commit | bd6901e18fe2743e69b90dc1e8f96a98e103c3d0 (patch) | |
tree | 04b33071a8328cf1127cda66af96ae75e664dd59 /payloads/libpayload/drivers/udc/chipidea.c | |
parent | ea0bdf2d547dd1ade20880d8e3d39ee0f77fe212 (diff) | |
download | coreboot-bd6901e18fe2743e69b90dc1e8f96a98e103c3d0.tar.gz |
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>
Diffstat (limited to 'payloads/libpayload/drivers/udc/chipidea.c')
-rw-r--r-- | payloads/libpayload/drivers/udc/chipidea.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/udc/chipidea.c b/payloads/libpayload/drivers/udc/chipidea.c index 58bea063e7..850d0c05b9 100644 --- a/payloads/libpayload/drivers/udc/chipidea.c +++ b/payloads/libpayload/drivers/udc/chipidea.c @@ -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, |