From: Lukasz Majewski Date: Mon, 25 Aug 2014 09:07:29 +0000 (+0200) Subject: udc: dfu: s3c_udc: Provide function to check if USB reset was asserted X-Git-Tag: submit/tizen/20160318.071304~235 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=243fc7c96c8448bdd2c4b5717a3940533c4d2e2c;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik.git udc: dfu: s3c_udc: Provide function to check if USB reset was asserted New dfu_usb_get_reset() method is necessary to distinct two different use cases of dfu-util program. This method checks if the USB bus reset has been really performed after DFU DETACH. Without this function the previous DFU behavior is preserved. Signed-off-by: Lukasz Majewski --- diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c index 10cc11450..d3429c15d 100644 --- a/drivers/usb/gadget/s3c_udc_otg.c +++ b/drivers/usb/gadget/s3c_udc_otg.c @@ -163,6 +163,11 @@ struct s3c_usbotg_reg *reg; struct s3c_usbotg_phy *phy; static unsigned int usb_phy_ctrl; +bool dfu_usb_get_reset(void) +{ + return !!(readl(®->gintsts) & INT_RESET); +} + void otg_phy_init(struct s3c_udc *dev) { dev->pdata->phy_control(1);