udc: dfu: s3c_udc: Provide function to check if USB reset was asserted
authorLukasz Majewski <l.majewski@samsung.com>
Mon, 25 Aug 2014 09:07:29 +0000 (11:07 +0200)
committerChanho Park <chanho61.park@samsung.com>
Fri, 24 Jul 2015 07:30:02 +0000 (16:30 +0900)
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 <l.majewski@samsung.com>
drivers/usb/gadget/s3c_udc_otg.c

index 10cc11450edcd3bf8db6307eabf97744aaeb0419..d3429c15de492de052297677b1cbe96be8a1003a 100644 (file)
@@ -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(&reg->gintsts) & INT_RESET);
+}
+
 void otg_phy_init(struct s3c_udc *dev)
 {
        dev->pdata->phy_control(1);