xref: /linux/drivers/soc/samsung/exynos-pmu.h (revision 0b7c6075022ccff529318597dc6b165dd6a25c8f)
106512c53SKrzysztof Kozlowski /* SPDX-License-Identifier: GPL-2.0 */
2bfce552dSPankaj Dubey /*
3bfce552dSPankaj Dubey  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4bfce552dSPankaj Dubey  *		http://www.samsung.com
5bfce552dSPankaj Dubey  *
694500540SKrzysztof Kozlowski  * Header for Exynos PMU Driver support
7bfce552dSPankaj Dubey  */
8bfce552dSPankaj Dubey 
9bfce552dSPankaj Dubey #ifndef __EXYNOS_PMU_H
10bfce552dSPankaj Dubey #define __EXYNOS_PMU_H
11bfce552dSPankaj Dubey 
12bfce552dSPankaj Dubey #include <linux/io.h>
13bfce552dSPankaj Dubey 
14bfce552dSPankaj Dubey #define PMU_TABLE_END	(-1U)
15bfce552dSPankaj Dubey 
16bfce552dSPankaj Dubey struct exynos_pmu_conf {
17bfce552dSPankaj Dubey 	unsigned int offset;
18bfce552dSPankaj Dubey 	u8 val[NUM_SYS_POWERDOWN];
19bfce552dSPankaj Dubey };
20bfce552dSPankaj Dubey 
21bfce552dSPankaj Dubey struct exynos_pmu_data {
22bfce552dSPankaj Dubey 	const struct exynos_pmu_conf *pmu_config;
23514a935fSArtur Weber 	const struct exynos_pmu_conf *pmu_config_extra;
24*0b7c6075SPeter Griffin 	bool pmu_secure;
25bfce552dSPankaj Dubey 
26bfce552dSPankaj Dubey 	void (*pmu_init)(void);
27bfce552dSPankaj Dubey 	void (*powerdown_conf)(enum sys_powerdown);
28bfce552dSPankaj Dubey 	void (*powerdown_conf_extra)(enum sys_powerdown);
29bfce552dSPankaj Dubey };
30bfce552dSPankaj Dubey 
31bfce552dSPankaj Dubey extern void __iomem *pmu_base_addr;
32a0ebf662SKrzysztof Kozlowski 
33a0ebf662SKrzysztof Kozlowski #ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS
34bfce552dSPankaj Dubey /* list of all exported SoC specific data */
35bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos3250_pmu_data;
36bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos4210_pmu_data;
37514a935fSArtur Weber extern const struct exynos_pmu_data exynos4212_pmu_data;
38bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos4412_pmu_data;
39bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos5250_pmu_data;
40bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos5420_pmu_data;
41a0ebf662SKrzysztof Kozlowski #endif
42bfce552dSPankaj Dubey 
43bfce552dSPankaj Dubey extern void pmu_raw_writel(u32 val, u32 offset);
44bfce552dSPankaj Dubey extern u32 pmu_raw_readl(u32 offset);
45bfce552dSPankaj Dubey #endif /* __EXYNOS_PMU_H */
46