xref: /openbmc/linux/drivers/clk/versatile/clk-icst.h (revision 84655b76)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2eb9d6428SLinus Walleij struct regmap;
3eb9d6428SLinus Walleij 
4eb9d6428SLinus Walleij /**
5eb9d6428SLinus Walleij  * enum icst_control_type - the type of ICST control register
6eb9d6428SLinus Walleij  */
7eb9d6428SLinus Walleij enum icst_control_type {
8eb9d6428SLinus Walleij 	ICST_VERSATILE, /* The standard type, all control bits available */
9eb9d6428SLinus Walleij 	ICST_INTEGRATOR_AP_CM, /* Only 8 bits of VDW available */
10eb9d6428SLinus Walleij 	ICST_INTEGRATOR_AP_SYS, /* Only 8 bits of VDW available */
11eb9d6428SLinus Walleij 	ICST_INTEGRATOR_AP_PCI, /* Odd bit pattern storage */
12eb9d6428SLinus Walleij 	ICST_INTEGRATOR_CP_CM_CORE, /* Only 8 bits of VDW and 3 bits of OD */
13eb9d6428SLinus Walleij 	ICST_INTEGRATOR_CP_CM_MEM, /* Only 8 bits of VDW and 3 bits of OD */
1484655b76SLinus Walleij 	ICST_INTEGRATOR_IM_PD1, /* Like the Versatile, all control bits */
15eb9d6428SLinus Walleij };
16eb9d6428SLinus Walleij 
177a9ad671SLinus Walleij /**
187a9ad671SLinus Walleij  * struct clk_icst_desc - descriptor for the ICST VCO
197a9ad671SLinus Walleij  * @params: ICST parameters
207a9ad671SLinus Walleij  * @vco_offset: offset to the ICST VCO from the provided memory base
217a9ad671SLinus Walleij  * @lock_offset: offset to the ICST VCO locking register from the provided
227a9ad671SLinus Walleij  *	memory base
237a9ad671SLinus Walleij  */
2491b87a47SLinus Walleij struct clk_icst_desc {
2591b87a47SLinus Walleij 	const struct icst_params *params;
267a9ad671SLinus Walleij 	u32 vco_offset;
277a9ad671SLinus Walleij 	u32 lock_offset;
2891b87a47SLinus Walleij };
2991b87a47SLinus Walleij 
3091b87a47SLinus Walleij struct clk *icst_clk_register(struct device *dev,
317a9ad671SLinus Walleij 			      const struct clk_icst_desc *desc,
32ae6e694eSLinus Walleij 			      const char *name,
33bf6edb4bSLinus Walleij 			      const char *parent_name,
347a9ad671SLinus Walleij 			      void __iomem *base);
35eb9d6428SLinus Walleij 
36eb9d6428SLinus Walleij struct clk *icst_clk_setup(struct device *dev,
37eb9d6428SLinus Walleij 			   const struct clk_icst_desc *desc,
38eb9d6428SLinus Walleij 			   const char *name,
39eb9d6428SLinus Walleij 			   const char *parent_name,
40eb9d6428SLinus Walleij 			   struct regmap *map,
41eb9d6428SLinus Walleij 			   enum icst_control_type ctype);
42