1 /*
2  * Copyright (c) 2024, Rockchip, Inc. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef RK_SCMI_RESET_DOMAIN_H
8 #define RK_SCMI_RESET_DOMAIN_H
9 
10 #include <stdint.h>
11 
12 #include <common.h>
13 
14 struct rk_scmi_rstd;
15 
16 struct rk_scmi_rstd_ops {
17 	int (*reset_auto)(struct rk_scmi_rstd *rstd, uint32_t state);
18 	int (*reset_explicit)(struct rk_scmi_rstd *rstd, bool assert_not_deassert);
19 };
20 
21 typedef struct rk_scmi_rstd {
22 	char name[SCMI_RESET_DOMAIN_ATTR_NAME_SZ];
23 	uint32_t id;
24 	uint32_t attribute;
25 	uint32_t latency;
26 	struct rk_scmi_rstd_ops *rstd_ops;
27 } rk_scmi_rstd_t;
28 
29 /*
30  * Return number of reset domain for an agent
31  * @agent_id: SCMI agent ID
32  * Return number of reset domain
33  */
34 size_t rockchip_scmi_rstd_count(unsigned int agent_id);
35 
36 /*
37  * Get rk_scmi_rstd_t point
38  * @agent_id: SCMI agent ID
39  * @scmi_id: SCMI rstd ID
40  * Return a rk_scmi_rstd_t point
41  */
42 rk_scmi_rstd_t *rockchip_scmi_get_rstd(unsigned int agent_id,
43 				       unsigned int scmi_id);
44 
45 #endif /* RK_SCMI_RESET_DOMAIN_H */
46