firmware-utils: bump to git HEAD
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0527-reset-Move-reset-simple-header-out-of-drivers-reset.patch
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
5
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
8 include/linux/reset.
9
10 Cc: Philipp Zabel <p.zabel@pengutronix.de>
11 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
12 ---
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%)
20
21 --- a/drivers/reset/reset-simple.c
22 +++ b/drivers/reset/reset-simple.c
23 @@ -18,10 +18,9 @@
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>
29
30 -#include "reset-simple.h"
31 -
32 static inline struct reset_simple_data *
33 to_reset_simple_data(struct reset_controller_dev *rcdev)
34 {
35 --- a/drivers/reset/reset-socfpga.c
36 +++ b/drivers/reset/reset-socfpga.c
37 @@ -11,13 +11,12 @@
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>
46
47 -#include "reset-simple.h"
48 -
49 #define SOCFPGA_NR_BANKS 8
50
51 static int a10_reset_init(struct device_node *np)
52 --- a/drivers/reset/reset-sunxi.c
53 +++ b/drivers/reset/reset-sunxi.c
54 @@ -14,13 +14,12 @@
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>
63
64 -#include "reset-simple.h"
65 -
66 static int sunxi_reset_init(struct device_node *np)
67 {
68 struct reset_simple_data *data;
69 --- a/drivers/reset/reset-uniphier-glue.c
70 +++ b/drivers/reset/reset-uniphier-glue.c
71 @@ -9,8 +9,7 @@
72 #include <linux/of_device.h>
73 #include <linux/platform_device.h>
74 #include <linux/reset.h>
75 -
76 -#include "reset-simple.h"
77 +#include <linux/reset/reset-simple.h>
78
79 #define MAX_CLKS 2
80 #define MAX_RSTS 2
81 --- a/drivers/reset/reset-simple.h
82 +++ /dev/null
83 @@ -1,41 +0,0 @@
84 -/* SPDX-License-Identifier: GPL-2.0-or-later */
85 -/*
86 - * Simple Reset Controller ops
87 - *
88 - * Based on Allwinner SoCs Reset Controller driver
89 - *
90 - * Copyright 2013 Maxime Ripard
91 - *
92 - * Maxime Ripard <maxime.ripard@free-electrons.com>
93 - */
94 -
95 -#ifndef __RESET_SIMPLE_H__
96 -#define __RESET_SIMPLE_H__
97 -
98 -#include <linux/io.h>
99 -#include <linux/reset-controller.h>
100 -#include <linux/spinlock.h>
101 -
102 -/**
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.
113 - */
114 -struct reset_simple_data {
115 - spinlock_t lock;
116 - void __iomem *membase;
117 - struct reset_controller_dev rcdev;
118 - bool active_low;
119 - bool status_active_low;
120 -};
121 -
122 -extern const struct reset_control_ops reset_simple_ops;
123 -
124 -#endif /* __RESET_SIMPLE_H__ */
125 --- /dev/null
126 +++ b/include/linux/reset/reset-simple.h
127 @@ -0,0 +1,41 @@
128 +/* SPDX-License-Identifier: GPL-2.0-or-later */
129 +/*
130 + * Simple Reset Controller ops
131 + *
132 + * Based on Allwinner SoCs Reset Controller driver
133 + *
134 + * Copyright 2013 Maxime Ripard
135 + *
136 + * Maxime Ripard <maxime.ripard@free-electrons.com>
137 + */
138 +
139 +#ifndef __RESET_SIMPLE_H__
140 +#define __RESET_SIMPLE_H__
141 +
142 +#include <linux/io.h>
143 +#include <linux/reset-controller.h>
144 +#include <linux/spinlock.h>
145 +
146 +/**
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.
157 + */
158 +struct reset_simple_data {
159 + spinlock_t lock;
160 + void __iomem *membase;
161 + struct reset_controller_dev rcdev;
162 + bool active_low;
163 + bool status_active_low;
164 +};
165 +
166 +extern const struct reset_control_ops reset_simple_ops;
167 +
168 +#endif /* __RESET_SIMPLE_H__ */