Re: [PATCH 2/3] usb: fotg210: use the common EHCI core

From: Philipp Zabel

Date: Mon Aug 31 2026 - 05:09:36 EST


On Mo, 2026-08-31 at 00:24 +0200, Linus Walleij wrote:
> Replace the private EHCI fork with an hc_driver built from the common
> EHCI implementation. Configure the FOTG210 register, root-hub TT,
> speed-reporting, port-reset, and Gemini timing quirks through the new
> hooks.
>
> Keep role selection fixed at probe time, while cleaning up clock/reset
> handling, interrupt masks, Gemini syscon setup, VBUS sequencing, probe
> failures, shutdown, and system sleep. Device trees without dr_mode
> retain their historical host default.
>
> Assisted-by: LLM
> Signed-off-by: Linus Walleij <linusw@xxxxxxxxxx>
> ---
> drivers/usb/fotg210/Kconfig | 2 +
> drivers/usb/fotg210/fotg210-core.c | 276 +-
> drivers/usb/fotg210/fotg210-hcd.c | 5672 +-----------------------------------
> drivers/usb/fotg210/fotg210-hcd.h | 689 -----
> drivers/usb/fotg210/fotg210.h | 26 +-
> 5 files changed, 338 insertions(+), 6327 deletions(-)
>
[...]
> diff --git a/drivers/usb/fotg210/fotg210-core.c b/drivers/usb/fotg210/fotg210-core.c
> index 7fb4d4715e9f..a6f39306fb19 100644
> --- a/drivers/usb/fotg210/fotg210-core.c
> +++ b/drivers/usb/fotg210/fotg210-core.c
> @@ -1,37 +1,50 @@
[...]
> static int fotg210_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> - enum usb_dr_mode mode;
> + struct reset_control *rst;
> struct fotg210 *fotg;
> u32 val;
> int ret;
> @@ -141,62 +193,112 @@ static int fotg210_probe(struct platform_device *pdev)
> if (IS_ERR(fotg->base))
> return PTR_ERR(fotg->base);
>
> - fotg->pclk = devm_clk_get_optional_enabled(dev, "PCLK");
> + fotg->pclk = devm_clk_get_enabled(dev, "PCLK");
> if (IS_ERR(fotg->pclk))
> - return PTR_ERR(fotg->pclk);
> + return dev_err_probe(dev, PTR_ERR(fotg->pclk),
> + "failed to enable PCLK\n");
> +
> + rst = devm_reset_control_get_optional_exclusive(dev, NULL);
> + if (IS_ERR(rst))
> + return dev_err_probe(dev, PTR_ERR(rst),
> + "failed to get reset\n");
> + if (rst) {

No need for the condition, reset_control_reset(rst) does nothing if rst
is NULL.

> + ret = reset_control_reset(rst);

regards
Philipp