summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm_crb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tpm/tpm_crb.c')
-rw-r--r--drivers/char/tpm/tpm_crb.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 421dfa959a4f..cb6fb131963f 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -502,10 +502,33 @@ static int crb_pm_runtime_resume(struct device *dev)
return crb_cmd_ready(dev, priv);
}
+
+static int crb_pm_suspend(struct device *dev)
+{
+ int ret;
+
+ ret = tpm_pm_suspend(dev);
+ if (ret)
+ return ret;
+
+ return crb_pm_runtime_suspend(dev);
+}
+
+static int crb_pm_resume(struct device *dev)
+{
+ int ret;
+
+ ret = crb_pm_runtime_resume(dev);
+ if (ret)
+ return ret;
+
+ return tpm_pm_resume(dev);
+}
+
#endif /* CONFIG_PM */
static const struct dev_pm_ops crb_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(tpm_pm_suspend, tpm_pm_resume)
+ SET_SYSTEM_SLEEP_PM_OPS(crb_pm_suspend, crb_pm_resume)
SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)
};