From: Marek Vasut <marex@denx.de>
To: Eugen Hristev <eugen.hristev@collabora.com>
Cc: u-boot@lists.denx.de, mihai.sain@microchip.com,
Sergiu Moga <sergiu.moga@microchip.com>
Subject: Re: [PATCH v5 2/3] usb: ohci-at91: Enable OHCI functionality and register into DM
Date: Tue, 25 Jul 2023 18:17:31 +0200 [thread overview]
Message-ID: <07923951-82ab-e9db-263f-bee516ece000@denx.de> (raw)
In-Reply-To: <20230725154317.663337-2-eugen.hristev@collabora.com>
On 7/25/23 17:43, Eugen Hristev wrote:
[...]
> +static int ohci_atmel_probe(struct udevice *dev)
> +{
> + struct ohci_at91_priv *ohci_at91 = dev_get_priv(dev);
> + struct at91_usbh_data *pdata = dev_get_plat(dev);
> + struct ohci_regs *regs;
> + int ret;
> + u32 i;
> +
> + regs = (struct ohci_regs *)dev_read_addr(dev);
> + if (IS_ERR(regs)) {
> + ret = PTR_ERR(regs);
> + goto fail;
> + }
> +
> + pdata->ports = dev_read_u32_default(dev, "num-ports", 3);
> +
> + at91_for_each_port(i, pdata->ports)
> + gpio_request_by_name(dev, "atmel,vbus-gpio", i,
> + &pdata->vbus_pin[i], GPIOD_IS_OUT |
> + GPIOD_IS_OUT_ACTIVE);
> +
> + ret = clk_get_bulk(dev, &ohci_at91->clks);
If this fails, and ohci_at91->clks is not populated ...
> + if (ret)
> + goto fail;
> +
> + ret = clk_enable_bulk(&ohci_at91->clks);
> + if (ret)
> + goto fail;
> +
> + ret = at91_start_hc(dev);
> + if (ret)
> + goto fail;
> +
> + return ohci_register(dev, regs);
> +
> +fail:
> + at91_for_each_port(i, pdata->ports)
> + if (dm_gpio_is_valid(&pdata->vbus_pin[i]))
> + gpio_free(pdata->vbus_pin[i].offset);
> +
> + clk_disable_bulk(&ohci_at91->clks);
... then this clk_disable_bulk() would likely misbehave, right ?
next prev parent reply other threads:[~2023-07-25 16:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 15:43 [PATCH v5 1/3] phy: at91: Add support for the USB 2.0 PHY's of SAMA7 Eugen Hristev
2023-07-25 15:43 ` [PATCH v5 2/3] usb: ohci-at91: Enable OHCI functionality and register into DM Eugen Hristev
2023-07-25 16:17 ` Marek Vasut [this message]
2023-07-25 15:43 ` [PATCH v5 3/3] usb: ohci-at91: Add USB PHY functionality Eugen Hristev
2023-07-25 16:15 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07923951-82ab-e9db-263f-bee516ece000@denx.de \
--to=marex@denx.de \
--cc=eugen.hristev@collabora.com \
--cc=mihai.sain@microchip.com \
--cc=sergiu.moga@microchip.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox