summaryrefslogtreecommitdiff
path: root/drivers/firmware/xilinx/zynqmp.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2025-07-01 13:47:16 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2025-07-09 13:29:25 +0200
commit3da405ead6511e4f3c6b34ac92c1961ca5723f18 (patch)
treedf9a0d10b304704329972dd78db32aedb9d1e6ca /drivers/firmware/xilinx/zynqmp.c
parentc237dbbc1f10dd547cafb4780fa16e731d5cf438 (diff)
firmware/pmdomain: xilinx: Move ->sync_state() support to firmware driver
Rather than having the genpd provider to add device_links for each device that gets attached, to implement the ->sync_state() support, let's rely on fw_devlink to do this for us. In this way, we can simplify the code by moving the ->sync_state() callback into the firmware driver, so let's do that. Cc: Michael Tretter <m.tretter@pengutronix.de> Cc: Michal Simek <michal.simek@amd.com> Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Colibri iMX8X Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # TI AM62A,Xilinx ZynqMP ZCU106 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20250701114733.636510-15-ulf.hansson@linaro.org
Diffstat (limited to 'drivers/firmware/xilinx/zynqmp.c')
-rw-r--r--drivers/firmware/xilinx/zynqmp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index 7356e860e65c..a91a0191c689 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -2100,6 +2100,15 @@ static void zynqmp_firmware_remove(struct platform_device *pdev)
platform_device_unregister(em_dev);
}
+static void zynqmp_firmware_sync_state(struct device *dev)
+{
+ if (!of_device_is_compatible(dev->of_node, "xlnx,zynqmp-firmware"))
+ return;
+
+ if (zynqmp_pm_init_finalize())
+ dev_warn(dev, "failed to release power management to firmware\n");
+}
+
static const struct of_device_id zynqmp_firmware_of_match[] = {
{.compatible = "xlnx,zynqmp-firmware"},
{.compatible = "xlnx,versal-firmware"},
@@ -2112,6 +2121,7 @@ static struct platform_driver zynqmp_firmware_driver = {
.name = "zynqmp_firmware",
.of_match_table = zynqmp_firmware_of_match,
.dev_groups = zynqmp_firmware_groups,
+ .sync_state = zynqmp_firmware_sync_state,
},
.probe = zynqmp_firmware_probe,
.remove = zynqmp_firmware_remove,