Commit 9a63f0f4 authored by Thierry Reding's avatar Thierry Reding Committed by Jassi Brar

mailbox: tegra-hsp: Add suspend/resume support

Upon resuming from a system sleep state, the interrupts for all active
shared mailboxes need to be reenabled, otherwise they will not work.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 91b1b1c3
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <dt-bindings/mailbox/tegra186-hsp.h> #include <dt-bindings/mailbox/tegra186-hsp.h>
...@@ -823,6 +824,23 @@ static int tegra_hsp_remove(struct platform_device *pdev) ...@@ -823,6 +824,23 @@ static int tegra_hsp_remove(struct platform_device *pdev)
return 0; return 0;
} }
static int tegra_hsp_resume(struct device *dev)
{
struct tegra_hsp *hsp = dev_get_drvdata(dev);
unsigned int i;
for (i = 0; i < hsp->num_sm; i++) {
struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
if (mb->channel.chan->cl)
tegra_hsp_mailbox_startup(mb->channel.chan);
}
return 0;
}
static SIMPLE_DEV_PM_OPS(tegra_hsp_pm_ops, NULL, tegra_hsp_resume);
static const struct tegra_hsp_db_map tegra186_hsp_db_map[] = { static const struct tegra_hsp_db_map tegra186_hsp_db_map[] = {
{ "ccplex", TEGRA_HSP_DB_MASTER_CCPLEX, HSP_DB_CCPLEX, }, { "ccplex", TEGRA_HSP_DB_MASTER_CCPLEX, HSP_DB_CCPLEX, },
{ "bpmp", TEGRA_HSP_DB_MASTER_BPMP, HSP_DB_BPMP, }, { "bpmp", TEGRA_HSP_DB_MASTER_BPMP, HSP_DB_BPMP, },
...@@ -849,6 +867,7 @@ static struct platform_driver tegra_hsp_driver = { ...@@ -849,6 +867,7 @@ static struct platform_driver tegra_hsp_driver = {
.driver = { .driver = {
.name = "tegra-hsp", .name = "tegra-hsp",
.of_match_table = tegra_hsp_match, .of_match_table = tegra_hsp_match,
.pm = &tegra_hsp_pm_ops,
}, },
.probe = tegra_hsp_probe, .probe = tegra_hsp_probe,
.remove = tegra_hsp_remove, .remove = tegra_hsp_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment