mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] spi: rpc-if: Add resume support for RZ/G3E
@ 2025-09-21 11:26 Biju Das
  2025-09-21 11:26 ` [PATCH 1/2] spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS Biju Das
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Biju Das @ 2025-09-21 11:26 UTC (permalink / raw)
  To: Mark Brown
  Cc: Biju Das, linux-spi, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc

On RZ/G3E using PSCI, s2ram powers down the SoC. After resume,
reinitialize the hardware for SPI operations.

Also Replace the macro SIMPLE_DEV_PM_OPS->DEFINE_SIMPLE_DEV_PM_OPS macro
and use pm_sleep_ptr(). This lets us drop the check for CONFIG_PM_SLEEP
and __maybe_unused attribute from PM functions.

Biju Das (2):
  spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS
  spi: rpc-if: Add resume support for RZ/G3E

 drivers/spi/spi-rpc-if.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS
  2025-09-21 11:26 [PATCH 0/2] spi: rpc-if: Add resume support for RZ/G3E Biju Das
@ 2025-09-21 11:26 ` Biju Das
  2025-09-21 11:26 ` [PATCH 2/2] spi: rpc-if: Add resume support for RZ/G3E Biju Das
  2025-09-23 11:25 ` [PATCH 0/2] " Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Biju Das @ 2025-09-21 11:26 UTC (permalink / raw)
  To: Mark Brown
  Cc: Biju Das, linux-spi, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc

Replace SIMPLE_DEV_PM_OPS->DEFINE_SIMPLE_DEV_PM_OPS macro and use
pm_sleep_ptr(). This lets us drop the check for CONFIG_PM_SLEEP, and
reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled,
while increasing build coverage.

Also drop the __maybe_unused attribute from PM functions.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/spi/spi-rpc-if.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index 627cffea5d5c..a8e783cc66e7 100644
--- a/drivers/spi/spi-rpc-if.c
+++ b/drivers/spi/spi-rpc-if.c
@@ -196,21 +196,21 @@ static void rpcif_spi_remove(struct platform_device *pdev)
 	pm_runtime_disable(rpc->dev);
 }
 
-static int __maybe_unused rpcif_spi_suspend(struct device *dev)
+static int rpcif_spi_suspend(struct device *dev)
 {
 	struct spi_controller *ctlr = dev_get_drvdata(dev);
 
 	return spi_controller_suspend(ctlr);
 }
 
-static int __maybe_unused rpcif_spi_resume(struct device *dev)
+static int rpcif_spi_resume(struct device *dev)
 {
 	struct spi_controller *ctlr = dev_get_drvdata(dev);
 
 	return spi_controller_resume(ctlr);
 }
 
-static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
 
 static const struct platform_device_id rpc_if_spi_id_table[] = {
 	{ .name = "rpc-if-spi" },
@@ -224,9 +224,7 @@ static struct platform_driver rpcif_spi_driver = {
 	.id_table = rpc_if_spi_id_table,
 	.driver = {
 		.name	= "rpc-if-spi",
-#ifdef CONFIG_PM_SLEEP
-		.pm	= &rpcif_spi_pm_ops,
-#endif
+		.pm	= pm_sleep_ptr(&rpcif_spi_pm_ops),
 	},
 };
 module_platform_driver(rpcif_spi_driver);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] spi: rpc-if: Add resume support for RZ/G3E
  2025-09-21 11:26 [PATCH 0/2] spi: rpc-if: Add resume support for RZ/G3E Biju Das
  2025-09-21 11:26 ` [PATCH 1/2] spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS Biju Das
@ 2025-09-21 11:26 ` Biju Das
  2025-09-23 11:25 ` [PATCH 0/2] " Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Biju Das @ 2025-09-21 11:26 UTC (permalink / raw)
  To: Mark Brown
  Cc: Biju Das, linux-spi, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc

On RZ/G3E using PSCI, s2ram powers down the SoC. After resume,
reinitialize the hardware for SPI operations.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/spi/spi-rpc-if.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index a8e783cc66e7..6edc0c4db854 100644
--- a/drivers/spi/spi-rpc-if.c
+++ b/drivers/spi/spi-rpc-if.c
@@ -207,6 +207,8 @@ static int rpcif_spi_resume(struct device *dev)
 {
 	struct spi_controller *ctlr = dev_get_drvdata(dev);
 
+	rpcif_hw_init(dev, false);
+
 	return spi_controller_resume(ctlr);
 }
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] spi: rpc-if: Add resume support for RZ/G3E
  2025-09-21 11:26 [PATCH 0/2] spi: rpc-if: Add resume support for RZ/G3E Biju Das
  2025-09-21 11:26 ` [PATCH 1/2] spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS Biju Das
  2025-09-21 11:26 ` [PATCH 2/2] spi: rpc-if: Add resume support for RZ/G3E Biju Das
@ 2025-09-23 11:25 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-09-23 11:25 UTC (permalink / raw)
  To: Biju Das
  Cc: linux-spi, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc

On Sun, 21 Sep 2025 12:26:44 +0100, Biju Das wrote:
> On RZ/G3E using PSCI, s2ram powers down the SoC. After resume,
> reinitialize the hardware for SPI operations.
> 
> Also Replace the macro SIMPLE_DEV_PM_OPS->DEFINE_SIMPLE_DEV_PM_OPS macro
> and use pm_sleep_ptr(). This lets us drop the check for CONFIG_PM_SLEEP
> and __maybe_unused attribute from PM functions.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS
      commit: 81ef2022b311c7c4f29011f778442635acfaba90
[2/2] spi: rpc-if: Add resume support for RZ/G3E
      commit: 2bfb20b65d9bc1d0de58f8c28ca9d6f1d27bbc01

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-23 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-21 11:26 [PATCH 0/2] spi: rpc-if: Add resume support for RZ/G3E Biju Das
2025-09-21 11:26 ` [PATCH 1/2] spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS Biju Das
2025-09-21 11:26 ` [PATCH 2/2] spi: rpc-if: Add resume support for RZ/G3E Biju Das
2025-09-23 11:25 ` [PATCH 0/2] " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®