diff options
author | Rob Herring <robh@kernel.org> | 2014-12-10 14:43:03 -0600 |
---|---|---|
committer | Lukasz Majewski <l.majewski@samsung.com> | 2014-12-18 12:26:05 +0100 |
commit | fe1b28c9f0954047f20b20253596b5ca9aef4a32 (patch) | |
tree | f4e2f85dc522e473ccb7f8df4615b12d4ae24988 /drivers/usb/gadget | |
parent | 68ae882596524a2dde9da73283241b01d56375d5 (diff) | |
download | u-boot-imx-fe1b28c9f0954047f20b20253596b5ca9aef4a32.zip u-boot-imx-fe1b28c9f0954047f20b20253596b5ca9aef4a32.tar.gz u-boot-imx-fe1b28c9f0954047f20b20253596b5ca9aef4a32.tar.bz2 |
usb, g_dnl: generalize DFU detach functions
In order to add detach functions for fastboot, make the DFU detach related
functions common so they can be shared.
Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[TestHW: Exynos4412-Trats2]
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/f_dfu.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/g_dnl.c | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c index 16fc9dd..ead71eb 100644 --- a/drivers/usb/gadget/f_dfu.c +++ b/drivers/usb/gadget/f_dfu.c @@ -366,7 +366,7 @@ static int state_dfu_idle(struct f_dfu *f_dfu, to_runtime_mode(f_dfu); f_dfu->dfu_state = DFU_STATE_appIDLE; - dfu_trigger_detach(); + g_dnl_trigger_detach(); break; default: f_dfu->dfu_state = DFU_STATE_dfuERROR; diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index 25611ac..ee52a29 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -163,6 +163,23 @@ __weak int g_dnl_board_usb_cable_connected(void) return -EOPNOTSUPP; } +static bool g_dnl_detach_request; + +bool g_dnl_detach(void) +{ + return g_dnl_detach_request; +} + +void g_dnl_trigger_detach(void) +{ + g_dnl_detach_request = true; +} + +void g_dnl_clear_detach(void) +{ + g_dnl_detach_request = false; +} + static int g_dnl_get_bcd_device_number(struct usb_composite_dev *cdev) { struct usb_gadget *gadget = cdev->gadget; |