summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorVictoria Milhoan <vicki.milhoan@freescale.com>2014-12-18 14:06:50 -0700
committerNitin Garg <nitin.garg@freescale.com>2015-04-14 14:01:52 -0500
commit6076bef8fbb039b728198356d242229339948d3c (patch)
tree8add74f717f97a98ae627f3895c3ad40158d7967 /drivers/crypto
parentced85dff789524172fa7535df6dfd4e9c2003813 (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)
Diffstat (limited to 'drivers/crypto')
-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 e139c9dcbab8..54b326d721c2 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -517,9 +517,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",
@@ -536,6 +566,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,