/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (C) 2021 BAIKAL ELECTRONICS, JSC3*4* Baikal-T1 CCU Resets interface driver5*/6#ifndef __CLK_BT1_CCU_RST_H__7#define __CLK_BT1_CCU_RST_H__89#include <linux/of.h>10#include <linux/regmap.h>11#include <linux/reset-controller.h>1213struct ccu_rst_info;1415/*16* enum ccu_rst_type - CCU Reset types17* @CCU_RST_TRIG: Self-deasserted reset signal.18* @CCU_RST_DIR: Directly controlled reset signal.19*/20enum ccu_rst_type {21CCU_RST_TRIG,22CCU_RST_DIR,23};2425/*26* struct ccu_rst_init_data - CCU Resets initialization data27* @sys_regs: Baikal-T1 System Controller registers map.28* @np: Pointer to the node with the System CCU block.29*/30struct ccu_rst_init_data {31struct regmap *sys_regs;32struct device_node *np;33};3435/*36* struct ccu_rst - CCU Reset descriptor37* @rcdev: Reset controller descriptor.38* @sys_regs: Baikal-T1 System Controller registers map.39* @rsts_info: Reset flag info (base address and mask).40*/41struct ccu_rst {42struct reset_controller_dev rcdev;43struct regmap *sys_regs;44const struct ccu_rst_info *rsts_info;45};46#define to_ccu_rst(_rcdev) container_of(_rcdev, struct ccu_rst, rcdev)4748#ifdef CONFIG_CLK_BT1_CCU_RST4950struct ccu_rst *ccu_rst_hw_register(const struct ccu_rst_init_data *init);5152void ccu_rst_hw_unregister(struct ccu_rst *rst);5354#else5556static inline57struct ccu_rst *ccu_rst_hw_register(const struct ccu_rst_init_data *init)58{59return NULL;60}6162static inline void ccu_rst_hw_unregister(struct ccu_rst *rst) {}6364#endif6566#endif /* __CLK_BT1_CCU_RST_H__ */676869