summaryrefslogtreecommitdiff
path: root/arch/arm/mach-at91/pm_data-offsets.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-01-31 18:12:57 +0100
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-03-31 20:36:05 +0200
commit65cc1a59d192be1df33633d3fe668a1e3e0edc36 (patch)
tree0d9b421633860e02720fde8bc6db10e4ef10e7ae /arch/arm/mach-at91/pm_data-offsets.c
parent9e07c3ce2c1054af503b0cb5860df0f8c8ee2619 (diff)
ARM: at91: pm: Use struct at91_pm_data in pm_suspend.S
The number of register we can safely pass to at91_pm_suspend_in_sram is limited. Instead, pass the address to the at91_pm_data structure. The offsets are automatically generated to avoid hardcoding them. Acked-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'arch/arm/mach-at91/pm_data-offsets.c')
-rw-r--r--arch/arm/mach-at91/pm_data-offsets.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/pm_data-offsets.c b/arch/arm/mach-at91/pm_data-offsets.c
new file mode 100644
index 000000000000..30302cb16df0
--- /dev/null
+++ b/arch/arm/mach-at91/pm_data-offsets.c
@@ -0,0 +1,13 @@
+#include <linux/stddef.h>
+#include <linux/kbuild.h>
+#include "pm.h"
+
+int main(void)
+{
+ DEFINE(PM_DATA_PMC, offsetof(struct at91_pm_data, pmc));
+ DEFINE(PM_DATA_RAMC0, offsetof(struct at91_pm_data, ramc[0]));
+ DEFINE(PM_DATA_RAMC1, offsetof(struct at91_pm_data, ramc[1]));
+ DEFINE(PM_DATA_MEMCTRL, offsetof(struct at91_pm_data, memctrl));
+ DEFINE(PM_DATA_MODE, offsetof(struct at91_pm_data, mode));
+ return 0;
+}