From ef06da289014f33b795f639f1e1db84d4cfefb96 Mon Sep 17 00:00:00 2001 From: shengfei Xu Date: Sat, 30 Sep 2017 14:51:45 +0800 Subject: [PATCH] soc: rockchip: rockchip_pm_config: set the real pin number to ATF If the gpio base is started from 1000, The real pin number is "gpio number - 1000". Change-Id: If9b627ce9689105d0cdb7314869d598b4132f486 Signed-off-by: shengfei Xu --- drivers/soc/rockchip/rockchip_pm_config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/soc/rockchip/rockchip_pm_config.c b/drivers/soc/rockchip/rockchip_pm_config.c index 168b45594139..64889f63187d 100644 --- a/drivers/soc/rockchip/rockchip_pm_config.c +++ b/drivers/soc/rockchip/rockchip_pm_config.c @@ -126,6 +126,7 @@ static int __init pm_config_init(struct platform_device *pdev) enum of_gpio_flags flags; int i = 0; int length; + int pin_num; match_id = of_match_node(pm_match_table, pdev->dev.of_node); if (!match_id) @@ -171,9 +172,11 @@ static int __init pm_config_init(struct platform_device *pdev) &flags); if (!gpio_is_valid(gpio_temp[i])) break; + /* get the real pin number */ + pin_num = gpio_temp[i] - ARCH_GPIO_BASE; sip_smc_set_suspend_mode(GPIO_POWER_CONFIG, i, - gpio_temp[i]); + pin_num); } } sip_smc_set_suspend_mode(GPIO_POWER_CONFIG, i, PM_INVALID_GPIO);