From 71dd75a17fd84dde6f58ac461f55b4ff43934e08 Mon Sep 17 00:00:00 2001 From: yangkai Date: Tue, 13 Nov 2012 17:45:23 +0800 Subject: [PATCH] usbhcd only add useful channel to freelist --- drivers/usb/dwc_otg/dwc_otg_cil.c | 8 ++++++++ drivers/usb/dwc_otg/dwc_otg_hcd.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc_otg/dwc_otg_cil.c b/drivers/usb/dwc_otg/dwc_otg_cil.c index 8acc6b0cdacf..c61117fa15c9 100755 --- a/drivers/usb/dwc_otg/dwc_otg_cil.c +++ b/drivers/usb/dwc_otg/dwc_otg_cil.c @@ -66,6 +66,7 @@ #include "dwc_otg_driver.h" #include "dwc_otg_cil.h" #include "dwc_otg_pcd.h" +#include "dwc_otg_hcd.h" #include "usbdev_rk.h" static dwc_otg_core_if_t * dwc_core_if = NULL; /** @@ -917,6 +918,8 @@ void dwc_otg_core_host_init(dwc_otg_core_if_t *_core_if) dwc_otg_hc_regs_t *hc_regs; int num_channels; gotgctl_data_t gotgctl = {.d32 = 0}; + dwc_hc_t *channel; + dwc_otg_hcd_t *_hcd = _core_if->otg_dev->hcd; struct dwc_otg_platform_data *pldata; pldata = _core_if->otg_dev->pldata; @@ -1008,6 +1011,11 @@ void dwc_otg_core_host_init(dwc_otg_core_if_t *_core_if) } } while (hcchar.b.chen); + + /* add channel to free list */ + channel = _core_if->otg_dev->hcd->hc_ptr_array[i]; + list_add_tail(&channel->hc_list_entry, &_hcd->free_hc_list); + dwc_otg_hc_cleanup(_hcd->core_if, channel); } /* Turn on the vbus power. */ diff --git a/drivers/usb/dwc_otg/dwc_otg_hcd.c b/drivers/usb/dwc_otg/dwc_otg_hcd.c index 5018584f64d8..acb383b38dc0 100755 --- a/drivers/usb/dwc_otg/dwc_otg_hcd.c +++ b/drivers/usb/dwc_otg/dwc_otg_hcd.c @@ -1252,13 +1252,14 @@ static void hcd_reinit(dwc_otg_hcd_t *_hcd) list_del(item); item = _hcd->free_hc_list.next; } +#if 0 num_channels = _hcd->core_if->core_params->host_channels; for (i = 0; i < num_channels; i++) { channel = _hcd->hc_ptr_array[i]; list_add_tail(&channel->hc_list_entry, &_hcd->free_hc_list); dwc_otg_hc_cleanup(_hcd->core_if, channel); } - +#endif /* Initialize the DWC core for host mode operation. */ dwc_otg_core_host_init(_hcd->core_if); } -- 2.34.1