summaryrefslogtreecommitdiffstats
path: root/include/linux/power
diff options
context:
space:
mode:
authorKamel Bouhara <kamel.bouhara@bootlin.com>2023-06-20 08:26:57 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2023-07-19 23:15:21 +0200
commitd40befed9a581740f6ceb0e5998ec2f59bfbc559 (patch)
treef3e86211c054264c3cdb4c78318d3ec7dc04c2af /include/linux/power
parent7b9fc309c0b57c5b1230bf3e0a8bb9e937eb6529 (diff)
downloadlinux-d40befed9a581740f6ceb0e5998ec2f59bfbc559.tar.gz
linux-d40befed9a581740f6ceb0e5998ec2f59bfbc559.tar.bz2
linux-d40befed9a581740f6ceb0e5998ec2f59bfbc559.zip
power: reset: at91-reset: add sysfs interface to the power on reason
Introduce a list of generic reset sources and use them to export the power on reason through sysfs. Update the ABI documentation to describe this new interface. Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> [Miquel Raynal: Follow-up on Kamel's work, 4 years later] Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include/linux/power')
-rw-r--r--include/linux/power/power_on_reason.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/power/power_on_reason.h b/include/linux/power/power_on_reason.h
new file mode 100644
index 000000000000..95a1ec0c403c
--- /dev/null
+++ b/include/linux/power/power_on_reason.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Author: Kamel Bouhra <kamel.bouhara@bootlin.com>
+ */
+
+#ifndef POWER_ON_REASON_H
+#define POWER_ON_REASON_H
+
+#define POWER_ON_REASON_REGULAR "regular power-up"
+#define POWER_ON_REASON_RTC "RTC wakeup"
+#define POWER_ON_REASON_WATCHDOG "watchdog timeout"
+#define POWER_ON_REASON_SOFTWARE "software reset"
+#define POWER_ON_REASON_RST_BTN "reset button action"
+#define POWER_ON_REASON_CPU_CLK_FAIL "CPU clock failure"
+#define POWER_ON_REASON_XTAL_FAIL "crystal oscillator failure"
+#define POWER_ON_REASON_BROWN_OUT "brown-out reset"
+#define POWER_ON_REASON_UNKNOWN "unknown reason"
+
+#endif /* POWER_ON_REASON_H */