[PATCH v21 09/13] mfd: psci-mfd: Add psci-reboot-mode child cell
Shivendra Pratap
shivendra.pratap at oss.qualcomm.com
Mon Apr 27 10:34:49 PDT 2026
The PSCI "reboot-mode" node does not define a compatible because it is a
configuration of boot-states provided by the underlying firmware. With
the new firmware-node based cells in mfd-core, this node can now be
exposed as a proper child cell.
Add the psci-reboot-mode child cell to the psci-mfd driver and associate
the reboot-mode node as its firmware-node.
Signed-off-by: Shivendra Pratap <shivendra.pratap at oss.qualcomm.com>
---
drivers/mfd/psci-mfd.c | 23 +++++++++++++++++++++--
drivers/power/reset/Kconfig | 2 +-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/psci-mfd.c b/drivers/mfd/psci-mfd.c
index 7affd6bb09dd83452664edeccb09290fe4f43186..dbb7c23b57d89765996ac887beda24fec76e8373 100644
--- a/drivers/mfd/psci-mfd.c
+++ b/drivers/mfd/psci-mfd.c
@@ -7,17 +7,36 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/string.h>
+
+#define PSCI_REBOOT_MODE_CELL_IDX 1
static const struct mfd_cell psci_cells[] = {
{
.name = "psci-cpuidle-domain",
},
+ {
+ .name = "psci-reboot-mode",
+ },
};
static int psci_mfd_probe(struct platform_device *pdev)
{
- return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells,
- ARRAY_SIZE(psci_cells), NULL, 0, NULL);
+ struct mfd_cell cells[ARRAY_SIZE(psci_cells)];
+ struct device_node *np = NULL;
+ int ret;
+
+ memcpy(cells, psci_cells, sizeof(cells));
+
+ if (pdev->dev.of_node)
+ np = of_get_child_by_name(pdev->dev.of_node, "reboot-mode");
+ cells[PSCI_REBOOT_MODE_CELL_IDX].fwnode = of_fwnode_handle(np);
+
+ ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, cells,
+ ARRAY_SIZE(cells), NULL, 0, NULL);
+ of_node_put(np);
+
+ return ret;
}
static const struct of_device_id psci_mfd_of_match[] = {
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index d9d1f768b8691abc3b32f2675519f2ddbaf19b84..79559206d5852ae5eae4c8eb2c390901cea7531c 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -350,7 +350,7 @@ config NVMEM_REBOOT_MODE
config PSCI_REBOOT_MODE
bool "PSCI reboot mode driver"
- depends on OF && ARM_PSCI_FW
+ depends on OF && ARM_PSCI_FW && MFD_PSCI
select REBOOT_MODE
help
Say y here will enable PSCI reboot mode driver. This gets
--
2.34.1
More information about the linux-arm-kernel
mailing list