diff options
-rw-r--r-- | drivers/soc/samsung/exynos-pmu.c | 11 | ||||
-rw-r--r-- | include/linux/soc/samsung/exynos-pmu.h | 10 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 0acdfd82e751..5c269bf23210 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/of.h> | 12 | #include <linux/of.h> |
13 | #include <linux/of_address.h> | 13 | #include <linux/of_address.h> |
14 | #include <linux/mfd/syscon.h> | ||
14 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
15 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
16 | 17 | ||
@@ -92,6 +93,16 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = { | |||
92 | { /*sentinel*/ }, | 93 | { /*sentinel*/ }, |
93 | }; | 94 | }; |
94 | 95 | ||
96 | struct regmap *exynos_get_pmu_regmap(void) | ||
97 | { | ||
98 | struct device_node *np = of_find_matching_node(NULL, | ||
99 | exynos_pmu_of_device_ids); | ||
100 | if (np) | ||
101 | return syscon_node_to_regmap(np); | ||
102 | return ERR_PTR(-ENODEV); | ||
103 | } | ||
104 | EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap); | ||
105 | |||
95 | static int exynos_pmu_probe(struct platform_device *pdev) | 106 | static int exynos_pmu_probe(struct platform_device *pdev) |
96 | { | 107 | { |
97 | const struct of_device_id *match; | 108 | const struct of_device_id *match; |
diff --git a/include/linux/soc/samsung/exynos-pmu.h b/include/linux/soc/samsung/exynos-pmu.h index e2e9de1acc5b..e57eb4b6cc5a 100644 --- a/include/linux/soc/samsung/exynos-pmu.h +++ b/include/linux/soc/samsung/exynos-pmu.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #ifndef __LINUX_SOC_EXYNOS_PMU_H | 12 | #ifndef __LINUX_SOC_EXYNOS_PMU_H |
13 | #define __LINUX_SOC_EXYNOS_PMU_H | 13 | #define __LINUX_SOC_EXYNOS_PMU_H |
14 | 14 | ||
15 | struct regmap; | ||
16 | |||
15 | enum sys_powerdown { | 17 | enum sys_powerdown { |
16 | SYS_AFTR, | 18 | SYS_AFTR, |
17 | SYS_LPA, | 19 | SYS_LPA, |
@@ -20,5 +22,13 @@ enum sys_powerdown { | |||
20 | }; | 22 | }; |
21 | 23 | ||
22 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | 24 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); |
25 | #ifdef CONFIG_EXYNOS_PMU | ||
26 | extern struct regmap *exynos_get_pmu_regmap(void); | ||
27 | #else | ||
28 | static inline struct regmap *exynos_get_pmu_regmap(void) | ||
29 | { | ||
30 | return ERR_PTR(-ENODEV); | ||
31 | } | ||
32 | #endif | ||
23 | 33 | ||
24 | #endif /* __LINUX_SOC_EXYNOS_PMU_H */ | 34 | #endif /* __LINUX_SOC_EXYNOS_PMU_H */ |