Thomas Gleixner | 9c92ab6 | 2019-05-29 07:17:56 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Maxime Ripard | 1d80c14 | 2016-06-29 21:05:23 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2016 Maxime Ripard. All rights reserved. |
Maxime Ripard | 1d80c14 | 2016-06-29 21:05:23 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _CCU_RESET_H_ |
| 7 | #define _CCU_RESET_H_ |
| 8 | |
| 9 | #include <linux/reset-controller.h> |
Tobias Klauser | b042e42 | 2017-05-15 12:23:07 +0200 | [diff] [blame] | 10 | #include <linux/spinlock.h> |
Maxime Ripard | 1d80c14 | 2016-06-29 21:05:23 +0200 | [diff] [blame] | 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_ */ |