Skip to content

Commit 58ebba3

Browse files
shawn1221storulf
authored andcommitted
pmdomain: rockchip: Add smc call to inform firmware
Inform firmware to keep the power domain on or off. Suggested-by: Ulf Hansson <[email protected]> Signed-off-by: Shawn Lin <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Acked-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent cd3fa30 commit 58ebba3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/pmdomain/rockchip/pm-domains.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (c) 2015 ROCKCHIP, Co. Ltd.
66
*/
77

8+
#include <linux/arm-smccc.h>
89
#include <linux/io.h>
910
#include <linux/iopoll.h>
1011
#include <linux/err.h>
@@ -20,6 +21,7 @@
2021
#include <linux/regmap.h>
2122
#include <linux/mfd/syscon.h>
2223
#include <soc/rockchip/pm_domains.h>
24+
#include <soc/rockchip/rockchip_sip.h>
2325
#include <dt-bindings/power/px30-power.h>
2426
#include <dt-bindings/power/rockchip,rv1126-power.h>
2527
#include <dt-bindings/power/rk3036-power.h>
@@ -540,6 +542,7 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
540542
struct generic_pm_domain *genpd = &pd->genpd;
541543
u32 pd_pwr_offset = pd->info->pwr_offset;
542544
bool is_on, is_mem_on = false;
545+
struct arm_smccc_res res;
543546

544547
if (pd->info->pwr_mask == 0)
545548
return;
@@ -567,6 +570,11 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
567570
genpd->name, is_on);
568571
return;
569572
}
573+
574+
/* Inform firmware to keep this pd on or off */
575+
arm_smccc_smc(ROCKCHIP_SIP_SUSPEND_MODE, ROCKCHIP_SLEEP_PD_CONFIG,
576+
pmu->info->pwr_offset + pd_pwr_offset,
577+
pd->info->pwr_mask, on, 0, 0, 0, &res);
570578
}
571579

572580
static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)

0 commit comments

Comments
 (0)