crypto: omap-sham - Add suspend/resume support
authorMark A. Greer <mgreer@animalcreek.com>
Fri, 21 Dec 2012 17:04:03 +0000 (10:04 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 5 Jan 2013 10:43:56 +0000 (21:43 +1100)
Add suspend/resume support to the OMAP SHAM driver.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-sham.c

index 777eb9fdd096691fb2ebd4b0f7b6e78d0659912d..9c3b096e15e8c238b9bbf7f5e29c695c74702e06 100644 (file)
@@ -1269,12 +1269,31 @@ static int __devexit omap_sham_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int omap_sham_suspend(struct device *dev)
+{
+       pm_runtime_put_sync(dev);
+       return 0;
+}
+
+static int omap_sham_resume(struct device *dev)
+{
+       pm_runtime_get_sync(dev);
+       return 0;
+}
+#endif
+
+static const struct dev_pm_ops omap_sham_pm_ops = {
+       SET_SYSTEM_SLEEP_PM_OPS(omap_sham_suspend, omap_sham_resume)
+};
+
 static struct platform_driver omap_sham_driver = {
        .probe  = omap_sham_probe,
        .remove = omap_sham_remove,
        .driver = {
                .name   = "omap-sham",
                .owner  = THIS_MODULE,
+               .pm     = &omap_sham_pm_ops,
        },
 };