1 From e108e2c34b3acc70ec55b7d0772abb79c96319b2 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Tue, 28 Jan 2020 09:33:52 +0100
4 Subject: [PATCH] reset: Move reset-simple header out of drivers/reset
6 The reset-simple code can be useful for drivers outside of drivers/reset
7 that have a few reset controls as part of their features. Let's move it to
10 Cc: Philipp Zabel <p.zabel@pengutronix.de>
11 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
13 drivers/reset/reset-simple.c | 3 +--
14 drivers/reset/reset-socfpga.c | 3 +--
15 drivers/reset/reset-sunxi.c | 3 +--
16 drivers/reset/reset-uniphier-glue.c | 3 +--
17 {drivers => include/linux}/reset/reset-simple.h | 0
18 5 files changed, 4 insertions(+), 8 deletions(-)
19 rename {drivers => include/linux}/reset/reset-simple.h (100%)
21 --- a/drivers/reset/reset-simple.c
22 +++ b/drivers/reset/reset-simple.c
24 #include <linux/of_device.h>
25 #include <linux/platform_device.h>
26 #include <linux/reset-controller.h>
27 +#include <linux/reset/reset-simple.h>
28 #include <linux/spinlock.h>
30 -#include "reset-simple.h"
32 static inline struct reset_simple_data *
33 to_reset_simple_data(struct reset_controller_dev *rcdev)
35 --- a/drivers/reset/reset-socfpga.c
36 +++ b/drivers/reset/reset-socfpga.c
38 #include <linux/of_address.h>
39 #include <linux/platform_device.h>
40 #include <linux/reset-controller.h>
41 +#include <linux/reset/reset-simple.h>
42 #include <linux/reset/socfpga.h>
43 #include <linux/slab.h>
44 #include <linux/spinlock.h>
45 #include <linux/types.h>
47 -#include "reset-simple.h"
49 #define SOCFPGA_NR_BANKS 8
51 static int a10_reset_init(struct device_node *np)
52 --- a/drivers/reset/reset-sunxi.c
53 +++ b/drivers/reset/reset-sunxi.c
55 #include <linux/of_address.h>
56 #include <linux/platform_device.h>
57 #include <linux/reset-controller.h>
58 +#include <linux/reset/reset-simple.h>
59 #include <linux/reset/sunxi.h>
60 #include <linux/slab.h>
61 #include <linux/spinlock.h>
62 #include <linux/types.h>
64 -#include "reset-simple.h"
66 static int sunxi_reset_init(struct device_node *np)
68 struct reset_simple_data *data;
69 --- a/drivers/reset/reset-uniphier-glue.c
70 +++ b/drivers/reset/reset-uniphier-glue.c
72 #include <linux/of_device.h>
73 #include <linux/platform_device.h>
74 #include <linux/reset.h>
76 -#include "reset-simple.h"
77 +#include <linux/reset/reset-simple.h>
81 --- a/drivers/reset/reset-simple.h
84 -/* SPDX-License-Identifier: GPL-2.0-or-later */
86 - * Simple Reset Controller ops
88 - * Based on Allwinner SoCs Reset Controller driver
90 - * Copyright 2013 Maxime Ripard
92 - * Maxime Ripard <maxime.ripard@free-electrons.com>
95 -#ifndef __RESET_SIMPLE_H__
96 -#define __RESET_SIMPLE_H__
98 -#include <linux/io.h>
99 -#include <linux/reset-controller.h>
100 -#include <linux/spinlock.h>
103 - * struct reset_simple_data - driver data for simple reset controllers
104 - * @lock: spinlock to protect registers during read-modify-write cycles
105 - * @membase: memory mapped I/O register range
106 - * @rcdev: reset controller device base structure
107 - * @active_low: if true, bits are cleared to assert the reset. Otherwise, bits
108 - * are set to assert the reset. Note that this says nothing about
109 - * the voltage level of the actual reset line.
110 - * @status_active_low: if true, bits read back as cleared while the reset is
111 - * asserted. Otherwise, bits read back as set while the
112 - * reset is asserted.
114 -struct reset_simple_data {
116 - void __iomem *membase;
117 - struct reset_controller_dev rcdev;
119 - bool status_active_low;
122 -extern const struct reset_control_ops reset_simple_ops;
124 -#endif /* __RESET_SIMPLE_H__ */
126 +++ b/include/linux/reset/reset-simple.h
128 +/* SPDX-License-Identifier: GPL-2.0-or-later */
130 + * Simple Reset Controller ops
132 + * Based on Allwinner SoCs Reset Controller driver
134 + * Copyright 2013 Maxime Ripard
136 + * Maxime Ripard <maxime.ripard@free-electrons.com>
139 +#ifndef __RESET_SIMPLE_H__
140 +#define __RESET_SIMPLE_H__
142 +#include <linux/io.h>
143 +#include <linux/reset-controller.h>
144 +#include <linux/spinlock.h>
147 + * struct reset_simple_data - driver data for simple reset controllers
148 + * @lock: spinlock to protect registers during read-modify-write cycles
149 + * @membase: memory mapped I/O register range
150 + * @rcdev: reset controller device base structure
151 + * @active_low: if true, bits are cleared to assert the reset. Otherwise, bits
152 + * are set to assert the reset. Note that this says nothing about
153 + * the voltage level of the actual reset line.
154 + * @status_active_low: if true, bits read back as cleared while the reset is
155 + * asserted. Otherwise, bits read back as set while the
156 + * reset is asserted.
158 +struct reset_simple_data {
160 + void __iomem *membase;
161 + struct reset_controller_dev rcdev;
163 + bool status_active_low;
166 +extern const struct reset_control_ops reset_simple_ops;
168 +#endif /* __RESET_SIMPLE_H__ */