1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * R-Car Gen3 Clock Pulse Generator Library
4  *
5  * Copyright (C) 2015-2018 Glider bvba
6  * Copyright (C) 2019 Renesas Electronics Corp.
7  *
8  * Based on clk-rcar-gen3.c
9  *
10  * Copyright (C) 2015 Renesas Electronics Corp.
11  */
12 
13 #ifndef __CLK_RENESAS_RCAR_CPG_LIB_H__
14 #define __CLK_RENESAS_RCAR_CPG_LIB_H__
15 
16 extern spinlock_t cpg_lock;
17 
18 struct cpg_simple_notifier {
19 	struct notifier_block nb;
20 	void __iomem *reg;
21 	u32 saved;
22 };
23 
24 void cpg_simple_notifier_register(struct raw_notifier_head *notifiers,
25 				  struct cpg_simple_notifier *csn);
26 
27 void cpg_reg_modify(void __iomem *reg, u32 clear, u32 set);
28 
29 struct clk * __init cpg_sd_clk_register(const char *name,
30 	void __iomem *base, unsigned int offset, const char *parent_name,
31 	struct raw_notifier_head *notifiers, bool skip_first);
32 
33 struct clk * __init cpg_rpc_clk_register(const char *name,
34 	void __iomem *rpcckcr, const char *parent_name,
35 	struct raw_notifier_head *notifiers);
36 
37 struct clk * __init cpg_rpcd2_clk_register(const char *name,
38 					   void __iomem *rpcckcr,
39 					   const char *parent_name);
40 #endif
41