xref: /openbmc/linux/drivers/clk/mmp/reset.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2ae32a5b3SChao Xie #ifndef __MACH_MMP_CLK_RESET_H
3ae32a5b3SChao Xie #define __MACH_MMP_CLK_RESET_H
4ae32a5b3SChao Xie 
5ae32a5b3SChao Xie #include <linux/reset-controller.h>
6ae32a5b3SChao Xie 
7ae32a5b3SChao Xie #define MMP_RESET_INVERT	1
8ae32a5b3SChao Xie 
9ae32a5b3SChao Xie struct mmp_clk_reset_cell {
10ae32a5b3SChao Xie 	unsigned int clk_id;
11ae32a5b3SChao Xie 	void __iomem *reg;
12ae32a5b3SChao Xie 	u32 bits;
13ae32a5b3SChao Xie 	unsigned int flags;
14ae32a5b3SChao Xie 	spinlock_t *lock;
15ae32a5b3SChao Xie };
16ae32a5b3SChao Xie 
17ae32a5b3SChao Xie struct mmp_clk_reset_unit {
18ae32a5b3SChao Xie 	struct reset_controller_dev rcdev;
19ae32a5b3SChao Xie 	struct mmp_clk_reset_cell *cells;
20ae32a5b3SChao Xie };
21ae32a5b3SChao Xie 
22ae32a5b3SChao Xie #ifdef CONFIG_RESET_CONTROLLER
23ae32a5b3SChao Xie void mmp_clk_reset_register(struct device_node *np,
24ae32a5b3SChao Xie 			struct mmp_clk_reset_cell *cells, int nr_resets);
25ae32a5b3SChao Xie #else
mmp_clk_reset_register(struct device_node * np,struct mmp_clk_reset_cell * cells,int nr_resets)26ae32a5b3SChao Xie static inline void mmp_clk_reset_register(struct device_node *np,
27ae32a5b3SChao Xie 			struct mmp_clk_reset_cell *cells, int nr_resets)
28ae32a5b3SChao Xie {
29ae32a5b3SChao Xie }
30ae32a5b3SChao Xie #endif
31ae32a5b3SChao Xie 
32ae32a5b3SChao Xie #endif
33