Hello.

On 11/14/2014 3:03 AM, Peter Chen wrote:

Add controller reset API, it may be used for host/otg driver in future.

Signed-off-by: Peter Chen <peter.c...@freescale.com>
---

Changes for v2:
- Add return value check for controller reset at hw_device_reset

  drivers/usb/chipidea/core.c | 30 +++++++++++++++++++++++++++---
  1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index bd74f27..dffd89b 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
[...]
@@ -392,13 +412,17 @@ static int ci_usb_phy_init(struct ci_hdrc *ci)
   */
  int hw_device_reset(struct ci_hdrc *ci, u32 mode)
  {
+       int ret;
+
        /* should flush & stop before reset */
        hw_write(ci, OP_ENDPTFLUSH, ~0, ~0);
        hw_write(ci, OP_USBCMD, USBCMD_RS, 0);

-       hw_write(ci, OP_USBCMD, USBCMD_RST, USBCMD_RST);
-       while (hw_read(ci, OP_USBCMD, USBCMD_RST))
-               udelay(10);             /* not RTOS friendly */
+       ret = hw_controller_reset(ci);
+       if (ret) {
+               dev_err(ci->dev, "error for reset, ret=%d\n", ret);

   Perhaps "error resetting"?

+               return ret;
+       }

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to