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>
This commit is contained in:
Kamel Bouhara
2023-06-20 08:26:57 +02:00
committed by Sebastian Reichel
parent 7b9fc309c0
commit d40befed9a
3 changed files with 58 additions and 10 deletions

View File

@@ -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 */