]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
power: reset: reboot-mode: Expose sysfs for registered reboot_modes
authorShivendra Pratap <shivendra.pratap@oss.qualcomm.com>
Tue, 24 Feb 2026 06:42:27 +0000 (12:12 +0530)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 3 Mar 2026 22:58:07 +0000 (23:58 +0100)
commitcfaf0a90789ac74391ac7583c86cdaaada78cdbb
treee8543b81fe0bf9dd03dfd835defc3ea4356299d5
parentd3da03025e6de538ca5af346c43526a2d5494582
power: reset: reboot-mode: Expose sysfs for registered reboot_modes

Currently, there is no standardized mechanism for userspace to discover
supported reboot modes on a platform. This limits userspace scripts, to
rely on hardcoded assumptions about the available reboot-modes.

Create a class 'reboot-mode' and a device under it. Use the name of the
registering driver as device name. Expose a sysfs interface under this
device to show available reboot mode arguments.

 This results in the creation of:
   /sys/class/reboot-mode/<driver>/reboot_modes

This read-only sysfs file will exposes the supported reboot mode
arguments provided by the registering driver, enabling userspace to
query the list of arguments.

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
Link: https://patch.msgid.link/20260224-next-15nov_expose_sysfs-v24-2-4ee5b49d5a06@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/reset/reboot-mode.c