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