Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a30eceb7 authored by Marc Gonzalez's avatar Marc Gonzalez Committed by Arnd Bergmann
Browse files

ARM: tango: add Suspend-to-RAM support



Ask firmware to put RAM in self-refresh mode and power system down.

    echo mem > /sys/power/state

See Documentation/power/states.txt

Signed-off-by: default avatarMarc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 2e2843f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3,3 +3,4 @@ AFLAGS_smc.o := -Wa,-march=armv7-a$(plus_sec)

obj-y += setup.o smc.o
obj-$(CONFIG_SMP) += platsmp.o
obj-$(CONFIG_SUSPEND) += pm.o
+32 −0
Original line number Diff line number Diff line
#include <linux/init.h>
#include <linux/suspend.h>
#include <asm/suspend.h>
#include "smc.h"

static int tango_pm_powerdown(unsigned long arg)
{
	tango_suspend(virt_to_phys(cpu_resume));

	return -EIO; /* tango_suspend has failed */
}

static int tango_pm_enter(suspend_state_t state)
{
	if (state == PM_SUSPEND_MEM)
		return cpu_suspend(0, tango_pm_powerdown);

	return -EINVAL;
}

static const struct platform_suspend_ops tango_pm_ops = {
	.enter = tango_pm_enter,
	.valid = suspend_valid_only_mem,
};

static int __init tango_pm_init(void)
{
	suspend_set_ops(&tango_pm_ops);
	return 0;
}

late_initcall(tango_pm_init);
+1 −0
Original line number Diff line number Diff line
@@ -3,5 +3,6 @@ extern int tango_smc(unsigned int val, unsigned int service);
#define tango_set_l2_control(val)	tango_smc(val, 0x102)
#define tango_start_aux_core(val)	tango_smc(val, 0x104)
#define tango_set_aux_boot_addr(val)	tango_smc(val, 0x105)
#define tango_suspend(val)		tango_smc(val, 0x120)
#define tango_aux_core_die(val)		tango_smc(val, 0x121)
#define tango_aux_core_kill(val)	tango_smc(val, 0x122)