aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/reset
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2020-05-27 17:47:31 +0200
committerPhilipp Zabel <p.zabel@pengutronix.de>2020-06-16 14:19:56 +0200
commit9357b04624013294e4204b1a837d0a611b9048c3 (patch)
tree2a4a880dcf38834fbf1c5e0b8b5dc4d591737a15 /include/linux/reset
parentLinux 5.8-rc1 (diff)
downloadwireguard-linux-9357b04624013294e4204b1a837d0a611b9048c3.tar.xz
wireguard-linux-9357b04624013294e4204b1a837d0a611b9048c3.zip
reset: Move reset-simple header out of drivers/reset
The reset-simple code can be useful for drivers outside of drivers/reset that have a few reset controls as part of their features. Let's move it to include/linux/reset. Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'include/linux/reset')
-rw-r--r--include/linux/reset/reset-simple.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/linux/reset/reset-simple.h b/include/linux/reset/reset-simple.h
new file mode 100644
index 000000000000..08ccb25a55e6
--- /dev/null
+++ b/include/linux/reset/reset-simple.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Simple Reset Controller ops
+ *
+ * Based on Allwinner SoCs Reset Controller driver
+ *
+ * Copyright 2013 Maxime Ripard
+ *
+ * Maxime Ripard <maxime.ripard@free-electrons.com>
+ */
+
+#ifndef __RESET_SIMPLE_H__
+#define __RESET_SIMPLE_H__
+
+#include <linux/io.h>
+#include <linux/reset-controller.h>
+#include <linux/spinlock.h>
+
+/**
+ * struct reset_simple_data - driver data for simple reset controllers
+ * @lock: spinlock to protect registers during read-modify-write cycles
+ * @membase: memory mapped I/O register range
+ * @rcdev: reset controller device base structure
+ * @active_low: if true, bits are cleared to assert the reset. Otherwise, bits
+ * are set to assert the reset. Note that this says nothing about
+ * the voltage level of the actual reset line.
+ * @status_active_low: if true, bits read back as cleared while the reset is
+ * asserted. Otherwise, bits read back as set while the
+ * reset is asserted.
+ */
+struct reset_simple_data {
+ spinlock_t lock;
+ void __iomem *membase;
+ struct reset_controller_dev rcdev;
+ bool active_low;
+ bool status_active_low;
+};
+
+extern const struct reset_control_ops reset_simple_ops;
+
+#endif /* __RESET_SIMPLE_H__ */