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