summaryrefslogtreecommitdiffstats
path: root/include/linux/reboot-mode.h
blob: 92a1da7b55620e9497905505ebfaac937b6b2855 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __REBOOT_MODE_H__
#define __REBOOT_MODE_H__

#include <linux/types.h>

struct device_d;

#ifdef CONFIG_REBOOT_MODE
struct reboot_mode_driver {
	struct device_d *dev;
	int (*write)(struct reboot_mode_driver *reboot, u32 magic);
	int priority;

	/* filled by reboot_mode_register */
	int reboot_mode_prev, reboot_mode_next;
	unsigned nmodes;
	const char **modes;
	u32 *magics;
};

int reboot_mode_register(struct reboot_mode_driver *reboot, u32 reboot_mode);
const char *reboot_mode_get(void);

#define REBOOT_MODE_DEFAULT_PRIORITY 100

#else

static inline const char *reboot_mode_get(void)
{
	return NULL;
}

#endif

#endif