Add a .shutdown() callback to control the timing of PERST# and power during
system shutdown to ensure that PERST# is asserted before power to the
connector is removed, as required by PCIe CEM r6.0, sec 2.2.
Signed-off-by: Jian Yang <jian.yang@mediatek.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260413071401.1151-3-jian.yang@mediatek.com
mtk_pcie_irq_teardown(pcie);
}
+static void mtk_pcie_shutdown(struct platform_device *pdev)
+{
+ struct mtk_gen3_pcie *pcie = platform_get_drvdata(pdev);
+
+ mtk_pcie_devices_power_down(pcie);
+ mtk_pcie_power_down(pcie);
+}
+
static void mtk_pcie_irq_save(struct mtk_gen3_pcie *pcie)
{
int i;
static struct platform_driver mtk_pcie_driver = {
.probe = mtk_pcie_probe,
.remove = mtk_pcie_remove,
+ .shutdown = mtk_pcie_shutdown,
.driver = {
.name = "mtk-pcie-gen3",
.of_match_table = mtk_pcie_of_match,