xref: /openbmc/linux/drivers/soc/samsung/exynos-pmu.h (revision bfce552d0b10e8fd79e703c67c084b4cf89ad68a)
1*bfce552dSPankaj Dubey /*
2*bfce552dSPankaj Dubey  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3*bfce552dSPankaj Dubey  *		http://www.samsung.com
4*bfce552dSPankaj Dubey  *
5*bfce552dSPankaj Dubey  * Header for EXYNOS PMU Driver support
6*bfce552dSPankaj Dubey  *
7*bfce552dSPankaj Dubey  * This program is free software; you can redistribute it and/or modify
8*bfce552dSPankaj Dubey  * it under the terms of the GNU General Public License version 2 as
9*bfce552dSPankaj Dubey  * published by the Free Software Foundation.
10*bfce552dSPankaj Dubey  */
11*bfce552dSPankaj Dubey 
12*bfce552dSPankaj Dubey #ifndef __EXYNOS_PMU_H
13*bfce552dSPankaj Dubey #define __EXYNOS_PMU_H
14*bfce552dSPankaj Dubey 
15*bfce552dSPankaj Dubey #include <linux/io.h>
16*bfce552dSPankaj Dubey 
17*bfce552dSPankaj Dubey #define PMU_TABLE_END	(-1U)
18*bfce552dSPankaj Dubey 
19*bfce552dSPankaj Dubey struct exynos_pmu_conf {
20*bfce552dSPankaj Dubey 	unsigned int offset;
21*bfce552dSPankaj Dubey 	u8 val[NUM_SYS_POWERDOWN];
22*bfce552dSPankaj Dubey };
23*bfce552dSPankaj Dubey 
24*bfce552dSPankaj Dubey struct exynos_pmu_data {
25*bfce552dSPankaj Dubey 	const struct exynos_pmu_conf *pmu_config;
26*bfce552dSPankaj Dubey 	const struct exynos_pmu_conf *pmu_config_extra;
27*bfce552dSPankaj Dubey 
28*bfce552dSPankaj Dubey 	void (*pmu_init)(void);
29*bfce552dSPankaj Dubey 	void (*powerdown_conf)(enum sys_powerdown);
30*bfce552dSPankaj Dubey 	void (*powerdown_conf_extra)(enum sys_powerdown);
31*bfce552dSPankaj Dubey };
32*bfce552dSPankaj Dubey 
33*bfce552dSPankaj Dubey extern void __iomem *pmu_base_addr;
34*bfce552dSPankaj Dubey /* list of all exported SoC specific data */
35*bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos3250_pmu_data;
36*bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos4210_pmu_data;
37*bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos4212_pmu_data;
38*bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos4412_pmu_data;
39*bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos5250_pmu_data;
40*bfce552dSPankaj Dubey extern const struct exynos_pmu_data exynos5420_pmu_data;
41*bfce552dSPankaj Dubey 
42*bfce552dSPankaj Dubey extern void pmu_raw_writel(u32 val, u32 offset);
43*bfce552dSPankaj Dubey extern u32 pmu_raw_readl(u32 offset);
44*bfce552dSPankaj Dubey #endif /* __EXYNOS_PMU_H */
45