Files
build/patch/kernel/archive/meson-6.12/0010-usb-dwc2-register-child-USB-connector-devices.patch
Dominik Wójt 5b29f4dd4b meson: kernel update: legacy -> 6.6, current -> 6.12 (#7801)
* Add MXQ target. Copy HDMI fix from odroid-c1.
* meson8, MXQ: add boot from usb support, configurable dtb
* MXQ: remove boot logo
Built-in U-BOOT is used, so the logo will not be displayed anyway.
* meson: kernel update: legacy -> 6.6, current -> 6.12
* Change Odroid C1 and Onecloud to community supported as build now passes
---------
Co-authored-by: Igor Pecovnik <igor@armbian.com>
2025-02-08 23:08:34 +01:00

50 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Date: Sat, 4 Jul 2020 21:04:29 +0200
Subject: usb: dwc2: register child (USB connector) devices
Populate the child devices/nodes of the dwc2 controller. Typically these
are USB connectors with a compatible string (and additional properties)
like "gpio-usb-b-connector".
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
drivers/usb/dwc2/platform.c | 14 ++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 111111111111..222222222222 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -12,6 +12,7 @@
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/of.h>
+#include <linux/of_platform.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/phy/phy.h>
@@ -622,6 +623,19 @@ static int dwc2_driver_probe(struct platform_device *dev)
}
}
#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
+
+ retval = devm_of_platform_populate(&dev->dev);
+ if (retval) {
+ dev_err(hsotg->dev,
+ "Failed to create child devices/connectors for %p\n",
+ dev->dev.of_node);
+
+ if (hsotg->gadget_enabled)
+ dwc2_hsotg_remove(hsotg);
+
+ goto error_debugfs;
+ }
+
return 0;
#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
--
Armbian