diff options
author | Eddie Huang <eddie.huang@mediatek.com> | 2015-08-26 03:14:41 -0400 |
---|---|---|
committer | Matthias Brugger <matthias.bgg@gmail.com> | 2015-09-27 09:18:33 -0400 |
commit | 47e90154fafd1a1310e3c5baed77d8f4c33ab271 (patch) | |
tree | 7398d40fc8f4527b159ad47295b2e7eeb9966e6d /drivers/soc | |
parent | bbe379fc7ca5cae09b1bc44fe5ee4173ad883fbf (diff) |
soc: mediatek: add scpsys support active_wakeup
Register gpd_dev_ops.active_wakeup function to support keep power
during suspend state. And add flag to each power domain to
decide whether keep power during suspend or not.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/mediatek/mtk-scpsys.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c index 164a7d8439b1..55ab08ffc010 100644 --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c | |||
@@ -68,6 +68,7 @@ struct scp_domain_data { | |||
68 | u32 sram_pdn_ack_bits; | 68 | u32 sram_pdn_ack_bits; |
69 | u32 bus_prot_mask; | 69 | u32 bus_prot_mask; |
70 | enum clk_id clk_id; | 70 | enum clk_id clk_id; |
71 | bool active_wakeup; | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | static const struct scp_domain_data scp_domain_data[] __initconst = { | 74 | static const struct scp_domain_data scp_domain_data[] __initconst = { |
@@ -128,6 +129,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = { | |||
128 | .sram_pdn_bits = GENMASK(11, 8), | 129 | .sram_pdn_bits = GENMASK(11, 8), |
129 | .sram_pdn_ack_bits = GENMASK(15, 12), | 130 | .sram_pdn_ack_bits = GENMASK(15, 12), |
130 | .clk_id = MT8173_CLK_NONE, | 131 | .clk_id = MT8173_CLK_NONE, |
132 | .active_wakeup = true, | ||
131 | }, | 133 | }, |
132 | [MT8173_POWER_DOMAIN_MFG_ASYNC] = { | 134 | [MT8173_POWER_DOMAIN_MFG_ASYNC] = { |
133 | .name = "mfg_async", | 135 | .name = "mfg_async", |
@@ -172,6 +174,7 @@ struct scp_domain { | |||
172 | u32 sram_pdn_bits; | 174 | u32 sram_pdn_bits; |
173 | u32 sram_pdn_ack_bits; | 175 | u32 sram_pdn_ack_bits; |
174 | u32 bus_prot_mask; | 176 | u32 bus_prot_mask; |
177 | bool active_wakeup; | ||
175 | }; | 178 | }; |
176 | 179 | ||
177 | struct scp { | 180 | struct scp { |
@@ -371,6 +374,17 @@ out: | |||
371 | return ret; | 374 | return ret; |
372 | } | 375 | } |
373 | 376 | ||
377 | static bool scpsys_active_wakeup(struct device *dev) | ||
378 | { | ||
379 | struct generic_pm_domain *genpd; | ||
380 | struct scp_domain *scpd; | ||
381 | |||
382 | genpd = pd_to_genpd(dev->pm_domain); | ||
383 | scpd = container_of(genpd, struct scp_domain, genpd); | ||
384 | |||
385 | return scpd->active_wakeup; | ||
386 | } | ||
387 | |||
374 | static int __init scpsys_probe(struct platform_device *pdev) | 388 | static int __init scpsys_probe(struct platform_device *pdev) |
375 | { | 389 | { |
376 | struct genpd_onecell_data *pd_data; | 390 | struct genpd_onecell_data *pd_data; |
@@ -428,12 +442,14 @@ static int __init scpsys_probe(struct platform_device *pdev) | |||
428 | scpd->sram_pdn_bits = data->sram_pdn_bits; | 442 | scpd->sram_pdn_bits = data->sram_pdn_bits; |
429 | scpd->sram_pdn_ack_bits = data->sram_pdn_ack_bits; | 443 | scpd->sram_pdn_ack_bits = data->sram_pdn_ack_bits; |
430 | scpd->bus_prot_mask = data->bus_prot_mask; | 444 | scpd->bus_prot_mask = data->bus_prot_mask; |
445 | scpd->active_wakeup = data->active_wakeup; | ||
431 | if (data->clk_id != MT8173_CLK_NONE) | 446 | if (data->clk_id != MT8173_CLK_NONE) |
432 | scpd->clk = clk[data->clk_id]; | 447 | scpd->clk = clk[data->clk_id]; |
433 | 448 | ||
434 | genpd->name = data->name; | 449 | genpd->name = data->name; |
435 | genpd->power_off = scpsys_power_off; | 450 | genpd->power_off = scpsys_power_off; |
436 | genpd->power_on = scpsys_power_on; | 451 | genpd->power_on = scpsys_power_on; |
452 | genpd->dev_ops.active_wakeup = scpsys_active_wakeup; | ||
437 | 453 | ||
438 | /* | 454 | /* |
439 | * Initially turn on all domains to make the domains usable | 455 | * Initially turn on all domains to make the domains usable |