public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Eliasson <anton.eliasson@axis.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-samsung-soc@vger.kernel.org>,
	<linux-serial@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<kernel@axis.com>, Anton Eliasson <anton.eliasson@axis.com>
Subject: [PATCH] tty: serial: samsung: Set missing PM ops for hibernation support
Date: Thu, 3 Aug 2023 13:26:42 +0200	[thread overview]
Message-ID: <20230803-samsung_tty_pm_ops-v1-1-1ea7be72194d@axis.com> (raw)

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>


             reply	other threads:[~2023-08-03 11:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 11:26 Anton Eliasson [this message]
2023-08-05 21:38 ` [PATCH] tty: serial: samsung: Set missing PM ops for hibernation support 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230803-samsung_tty_pm_ops-v1-1-1ea7be72194d@axis.com \
    --to=anton.eliasson@axis.com \
    --cc=alim.akhtar@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kernel@axis.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox