On 10/3/24 4:54 PM, Abbarapu, Venkatesh wrote:
Hi Marek,

-----Original Message-----
From: Marek Vasut <ma...@denx.de>
Sent: Thursday, October 3, 2024 5:38 PM
To: Abbarapu, Venkatesh <venkatesh.abbar...@amd.com>; u-boot@lists.denx.de
Cc: Simek, Michal <michal.si...@amd.com>; fabrice.gasn...@foss.st.com; git
(AMD-Xilinx) <g...@amd.com>
Subject: Re: [PATCH v3 1/7] usb: onboard-hub: Add reset-gpio support

On 10/3/24 6:40 AM, Abbarapu, Venkatesh wrote:
Hi Marek,

Hi,

@@ -30,7 +40,24 @@ static int usb_onboard_hub_probe(struct udevice *dev)
        if (ret)
                dev_err(dev, "can't enable vdd-supply: %d\n", ret);

-       return ret;
+       hub->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+                                                 GPIOD_IS_OUT |
GPIOD_ACTIVE_LOW);
+       /* property is optional, don't return error! */
+       if (hub->reset_gpio) {

if (!hub->reset_gpio)
     return 0;
<Venkatesh> As reset_gpio is optional property,  by returning 0 the i2c sequence
wont be executed.
The code in if (hub->reset_gpio) { ... } only toggles the GPIO reset ?
<Venkatesh> Yes...if(hub->reset_gpio) only toggles the GPIO reset.
So you can return 0 if reset_gpio is NULL and exit early . What's the problem ?

Reply via email to