]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
usb: onboard-hub: Make i2c-bus optional
authorMichal Simek <michal.simek@amd.com>
Wed, 1 Oct 2025 06:20:07 +0000 (08:20 +0200)
committerMarek Vasut <marek.vasut+usb@mailbox.org>
Sun, 5 Oct 2025 04:11:44 +0000 (06:11 +0200)
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>
common/usb_onboard_hub.c

index 805b2ccbc0097a746cad26c245860fe98f3d66c3..6fc34489a98fa7ae3e1ac0f58bc182ac22e7ab30 100644 (file)
@@ -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;
        }