Re: [PATCH 1/4] thunderbolt: add platform nhi driver

From: Sven Peter

Date: Sat Nov 07 2026 - 14:05:21 EST


> Add a new file plat.c to register platform NHI driver for MediaTek
> mt8901/mt8992 SoCs.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx>
>

[...]

> +
> +static void nhi_plat_shutdown(struct platform_device *pdev)
> +{
> + nhi_plat_do_remove(pdev, true);
> +}
> +
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id nhi_plat_of_match[] = {
> + { .compatible = "thunderbolt-platform" },

Do you already have hardware that probes via device tree? You'll have to
write bindings and get them reviewed before adding any compatible here.
Generic ones like you used here aren't usually allowed.

If you don't have a dts based platform I'd probably drop this, not much of
this code here is e.g. re-usable for Apple since they like to think very
different, see my series in [1] that I can pick up again now that we
made progress on how to represent connections between the NHI and the
protocol adapters.

Not sure about qualcom since I haven't seen a series for the NHI yet but
I'm sure Konrad can comment there. I kinda expect that it won't have
much shared code either.

Take a look at e.g. more recent drivers in drivers/usb/dwc3: They
usually add a dwc3-$vendor.c file that takes care of all the
vendor-specific quirks and that ends up being nicer than a single
platform.c file with tons of quirks and separate code paths for each and
every vendor.


Sven


[1] https://lore.kernel.org/asahi/20260906-b4-apple-soc-tbt-v2-0-1f80085f93fb@xxxxxxxxxx/

--
Sven Peter <sven@xxxxxxxxxx>