Re: [PATCH v2 1/3] usb: chipidea: add controller reset API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 14, 2014 at 02:55:41PM +0300, Sergei Shtylyov wrote:
> 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.chen@xxxxxxxxxxxxx>
> >---
> 
> >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"?
> 

Thanks, will change to "error resetting controller".

> >+		return ret;
> >+	}
> 
> WBR, Sergei
> 

-- 

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux