From: Eduardo Valentin <edubezval@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, Fabio Stevam <festevam@gmail.com>
Cc: Linux PM <linux-pm@vger.kernel.org>,
Eduardo Valentin <edubezval@gmail.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/8] serial: imx: use dev_pm_ops
Date: Sun, 9 Aug 2015 11:19:05 -0700 [thread overview]
Message-ID: <1439144349-10494-5-git-send-email-edubezval@gmail.com> (raw)
In-Reply-To: <1439144349-10494-1-git-send-email-edubezval@gmail.com>
This is a simple reorganization to start using
struct dev_pm_ops instead of assigning .suspend
and .resume callbacks in platform driver.
The change allows further code to be added,
for example, runtime_pm.
Cc: Fabio Stevam <festevam@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
drivers/tty/serial/imx.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 70802be..a03855d 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -39,6 +39,7 @@
#include <linux/of_device.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
+#include <linux/pm.h>
#include <asm/irq.h>
#include <linux/platform_data/serial-imx.h>
@@ -1821,9 +1822,9 @@ static void serial_imx_enable_wakeup(struct imx_port *sport, bool on)
writel(val, sport->port.membase + UCR1);
}
-static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
+static int serial_imx_suspend(struct device *dev)
{
- struct imx_port *sport = platform_get_drvdata(dev);
+ struct imx_port *sport = dev_get_drvdata(dev);
/* enable wakeup from i.MX UART */
serial_imx_enable_wakeup(sport, true);
@@ -1833,9 +1834,9 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}
-static int serial_imx_resume(struct platform_device *dev)
+static int serial_imx_resume(struct device *dev)
{
- struct imx_port *sport = platform_get_drvdata(dev);
+ struct imx_port *sport = dev_get_drvdata(dev);
/* disable wakeup from i.MX UART */
serial_imx_enable_wakeup(sport, false);
@@ -1996,15 +1997,18 @@ static int serial_imx_remove(struct platform_device *pdev)
return uart_remove_one_port(&imx_reg, &sport->port);
}
+static const struct dev_pm_ops serial_imx_dev_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(serial_imx_suspend, serial_imx_resume)
+};
+
static struct platform_driver serial_imx_driver = {
.probe = serial_imx_probe,
.remove = serial_imx_remove,
- .suspend = serial_imx_suspend,
- .resume = serial_imx_resume,
.id_table = imx_uart_devtype,
.driver = {
.name = "imx-uart",
+ .pm = &serial_imx_dev_pm_ops,
.of_match_table = imx_uart_dt_ids,
},
};
--
2.5.0
next prev parent reply other threads:[~2015-08-09 18:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-09 18:19 [PATCH 0/8] serial: imx: rework pm support and add runtime pm Eduardo Valentin
2015-08-09 18:19 ` [PATCH 1/8] serial: imx: remove unbalanced clk_prepare Eduardo Valentin
2015-08-09 18:19 ` [PATCH 2/8] serial: imx: introduce serial_imx_enable_wakeup() Eduardo Valentin
2015-08-09 18:19 ` [PATCH 3/8] serial: imx: allow waking up on RTSD Eduardo Valentin
2015-08-09 18:19 ` Eduardo Valentin [this message]
2015-08-09 18:19 ` [PATCH 5/8] serial: imx: save and restore context in the suspend path Eduardo Valentin
2015-08-10 3:30 ` Fabio Estevam
2015-08-10 4:04 ` Eduardo Valentin
2015-08-10 12:17 ` Fabio Estevam
2015-08-10 23:50 ` Eduardo Valentin
2015-08-09 18:19 ` [PATCH 6/8] serial: imx: add a flag to indicate we are " Eduardo Valentin
2015-08-09 18:19 ` [PATCH 7/8] serial: imx: add runtime pm support Eduardo Valentin
2015-08-09 18:19 ` [PATCH 8/8] serial: imx: add pm_qos request Eduardo Valentin
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=1439144349-10494-5-git-send-email-edubezval@gmail.com \
--to=edubezval@gmail.com \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@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;
as well as URLs for NNTP newsgroup(s).