diff mbox series

[v2] usb: onboard-hub: Make i2c-bus option

Message ID 68478821d089fcf68a841dff4b0e303721442e70.1758014760.git.michal.simek@amd.com
State New
Delegated to: Marek Vasut
Headers show
Series [v2] usb: onboard-hub: Make i2c-bus option | expand

Commit Message

Michal Simek Sept. 16, 2025, 9:26 a.m. UTC
DT binding doesn't mandate i2c-bus as required property because hub itself
doesn't need to have i2c connected.
It can be in standalone mode that only power regulator and reset should be
handled.
Or hub should be configured via spi interface.

Signed-off-by: Michal Simek <michal.simek@amd.com>
---

Changes in v2:
- Handle -ENOENT separately

 common/usb_onboard_hub.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Marek Vasut Sept. 16, 2025, 1:22 p.m. UTC | #1
On 9/16/25 11:26 AM, Michal Simek wrote:
> DT binding doesn't mandate i2c-bus as required property because hub itself
> doesn't need to have i2c connected.
> It can be in standalone mode that only power regulator and reset should be
> handled.
> Or hub should be configured via spi interface.
> 
> Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
diff mbox series

Patch

diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c
index 70fa349a8817..b265321c42ef 100644
--- a/common/usb_onboard_hub.c
+++ b/common/usb_onboard_hub.c
@@ -61,8 +61,13 @@  static int usb5744_i2c_init(struct udevice *dev)
 	int ret, slave_addr;
 
 	ret = dev_read_phandle_with_args(dev, "i2c-bus", NULL, 0, 0, &phandle);
+	if (ret == -ENOENT) {
+		dev_dbg(dev, "i2c-bus not specified\n");
+		return 0;
+	}
+
 	if (ret) {
-		dev_err(dev, "i2c-bus not specified\n");
+		dev_err(dev, "i2c-bus read failed\n");
 		return ret;
 	}