Re: [PATCH v23 09/13] mfd: psci-mfd: Add psci-reboot-mode child cell
Bartosz Golaszewski <[email protected]>
| Newsgroups | dev.linux.lists.mfd,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <CAMRc=MezSb1hohMsNPR96-hnTr0fjrqZ2ZDKUhwnOWycW3Muzw@mail.gmail.com> |
On Tue, 14 Jul 2026 19:16:37 +0200, Shivendra Pratap <[email protected]> said: > 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 with a > named_fwnode. Add psci-cpuidle-domain cell first to isolate it from > reboot-mode failures. > > Suggested-by: Bartosz Golaszewski <[email protected]> > Signed-off-by: Shivendra Pratap <[email protected]> > --- > drivers/mfd/psci-mfd.c | 30 +++++++++++++++++++++++++++++- > drivers/power/reset/Kconfig | 2 +- > 2 files changed, 30 insertions(+), 2 deletions(-) > > diff --git a/drivers/mfd/psci-mfd.c b/drivers/mfd/psci-mfd.c > index 7affd6bb09dd..8c6b78ac471b 100644 > --- a/drivers/mfd/psci-mfd.c > +++ b/drivers/mfd/psci-mfd.c > @@ -7,6 +7,7 @@ > #include <linux/module.h> > #include <linux/of.h> > #include <linux/platform_device.h> > +#include <linux/property.h> > > static const struct mfd_cell psci_cells[] = { > { > @@ -14,10 +15,37 @@ static const struct mfd_cell psci_cells[] = { > }, > }; > > +static const struct mfd_cell psci_reboot_mode_cell[] = { > + { > + .name = "psci-reboot-mode", > + .named_fwnode = "reboot-mode", > + }, > +}; > + > static int psci_mfd_probe(struct platform_device *pdev) > { > - return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells, > + struct fwnode_handle *fwnode; > + int ret; > + > + ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells, > ARRAY_SIZE(psci_cells), NULL, 0, NULL); > + if (ret) > + return ret; > + > + fwnode = device_get_named_child_node(&pdev->dev, "reboot-mode"); > + if (!fwnode) > + return 0; > + > + fwnode_handle_put(fwnode); > + > + ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, > + psci_reboot_mode_cell, > + ARRAY_SIZE(psci_reboot_mode_cell), > + NULL, 0, NULL); > + if (ret) > + dev_warn(&pdev->dev, "reboot-mode child cell failed to add: %d\n", ret); Why do we have to look up the named node here anyway? Shouldn't MFD core handle that already in a generic way? Bart