summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:52 +0200
commit2aa7ff0ae2bf2db33e358f18bec5a0239d244aa5 (patch)
tree9417d44f527a5ed3876ff651946cc0a15f658e87 /include
parent3b9ce49e17897cc053ed8416685e79902d7432a1 (diff)
parent764941b17e53e40dd1df1ac3137ebc825d5d6480 (diff)
downloadbarebox-2aa7ff0ae2bf2db33e358f18bec5a0239d244aa5.tar.gz
barebox-2aa7ff0ae2bf2db33e358f18bec5a0239d244aa5.tar.xz
Merge branch 'for-next/reboot-mode' into master
Diffstat (limited to 'include')
-rw-r--r--include/linux/reboot-mode.h38
-rw-r--r--include/of.h2
2 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h
new file mode 100644
index 0000000000..9d9ce19c0e
--- /dev/null
+++ b/include/linux/reboot-mode.h
@@ -0,0 +1,38 @@
+/* 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, const u32 *magic);
+ int priority;
+ bool no_fixup;
+
+ /* filled by reboot_mode_register */
+ int reboot_mode_prev, reboot_mode_next;
+ unsigned nmodes, nelems;
+ const char **modes;
+ u32 *magics;
+};
+
+int reboot_mode_register(struct reboot_mode_driver *reboot,
+ const u32 *magic, size_t num);
+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
diff --git a/include/of.h b/include/of.h
index e60cb5307d..f27a0b8ccd 100644
--- a/include/of.h
+++ b/include/of.h
@@ -734,6 +734,8 @@ static inline int of_autoenable_i2c_by_component(char *path)
#endif
+#define for_each_property_of_node(dn, pp) \
+ list_for_each_entry(pp, &dn->properties, list)
#define for_each_node_by_name(dn, name) \
for (dn = of_find_node_by_name(NULL, name); dn; \
dn = of_find_node_by_name(dn, name))