Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / clk / baikal-t1 / ccu-rst.h
blobd6e8b2f671f4d9a4f2be7f463ff2ffe49696ec2e
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2021 BAIKAL ELECTRONICS, JSC
5 * Baikal-T1 CCU Resets interface driver
6 */
7 #ifndef __CLK_BT1_CCU_RST_H__
8 #define __CLK_BT1_CCU_RST_H__
10 #include <linux/of.h>
11 #include <linux/regmap.h>
12 #include <linux/reset-controller.h>
14 struct ccu_rst_info;
17 * enum ccu_rst_type - CCU Reset types
18 * @CCU_RST_TRIG: Self-deasserted reset signal.
19 * @CCU_RST_DIR: Directly controlled reset signal.
21 enum ccu_rst_type {
22 CCU_RST_TRIG,
23 CCU_RST_DIR,
27 * struct ccu_rst_init_data - CCU Resets initialization data
28 * @sys_regs: Baikal-T1 System Controller registers map.
29 * @np: Pointer to the node with the System CCU block.
31 struct ccu_rst_init_data {
32 struct regmap *sys_regs;
33 struct device_node *np;
37 * struct ccu_rst - CCU Reset descriptor
38 * @rcdev: Reset controller descriptor.
39 * @sys_regs: Baikal-T1 System Controller registers map.
40 * @rsts_info: Reset flag info (base address and mask).
42 struct ccu_rst {
43 struct reset_controller_dev rcdev;
44 struct regmap *sys_regs;
45 const struct ccu_rst_info *rsts_info;
47 #define to_ccu_rst(_rcdev) container_of(_rcdev, struct ccu_rst, rcdev)
49 #ifdef CONFIG_CLK_BT1_CCU_RST
51 struct ccu_rst *ccu_rst_hw_register(const struct ccu_rst_init_data *init);
53 void ccu_rst_hw_unregister(struct ccu_rst *rst);
55 #else
57 static inline
58 struct ccu_rst *ccu_rst_hw_register(const struct ccu_rst_init_data *init)
60 return NULL;
63 static inline void ccu_rst_hw_unregister(struct ccu_rst *rst) {}
65 #endif
67 #endif /* __CLK_BT1_CCU_RST_H__ */