summaryrefslogtreecommitdiffstats
path: root/drivers/usb/imx/chipidea-imx.c
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2015-09-17 17:16:25 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-09-23 10:31:33 +0200
commitd27cddcc3ad5c37c22acf287a5dbe36a0906359f (patch)
tree405009138b243b5c309bfd5f44c4fce28248cc48 /drivers/usb/imx/chipidea-imx.c
parentfe02d7e6c8d9b9e5d4c6b1e3302cf59274380996 (diff)
downloadbarebox-d27cddcc3ad5c37c22acf287a5dbe36a0906359f.tar.gz
barebox-d27cddcc3ad5c37c22acf287a5dbe36a0906359f.tar.xz
usb: chipidea: Add udc unregister for device removal
The host may assume that the usb device is still up and running after booting if we do not deregister the udc here. I observed issues when the linux kernel was using a usb gadget directly where the complete USB Hub got disconnected through this. This patch adds a proper USB disconnect for gadget devices. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/imx/chipidea-imx.c')
-rw-r--r--drivers/usb/imx/chipidea-imx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 1dca6bfe1d..5da2c26494 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -275,6 +275,12 @@ static int imx_chipidea_probe(struct device_d *dev)
return ret;
};
+static void imx_chipidea_remove(struct device_d *dev)
+{
+ if (IS_ENABLED(CONFIG_USB_GADGET_DRIVER_ARC))
+ ci_udc_unregister();
+}
+
static __maybe_unused struct of_device_id imx_chipidea_dt_ids[] = {
{
.compatible = "fsl,imx27-usb",
@@ -287,5 +293,6 @@ static struct driver_d imx_chipidea_driver = {
.name = "imx-usb",
.probe = imx_chipidea_probe,
.of_compatible = DRV_OF_COMPAT(imx_chipidea_dt_ids),
+ .remove = imx_chipidea_remove,
};
device_platform_driver(imx_chipidea_driver);