1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2021 BAIKAL ELECTRONICS, JSC
5 * Baikal-T1 CCU Resets interface driver
7 #ifndef __CLK_BT1_CCU_RST_H__
8 #define __CLK_BT1_CCU_RST_H__
11 #include <linux/regmap.h>
12 #include <linux/reset-controller.h>
17 * enum ccu_rst_type - CCU Reset types
18 * @CCU_RST_TRIG: Self-deasserted reset signal.
19 * @CCU_RST_DIR: Directly controlled reset signal.
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).
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
);
58 struct ccu_rst
*ccu_rst_hw_register(const struct ccu_rst_init_data
*init
)
63 static inline void ccu_rst_hw_unregister(struct ccu_rst
*rst
) {}
67 #endif /* __CLK_BT1_CCU_RST_H__ */