The patches of this series were originally in the series "Add suspend to
ram support for PCIe on J7200" [1].
There is no changes compared to the patches in the series [1].
These patches add resume support for the mmio driver.
The first patch adds a new function mux_chip_resume() in the mux subsystem.
The second patch adds the resume support for the mmio driver using this new
function.
[1] https://lore.kernel.org/all/[email protected]/
Signed-off-by: Thomas Richard <[email protected]>
---
Thomas Richard (1):
mux: add mux_chip_resume() function
Théo Lebrun (1):
mux: mmio: add resume support
drivers/mux/core.c | 29 +++++++++++++++++++++++++++++
drivers/mux/mmio.c | 12 ++++++++++++
include/linux/mux/driver.h | 1 +
3 files changed, 42 insertions(+)
---
base-commit: 8e7767d07e04b89999d5adefb190f4d5e566d8d4
change-id: 20240613-mux-mmio-resume-support-4f3b2a34a32a
Best regards,
--
Thomas Richard <[email protected]>
From: Théo Lebrun <[email protected]>
No need to save something during the suspend stage, as the mux core has an
internal cache to store the state of muxes.
This cache is used by mux_chip_resume() to restore all muxes.
Signed-off-by: Théo Lebrun <[email protected]>
Signed-off-by: Thomas Richard <[email protected]>
---
drivers/mux/mmio.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c
index 30a952c34365..00405abe3ce3 100644
--- a/drivers/mux/mmio.c
+++ b/drivers/mux/mmio.c
@@ -130,13 +130,25 @@ static int mux_mmio_probe(struct platform_device *pdev)
mux_chip->ops = &mux_mmio_ops;
+ dev_set_drvdata(dev, mux_chip);
+
return devm_mux_chip_register(dev, mux_chip);
}
+static int mux_mmio_resume_noirq(struct device *dev)
+{
+ struct mux_chip *mux_chip = dev_get_drvdata(dev);
+
+ return mux_chip_resume(mux_chip);
+}
+
+static DEFINE_NOIRQ_DEV_PM_OPS(mux_mmio_pm_ops, NULL, mux_mmio_resume_noirq);
+
static struct platform_driver mux_mmio_driver = {
.driver = {
.name = "mmio-mux",
.of_match_table = mux_mmio_dt_ids,
+ .pm = pm_sleep_ptr(&mux_mmio_pm_ops),
},
.probe = mux_mmio_probe,
};
--
2.39.2