Debian Codegraph @

drivers/reset/spacemit/reset-spacemit-common.h

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * SpacemiT reset controller driver - common definitions
4 */
5
6 #ifndef _RESET_SPACEMIT_COMMON_H_
7 #define _RESET_SPACEMIT_COMMON_H_
8
9 #include <linux/auxiliary_bus.h>
10 #include <linux/regmap.h>
11 #include <linux/reset-controller.h>
12 #include <linux/types.h>
13
14 struct ccu_reset_data {
15 u32 offset;
16 u32 assert_mask;
17 u32 deassert_mask;
18 };
19
20 struct ccu_reset_controller_data {
21 const struct ccu_reset_data *reset_data; /* array */
22 size_t count;
23 };
24
25 struct ccu_reset_controller {
26 struct reset_controller_dev rcdev;
27 const struct ccu_reset_controller_data *data;
28 struct regmap *regmap;
29 };
30
31 #define RESET_DATA(_offset, _assert_mask, _deassert_mask) \
32 { \
33 .offset = (_offset), \
34 .assert_mask = (_assert_mask), \
35 .deassert_mask = (_deassert_mask), \
36 }
37
38 /* Common probe function */
39 int spacemit_reset_probe(struct auxiliary_device *adev,
40 const struct auxiliary_device_id *id);
41
42 #endif /* _RESET_SPACEMIT_COMMON_H_ */