summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictoria Milhoan <vicki.milhoan@freescale.com>2014-12-18 14:06:50 -0700
committerJason Liu <r64343@freescale.com>2014-12-22 13:03:48 +0800
commit4ca9ec417ce3c7fbd5594ada108fe9febdd8f1e2 (patch)
tree467a7714cd65f4fbfbaf1181649f1c37bfb3b492
parentd23585ec8e4753f943740c64ed9f781514b11dd1 (diff)
MLK-10036 Freescale CAAM: Add support for DSM with Mega/Fast mix on
This patch allows CAAM to be enabled as a wakeup source for the Mega/Fast mix domain. If CAAM is enabled as a wakeup source, it will continue to be powered on across Deep Sleep Mode (DSM). This allows CAAM to be functional after the system resumes from DSM. Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com> (cherry picked from commit 290744e3b40a563319324e234fa5a65b49fd4d82)
-rw-r--r--drivers/crypto/caam/jr.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index d62448c73231..56b53b18ce11 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -521,9 +521,39 @@ static int caam_jr_probe(struct platform_device *pdev)
atomic_set(&jrpriv->tfm_count, 0);
+ device_init_wakeup(&pdev->dev, 1);
+ device_set_wakeup_enable(&pdev->dev, false);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+static int caam_jr_suspend(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct caam_drv_private_jr *jrpriv = platform_get_drvdata(pdev);
+
+ if (device_may_wakeup(&pdev->dev))
+ enable_irq_wake(jrpriv->irq);
+
return 0;
}
+static int caam_jr_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct caam_drv_private_jr *jrpriv = platform_get_drvdata(pdev);
+
+ if (device_may_wakeup(&pdev->dev))
+ disable_irq_wake(jrpriv->irq);
+
+ return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(caam_jr_pm_ops, caam_jr_suspend,
+ caam_jr_resume);
+#endif
+
static struct of_device_id caam_jr_match[] = {
{
.compatible = "fsl,sec-v4.0-job-ring",
@@ -540,6 +570,9 @@ static struct platform_driver caam_jr_driver = {
.name = "caam_jr",
.owner = THIS_MODULE,
.of_match_table = caam_jr_match,
+#ifdef CONFIG_PM
+ .pm = &caam_jr_pm_ops,
+#endif
},
.probe = caam_jr_probe,
.remove = caam_jr_remove,