reset: rzg2l-usbphy-ctrl: Connect up vbus regulator

Bind the USB VBUS regulator driver under the USB PHY reset driver for
the Renesas RZ/G2L and related SoCs. This additional bind is needed as
the corresponding device tree node does not contain a compatible string.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
This commit is contained in:
Paul Barker
2025-03-11 20:57:45 +00:00
committed by Marek Vasut
parent e210e38a90
commit e6cc00a56e
2 changed files with 30 additions and 0 deletions

View File

@@ -239,6 +239,7 @@ config RESET_AT91
config RESET_RZG2L_USBPHY_CTRL
bool "Enable support for Renesas RZ/G2L USB 2.0 PHY control"
depends on DM_RESET
select REGULATOR_RZG2L_USBPHY
help
Enable support for controlling USB 2.0 PHY resets on the Renesas
RZ/G2L SoC. This is required for USB 2.0 functionality to work on this

View File

@@ -5,6 +5,7 @@
#include <asm/io.h>
#include <dm.h>
#include <dm/device-internal.h>
#include <dm/device_compat.h>
#include <dm/lists.h>
#include <renesas/rzg2l-usbphy.h>
@@ -103,10 +104,38 @@ static const struct udevice_id rzg2l_usbphy_ctrl_ids[] = {
{ /* sentinel */ }
};
static int rzg2l_usbphy_ctrl_bind(struct udevice *dev)
{
struct driver *drv;
ofnode node;
int ret;
node = ofnode_find_subnode(dev_ofnode(dev), "regulator-vbus");
if (!ofnode_valid(node)) {
dev_err(dev, "Failed to find vbus regulator devicetree node\n");
return -ENOENT;
}
drv = lists_driver_lookup_name("rzg2l_usbphy_regulator");
if (!drv) {
dev_err(dev, "Failed to find vbus regulator driver\n");
return -ENOENT;
}
ret = device_bind(dev, drv, dev->name, NULL, node, NULL);
if (ret) {
dev_err(dev, "Failed to bind vbus regulator: %d\n", ret);
return ret;
}
return 0;
}
U_BOOT_DRIVER(rzg2l_usbphy_ctrl) = {
.name = "rzg2l_usbphy_ctrl",
.id = UCLASS_RESET,
.of_match = rzg2l_usbphy_ctrl_ids,
.bind = rzg2l_usbphy_ctrl_bind,
.probe = rzg2l_usbphy_ctrl_probe,
.ops = &rzg2l_usbphy_ctrl_ops,
.priv_auto = sizeof(struct rzg2l_usbphy_ctrl_priv),