xref: /openbmc/linux/drivers/clk/sunxi-ng/ccu_reset.h (revision 0c6dfa75)
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 <linux/reset-controller.h>
10 #include <linux/spinlock.h>
11 
12 struct ccu_reset_map {
13 	u16	reg;
14 	u32	bit;
15 };
16 
17 
18 struct ccu_reset {
19 	void __iomem			*base;
20 	struct ccu_reset_map		*reset_map;
21 	spinlock_t			*lock;
22 
23 	struct reset_controller_dev	rcdev;
24 };
25 
26 static inline struct ccu_reset *rcdev_to_ccu_reset(struct reset_controller_dev *rcdev)
27 {
28 	return container_of(rcdev, struct ccu_reset, rcdev);
29 }
30 
31 extern const struct reset_control_ops ccu_reset_ops;
32 
33 #endif /* _CCU_RESET_H_ */
34