From: omar.luna@linaro.org (Omar Ramirez Luna)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 6/9] ARM: OMAP: iommu: pm runtime save and restore context
Date: Wed, 12 Sep 2012 14:45:49 -0500 [thread overview]
Message-ID: <1347479152-588-7-git-send-email-omar.luna@linaro.org> (raw)
In-Reply-To: <1347479152-588-1-git-send-email-omar.luna@linaro.org>
Save and restore context during pm runtime transitions.
For now, the previous API for this purpose will trigger
pm runtime functions, and will be left as exported symbol
for compatibility with it's only user.
Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org>
---
drivers/iommu/omap-iommu.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 20ae946..c4de9a9 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -97,7 +97,7 @@ void omap_iommu_save_ctx(struct device *dev)
{
struct omap_iommu *obj = dev_to_omap_iommu(dev);
- arch_iommu->save_ctx(obj);
+ pm_runtime_put_sync(obj->dev);
}
EXPORT_SYMBOL_GPL(omap_iommu_save_ctx);
@@ -109,7 +109,7 @@ void omap_iommu_restore_ctx(struct device *dev)
{
struct omap_iommu *obj = dev_to_omap_iommu(dev);
- arch_iommu->restore_ctx(obj);
+ pm_runtime_get_sync(obj->dev);
}
EXPORT_SYMBOL_GPL(omap_iommu_restore_ctx);
@@ -1001,11 +1001,36 @@ static int __devexit omap_iommu_remove(struct platform_device *pdev)
return 0;
}
+static int omap_iommu_runtime_suspend(struct device *dev)
+{
+ struct omap_iommu *obj = to_iommu(dev);
+
+ arch_iommu->save_ctx(obj);
+
+ return 0;
+}
+
+static int omap_iommu_runtime_resume(struct device *dev)
+{
+ struct omap_iommu *obj = to_iommu(dev);
+
+ arch_iommu->restore_ctx(obj);
+
+ return 0;
+}
+
+static const struct dev_pm_ops iommu_pm_ops = {
+ SET_RUNTIME_PM_OPS(omap_iommu_runtime_suspend,
+ omap_iommu_runtime_resume,
+ NULL)
+};
+
static struct platform_driver omap_iommu_driver = {
.probe = omap_iommu_probe,
.remove = __devexit_p(omap_iommu_remove),
.driver = {
.name = "omap-iommu",
+ .pm = &iommu_pm_ops,
},
};
--
1.7.9.5
next prev parent reply other threads:[~2012-09-12 19:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 19:45 [PATCH v2 0/9] OMAP: iommu: hwmod, reset handling and runtime PM Omar Ramirez Luna
2012-09-12 19:45 ` [PATCH v2 1/9] ARM: OMAP: iommu: fix including iommu.h without IOMMU_API selected Omar Ramirez Luna
2012-09-19 9:35 ` Laurent Pinchart
2012-09-19 21:01 ` Paul Walmsley
2012-09-12 19:45 ` [PATCH v2 2/9] ARM: OMAP3: hwmod data: add mmu data for iva and isp Omar Ramirez Luna
2012-09-19 21:35 ` Paul Walmsley
2012-09-21 0:30 ` Paul Walmsley
2012-09-12 19:45 ` [PATCH v2 3/9] ARM: OMAP4: hwmod data: add mmu hwmod for ipu and dsp Omar Ramirez Luna
2012-09-19 20:59 ` Paul Walmsley
2012-09-19 21:20 ` Cousson, Benoit
2012-09-19 21:31 ` Paul Walmsley
2012-09-12 19:45 ` [PATCH v2 4/9] ARM: OMAP3/4: iommu: migrate to hwmod framework Omar Ramirez Luna
2012-09-12 19:45 ` [PATCH v2 5/9] ARM: OMAP3/4: iommu: adapt to runtime pm Omar Ramirez Luna
2012-09-12 19:45 ` Omar Ramirez Luna [this message]
2012-09-12 19:45 ` [PATCH v2 7/9] ARM: OMAP: iommu: optimize save and restore routines Omar Ramirez Luna
2012-09-18 18:04 ` Tony Lindgren
2012-09-19 0:53 ` Omar Ramirez Luna
2012-09-12 19:45 ` [PATCH v2 8/9] ARM: OMAP: iommu: add device tree support Omar Ramirez Luna
2012-10-02 21:25 ` Matt Porter
2012-10-03 21:13 ` Omar Ramirez Luna
2012-09-12 19:45 ` [PATCH v2 9/9] arm/dts: OMAP3/4: Add iommu nodes Omar Ramirez Luna
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=1347479152-588-7-git-send-email-omar.luna@linaro.org \
--to=omar.luna@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).