1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2016 Maxime Ripard. All rights reserved.
4  */
5 
6 #ifndef _CCU_RESET_H_
7 #define _CCU_RESET_H_
8 
9 #include <hal_atomic.h>
10 #include <hal_reset.h>
11 
12 struct ccu_reset_map
13 {
14     u32 reg;
15     u32 bit;
16 };
17 
18 struct ccu_reset
19 {
20     unsigned long base;
21 
22     struct ccu_reset_map    *reset_map;
23     hal_spinlock_t      lock;
24 
25     struct reset_control_dev  rcdev;
26 };
27 
rc_to_ccu_reset(struct reset_control_dev * rcdev)28 static inline struct ccu_reset *rc_to_ccu_reset(struct reset_control_dev *rcdev)
29 {
30     return container_of(rcdev, struct ccu_reset, rcdev);
31 }
32 
33 extern const struct reset_control_ops ccu_reset_ops;
34 
35 #endif /* _CCU_RESET_H_ */
36