Message ID | 20191220100740.117897-2-kamel.bouhara@bootlin.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v4,1/2] power: reset: at91-reset: export reset reason through sysfs | expand |
Le vendredi 20 décembre 2019 à 11:07 +0100, Kamel Bouhara a écrit : > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > This introduce some generic sources of reset reason to expose through > sysfs interface. Update the ABI documentation to list current power on > sources. > > Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> > --- > .../sysfs-devices-platform-power-on-reason | 12 ++++++++++++ > include/linux/power/power_on_reason.h | 19 +++++++++++++++++++ > 2 files changed, 31 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-power- > on-reason > create mode 100644 include/linux/power/power_on_reason.h > > diff --git a/Documentation/ABI/testing/sysfs-devices-platform-power-on- > reason b/Documentation/ABI/testing/sysfs-devices-platform-power-on-reason > new file mode 100644 > index 000000000000..918ab178fee7 > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-devices-platform-power-on-reason > @@ -0,0 +1,12 @@ > +What: /sys/devices/platform/.../power_on_reason > + > +Date: October 2019 > +KernelVersion: 5.5 > +Contact: Kamel Bouhara <kamel.bouhara@bootlin.com> > +Description: This file shows system power on reason. > + The possible sources are: > + General System Power-ON, RTC wakeup, Watchdog timeout, > + Software reset, User reset button, CPU clock failure, > + Oscillator Failure, Low power mode exit, Unknown. > + > + The file is read only. > diff --git a/include/linux/power/power_on_reason.h > b/include/linux/power/power_on_reason.h > new file mode 100644 > index 000000000000..5ef8e78f3de4 > --- /dev/null > +++ b/include/linux/power/power_on_reason.h > @@ -0,0 +1,19 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Author: Kamel Bouhara <kamel.bouhara@bootlin.com> > + */ > + > +#ifndef POWER_ON_REASON_H > +#define POWER_ON_REASON_H > + > +#define POWER_ON_REASON_GENERAL "General system power-on" > +#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_USER "User reset button" > +#define POWER_ON_REASON_CPU_FAIL "CPU clock failure" > +#define POWER_ON_REASON_XTAL_FAIL "Crystal oscillator failure" > +#define POWER_ON_REASON_LOW_POWER "Low power mode exit" > +#define POWER_ON_REASON_UNKNOWN "Unknown" > + > +#endif /* POWER_ON_REASON_H */ > -- > 2.24.0 >
diff --git a/Documentation/ABI/testing/sysfs-devices-platform-power-on-reason b/Documentation/ABI/testing/sysfs-devices-platform-power-on-reason new file mode 100644 index 000000000000..918ab178fee7 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-platform-power-on-reason @@ -0,0 +1,12 @@ +What: /sys/devices/platform/.../power_on_reason + +Date: October 2019 +KernelVersion: 5.5 +Contact: Kamel Bouhara <kamel.bouhara@bootlin.com> +Description: This file shows system power on reason. + The possible sources are: + General System Power-ON, RTC wakeup, Watchdog timeout, + Software reset, User reset button, CPU clock failure, + Oscillator Failure, Low power mode exit, Unknown. + + The file is read only. diff --git a/include/linux/power/power_on_reason.h b/include/linux/power/power_on_reason.h new file mode 100644 index 000000000000..5ef8e78f3de4 --- /dev/null +++ b/include/linux/power/power_on_reason.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Author: Kamel Bouhara <kamel.bouhara@bootlin.com> + */ + +#ifndef POWER_ON_REASON_H +#define POWER_ON_REASON_H + +#define POWER_ON_REASON_GENERAL "General system power-on" +#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_USER "User reset button" +#define POWER_ON_REASON_CPU_FAIL "CPU clock failure" +#define POWER_ON_REASON_XTAL_FAIL "Crystal oscillator failure" +#define POWER_ON_REASON_LOW_POWER "Low power mode exit" +#define POWER_ON_REASON_UNKNOWN "Unknown" + +#endif /* POWER_ON_REASON_H */
This introduce some generic sources of reset reason to expose through sysfs interface. Update the ABI documentation to list current power on sources. Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com> --- .../sysfs-devices-platform-power-on-reason | 12 ++++++++++++ include/linux/power/power_on_reason.h | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-power-on-reason create mode 100644 include/linux/power/power_on_reason.h