[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240102-j7200-pcie-s2r-v6-5-4656ef6e6d66@bootlin.com>
Date: Wed, 15 May 2024 12:01:06 +0200
From: Thomas Richard <thomas.richard@...tlin.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, Tony Lindgren <tony@...mide.com>,
Aaro Koskinen <aaro.koskinen@....fi>,
Janusz Krzysztofik <jmkrzyszt@...il.com>, Vignesh R <vigneshr@...com>,
Andi Shyti <andi.shyti@...nel.org>, Peter Rosin <peda@...ntia.se>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczyński <kw@...ux.com>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Siddharth Vadapalli <s-vadapalli@...com>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-omap@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
gregory.clement@...tlin.com, theo.lebrun@...tlin.com,
thomas.petazzoni@...tlin.com, u-kumar1@...com,
Thomas Richard <thomas.richard@...tlin.com>
Subject: [PATCH v6 05/12] mux: mmio: add resume support
From: Théo Lebrun <theo.lebrun@...tlin.com>
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 <theo.lebrun@...tlin.com>
Signed-off-by: Thomas Richard <thomas.richard@...tlin.com>
---
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
Powered by blists - more mailing lists