[PATCH v3 5/7] PCI: mediatek-gen3: Integrate new pwrctrl API

Manivannan Sadhasivam mani at kernel.org
Sun Mar 8 23:04:35 PDT 2026


On Fri, Mar 06, 2026 at 01:21:34PM -0600, Bjorn Helgaas wrote:
> On Mon, Mar 02, 2026 at 01:31:05PM +0800, Chen-Yu Tsai wrote:
> > With the new PCI pwrctrl API and PCI slot binding and power drivers, we
> > now have a way to describe and power up WiFi/BT adapters connected
> > through a PCIe or M.2 slot, or exploded onto the mainboard itself.
> > 
> > Integrate the PCI pwrctrl API into the PCIe driver, so that power is
> > properly enabled before PCIe link training is done, allowing the
> > card to successfully be detected.
> > ...
> 
> > @@ -1211,9 +1222,13 @@ static int mtk_pcie_probe(struct platform_device *pdev)
> >  	pcie->soc = device_get_match_data(dev);
> >  	platform_set_drvdata(pdev, pcie);
> >  
> > +	err = pci_pwrctrl_create_devices(pcie->dev);
> 
> AFAICT this has nothing at all to do with mediatek-gen3; it only has
> to do with the fact that the platform provides a way to control the
> main power to endpoints that happen to be connected to it.  Are we
> going to have to add this in every single native host controller
> driver?

Yes, I want this feature to be opt-in because, a lot of controller drivers
handle the device power themselves. We can convert these drivers one-by-one and
when atleast 50% of them are converted, we can move these calls to generic APIs
such as pci_host_probe().

- Mani

-- 
மணிவண்ணன் சதாசிவம்



More information about the Linux-mediatek mailing list