blob: ff8f5ebca43575c20c78636c51d26304f10642b0 [file] [log] [blame]
Maxime Ripard1d80c142016-06-29 21:05:23 +02001/*
2 * Copyright (c) 2016 Maxime Ripard. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _CCU_RESET_H_
15#define _CCU_RESET_H_
16
17#include <linux/reset-controller.h>
Tobias Klauserb042e422017-05-15 12:23:07 +020018#include <linux/spinlock.h>
Maxime Ripard1d80c142016-06-29 21:05:23 +020019
20struct ccu_reset_map {
21 u16 reg;
22 u32 bit;
23};
24
25
26struct ccu_reset {
27 void __iomem *base;
28 struct ccu_reset_map *reset_map;
29 spinlock_t *lock;
30
31 struct reset_controller_dev rcdev;
32};
33
34static inline struct ccu_reset *rcdev_to_ccu_reset(struct reset_controller_dev *rcdev)
35{
36 return container_of(rcdev, struct ccu_reset, rcdev);
37}
38
39extern const struct reset_control_ops ccu_reset_ops;
40
41#endif /* _CCU_RESET_H_ */