u-boot-brain/drivers/usb/host
Hans de Goede 6cda369509 dm: usb: Use device_unbind_children to clean up usb devs on stop
On an usb stop instead of leaving orphan usb devices behind simply remove
them.

The result of this commit is best seen in the output of "dm tree" after
plugging out an usb hub with 2 devices plugges in and plugging in a keyb.
instead, before this commit the output would be:

 usb         [ + ]    `-- sunxi-musb
 usb_hub     [   ]        |-- usb_hub
 usb_mass_st [   ]        |   |-- usb_mass_storage
 usb_dev_gen [   ]        |   `-- generic_bus_0_dev_3
 usb_dev_gen [ + ]        `-- generic_bus_0_dev_1

Notice the non active usb_hub child and its 2 non active children. The
first child being non-active as in this example also causes usb_get_dev_index
to return NULL when probing the first child, which results in the usb kbd
code not binding to the keyboard.

With this commit in place the output after swapping and "usb reset" is:

 usb         [ + ]    `-- sunxi-musb
 usb_dev_gen [ + ]        `-- generic_bus_0_dev_1

As expected, and usb_get_dev_index works properly and the keyboard works.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-07-21 17:39:36 -06:00
..
dwc2.c usb: dwc2: Add support for v3 snpsid value 2015-05-29 12:41:04 +02:00
dwc2.h usb: dwc2: Add support for v3 snpsid value 2015-05-29 12:41:04 +02:00
ehci-armada100.c usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init. 2013-10-20 23:46:27 +02:00
ehci-atmel.c USB: ehci-atmel: use pcr to enable or disable clock 2014-09-19 00:11:21 +02:00
ehci-exynos.c dm: usb: exynos: Drop legacy USB code 2015-05-06 14:00:35 -06:00
ehci-faraday.c dm: usb: Drop the EHCI weak functions 2015-04-18 11:11:24 -06:00
ehci-fsl.c drivers: usb: fsl: Return if USB_MAX_CONTROLLER_COUNT is incorrect 2015-06-07 15:46:02 +02:00
ehci-hcd.c usb: ehci: Properly deal with data toggle for interrupt endpoints 2015-06-19 14:33:28 +02:00
ehci-marvell.c usb: Add EHCI support for Armada 38x (mvebu) 2015-07-10 14:55:50 +02:00
ehci-mpc512x.c powerpc/usb:Differentiate USB controller base address 2013-10-24 09:35:09 -07:00
ehci-mx5.c dm: usb: Drop the EHCI weak functions 2015-04-18 11:11:24 -06:00
ehci-mx6.c usb:ehci-mx6 add phy mode query function 2014-11-14 20:56:54 +01:00
ehci-mxc.c usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init. 2013-10-20 23:46:27 +02:00
ehci-mxs.c usb: ehci: mxs: Add board-specific callbacks 2014-09-29 09:02:16 +02:00
ehci-omap.c usb: ehci-omap: Reset the USB Host OMAP module 2013-12-06 07:02:32 -05:00
ehci-pci.c usb: pci: Use pci_find_class() to find the device 2015-02-05 22:16:42 -07:00
ehci-ppc4xx.c usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init. 2013-10-20 23:46:27 +02:00
ehci-rmobile.c usb: rmobile: Use ARRAY_SIZE(usb_base_address) instead of CONFIG_USB_MAX_CONTROLLER_COUNT 2014-11-07 16:32:02 +01:00
ehci-spear.c usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init. 2013-10-20 23:46:27 +02:00
ehci-sunxi.c sunxi: ehci: Convert to the driver-model 2015-05-14 18:49:32 -06:00
ehci-tegra.c dm: usb: tegra: Drop legacy USB code 2015-06-10 19:26:55 -06:00
ehci-uniphier.c ARM: UniPhier: replace <asm/io.h> with <linux/io.h> 2015-05-31 02:53:56 +09:00
ehci-vct.c usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init. 2013-10-20 23:46:27 +02:00
ehci-vf.c usb: ehci-vf: Add weak function for board specific initialisation 2015-06-08 08:41:56 +02:00
ehci-zynq.c ARM: zynq: ehci: Added USB host driver support 2014-05-14 07:43:35 +02:00
ehci.h dm: usb: Add driver model support to EHCI 2015-04-18 11:11:25 -06:00
isp116x-hcd.c include: move various macros to include/linux/kernel.h 2014-11-20 11:28:25 -05:00
isp116x.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
Kconfig ARM: UniPhier: update the vendor name of UniPhier in Kconfig 2015-05-31 02:55:30 +09:00
Makefile sunxi: ohci: Add ohci usb host controller support 2015-05-14 18:49:32 -06:00
ohci-at91.c USB: ohci-at91: use pcr to enable or disable clock 2014-09-19 00:11:20 +02:00
ohci-da8xx.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ohci-ep93xx.c arm: ep9315: Return back Cirrus Logic EDB9315A board support 2014-07-04 23:45:48 +02:00
ohci-hcd.c usb: ohci: Add support for interrupt queues 2015-05-14 18:49:35 -06:00
ohci-s3c24xx.c include: move various macros to include/linux/kernel.h 2014-11-20 11:28:25 -05:00
ohci-s3c24xx.h dm: Move s3c24xx USB driver to a proper place 2012-10-18 06:54:18 +02:00
ohci-sunxi.c sunxi: ohci: Add ohci usb host controller support 2015-05-14 18:49:32 -06:00
ohci.h usb: ohci: Do not reuse ed for interrupt endpoints of different devices 2015-05-14 18:49:35 -06:00
r8a66597-hcd.c include: move various macros to include/linux/kernel.h 2014-11-20 11:28:25 -05:00
r8a66597.h usb: r8a66597: Fix argument mistake of inl 2011-08-08 21:40:40 +02:00
sl811-hcd.c usb: add enum usb_init_type parameter to usb_lowlevel_init 2013-10-20 23:45:26 +02:00
sl811.h drivers/usb: regorganisation 2009-04-06 20:40:46 +02:00
usb-sandbox.c dm: usb: sandbox: Add a driver for sandbox 2015-04-18 11:11:26 -06:00
usb-uclass.c dm: usb: Use device_unbind_children to clean up usb devs on stop 2015-07-21 17:39:36 -06:00
utmi-armada100.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
xhci-exynos5.c dm: usb: exynos: Drop legacy USB code 2015-05-06 14:00:35 -06:00
xhci-keystone.c keystone: usb: add support of usb xhci 2014-10-23 11:27:04 -04:00
xhci-mem.c dm: usb: Support driver model in XHCI 2015-04-18 11:11:28 -06:00
xhci-omap.c usb: host: xhci: make sure to power up PHY 2014-07-09 22:11:51 +02:00
xhci-pci.c usb: pci: Add XHCI driver for PCI 2015-02-05 22:16:42 -07:00
xhci-ring.c dm: usb: xhci: Use a function to get xhci_ctrl 2015-04-18 11:11:28 -06:00
xhci-uniphier.c ARM: UniPhier: replace <asm/io.h> with <linux/io.h> 2015-05-31 02:53:56 +09:00
xhci.c dm: usb: Rename the XHCI HCD to U-Boot 2015-04-18 11:11:28 -06:00
xhci.h dm: usb: Support driver model in XHCI 2015-04-18 11:11:28 -06:00