linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: serial: samsung: Set missing PM ops for hibernation support
@ 2023-08-03 11:26 Anton Eliasson
  2023-08-05 21:38 ` Andi Shyti
  2023-08-07 13:50 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 7+ messages in thread
From: Anton Eliasson @ 2023-08-03 11:26 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-arm-kernel, linux-samsung-soc, linux-serial, linux-kernel,
	kernel, Anton Eliasson

At least freeze, restore and thaw need to be set in order for the driver
to support system hibernation. The existing suspend/resume functions can
be reused since those functions don't touch the device's power state or
wakeup capability. Use the helper macros SET_SYSTEM_SLEEP_PM_OPS and
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS for symmetry with similar drivers.

Signed-off-by: Anton Eliasson <anton.eliasson@axis.com>
---
I have not investigated the impact of adding the additional noirq
handler functions. The hardware that I tested on (Axis ARTPEC-8) appears
to work both with and without them assigned. Other similar drivers that
use noirq handlers assign them to both resume, thaw and restore so I
follow that style also.
---
 drivers/tty/serial/samsung_tty.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index b29e9dfd81a6..e2247c11067d 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -2273,9 +2273,8 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
 }
 
 static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
-	.suspend = s3c24xx_serial_suspend,
-	.resume = s3c24xx_serial_resume,
-	.resume_noirq = s3c24xx_serial_resume_noirq,
+	SET_SYSTEM_SLEEP_PM_OPS(s3c24xx_serial_suspend, s3c24xx_serial_resume)
+	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, s3c24xx_serial_resume_noirq)
 };
 #define SERIAL_SAMSUNG_PM_OPS	(&s3c24xx_serial_pm_ops)
 

---
base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
change-id: 20230731-samsung_tty_pm_ops-7c98f309a4e9

Best regards,
-- 
Anton Eliasson <anton.eliasson@axis.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-08-09 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 11:26 [PATCH] tty: serial: samsung: Set missing PM ops for hibernation support Anton Eliasson
2023-08-05 21:38 ` Andi Shyti
2023-08-07  9:57   ` Anton Eliasson
2023-08-07 21:34     ` Andi Shyti
2023-08-09 13:57       ` Anton Eliasson
2023-08-07 13:50 ` Krzysztof Kozlowski
2023-08-09 13:19   ` Anton Eliasson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).