1 From 1ffdfbcd42dbb87f2841e45c0719a3fbcb2fe926 Mon Sep 17 00:00:00 2001
2 From: Victoria Milhoan <vicki.milhoan@freescale.com>
3 Date: Thu, 18 Dec 2014 14:06:50 -0700
4 Subject: [PATCH] MLK-10036 crypto: caam - add support for DSM with Mega/Fast
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 This patch allows CAAM to be enabled as a wakeup source for the
11 Mega/Fast mix domain. If CAAM is enabled as a wakeup source, it
12 will continue to be powered on across Deep Sleep Mode (DSM). This
13 allows CAAM to be functional after the system resumes from DSM.
15 Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
16 (cherry picked from commit 290744e3b40a563319324e234fa5a65b49fd4d82)
17 Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
18 Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
19 (cherry picked from commit 0bf9c6f84f1d74d9e6d9384c4b11bbdf9301c94e)
21 Changed commit headline prefix.
23 Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
25 drivers/crypto/caam/jr.c | 33 +++++++++++++++++++++++++++++++++
26 1 file changed, 33 insertions(+)
28 --- a/drivers/crypto/caam/jr.c
29 +++ b/drivers/crypto/caam/jr.c
30 @@ -561,11 +561,41 @@ static int caam_jr_probe(struct platform
32 atomic_set(&jrpriv->tfm_count, 0);
34 + device_init_wakeup(&pdev->dev, 1);
35 + device_set_wakeup_enable(&pdev->dev, false);
37 register_algs(jrdev->parent);
43 +static int caam_jr_suspend(struct device *dev)
45 + struct platform_device *pdev = to_platform_device(dev);
46 + struct caam_drv_private_jr *jrpriv = platform_get_drvdata(pdev);
48 + if (device_may_wakeup(&pdev->dev))
49 + enable_irq_wake(jrpriv->irq);
54 +static int caam_jr_resume(struct device *dev)
56 + struct platform_device *pdev = to_platform_device(dev);
57 + struct caam_drv_private_jr *jrpriv = platform_get_drvdata(pdev);
59 + if (device_may_wakeup(&pdev->dev))
60 + disable_irq_wake(jrpriv->irq);
65 +static SIMPLE_DEV_PM_OPS(caam_jr_pm_ops, caam_jr_suspend,
69 static const struct of_device_id caam_jr_match[] = {
71 .compatible = "fsl,sec-v4.0-job-ring",
72 @@ -581,6 +611,9 @@ static struct platform_driver caam_jr_dr
75 .of_match_table = caam_jr_match,
77 + .pm = &caam_jr_pm_ops,
80 .probe = caam_jr_probe,
81 .remove = caam_jr_remove,