summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Shubin <n.shubin@yadro.com>2021-11-10 12:42:25 +0300
committerAnup Patel <anup@brainfault.org>2021-11-12 07:45:54 +0300
commit94eba23376b5324f012e8e035a341d6d2d625b27 (patch)
tree6b3e66afe0d0ea4872a4c5caacfd42dec42257b6
parent31fe5a7a3d80f0ceb25005740313cee1ef3fd4f6 (diff)
downloadopensbi-94eba23376b5324f012e8e035a341d6d2d625b27.tar.xz
lib: utils/reset: add priority to gpio reset
Make gpio_system_reset_check return priority instead of just true/false. Make default 128 priority for reset/shutdown. Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Tested-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
-rw-r--r--lib/utils/reset/fdt_reset_gpio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/utils/reset/fdt_reset_gpio.c b/lib/utils/reset/fdt_reset_gpio.c
index 302035b..d28b6f5 100644
--- a/lib/utils/reset/fdt_reset_gpio.c
+++ b/lib/utils/reset/fdt_reset_gpio.c
@@ -77,7 +77,10 @@ static void gpio_reset_exec(struct gpio_reset *reset)
static int gpio_system_poweroff_check(u32 type, u32 reason)
{
- return !!gpio_reset_get(FALSE, type);
+ if (gpio_reset_get(FALSE, type))
+ return 128;
+
+ return 0;
}
static void gpio_system_poweroff(u32 type, u32 reason)
@@ -93,7 +96,10 @@ static struct sbi_system_reset_device gpio_poweroff = {
static int gpio_system_restart_check(u32 type, u32 reason)
{
- return !!gpio_reset_get(TRUE, type);
+ if (gpio_reset_get(TRUE, type))
+ return 128;
+
+ return 0;
}
static void gpio_system_restart(u32 type, u32 reason)