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

Chunfeng Yun (云春峰) Chunfeng.Yun at mediatek.com
Wed Nov 11 05:09:15 PST 2026


On 六, 2026-11-07 at 20:04 +0100, Sven Peter wrote:
> > Add a new file plat.c to register platform NHI driver for MediaTek
> > mt8901/mt8992 SoCs.
> > 
> > Signed-off-by: Chunfeng Yun <chunfeng.yun at mediatek.com>
> > 
> 
> [...]
> 
> > +
> > +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, 
Make sense, currently we only use this driver on ACPI-base platforms
where the vendor-specific power/clock/phy sequencing is abstracted by
firmware (the dedicated wakeup irq may be vendor-specific due to not
defined in spec), and we don't have a DT-based platform exercising this
yet.

I will drop the OF match table in the next version and keep it focuesd
on ACPI for now.

> 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.
Yes, I already looked through your series when prepare these patches,
thanks

> 
> 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@kernel.org/
>  
> 



More information about the linux-arm-kernel mailing list