aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/include
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2014-03-17 18:28:09 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-03-20 15:09:16 -0400
commit72551f6cf13e2f3a1d273b7007b5d7d7fd69c554 (patch)
treeebc79635f3b76e22d614297953608239b672fee4 /arch/arm/plat-samsung/include
parentd38688a69fd88269eae3c7c66ec34fb02fb04fd1 (diff)
ARM: SAMSUNG: Move Samsung PM debug code into separate file
Not all Samsung SoC platforms are going to use the legacy Samsung PM code enabled by CONFIG_SAMSUNG_PM_DEBUG. To allow using Samsung PM debug helpers on such platforms, related code is moved to separate file and a plat/pm-common.h header is added to separate legacy and generic code. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung/include')
-rw-r--r--arch/arm/plat-samsung/include/plat/pm-common.h70
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h39
2 files changed, 71 insertions, 38 deletions
diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h
new file mode 100644
index 000000000000..f72974a762bf
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/pm-common.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
3 * Tomasz Figa <t.figa@samsung.com>
4 * Copyright (c) 2004 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Written by Ben Dooks, <ben@simtec.co.uk>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __PLAT_SAMSUNG_PM_COMMON_H
14#define __PLAT_SAMSUNG_PM_COMMON_H __FILE__
15
16/* PM debug functions */
17
18/**
19 * struct pm_uart_save - save block for core UART
20 * @ulcon: Save value for S3C2410_ULCON
21 * @ucon: Save value for S3C2410_UCON
22 * @ufcon: Save value for S3C2410_UFCON
23 * @umcon: Save value for S3C2410_UMCON
24 * @ubrdiv: Save value for S3C2410_UBRDIV
25 *
26 * Save block for UART registers to be held over sleep and restored if they
27 * are needed (say by debug).
28*/
29struct pm_uart_save {
30 u32 ulcon;
31 u32 ucon;
32 u32 ufcon;
33 u32 umcon;
34 u32 ubrdiv;
35 u32 udivslot;
36};
37
38#ifdef CONFIG_SAMSUNG_PM_DEBUG
39/**
40 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
41 * @msg: The message to print.
42 *
43 * This function is used mainly to debug the resume process before the system
44 * can rely on printk/console output. It uses the low-level debugging output
45 * routine printascii() to do its work.
46 */
47extern void s3c_pm_dbg(const char *msg, ...);
48
49/**
50 * s3c_pm_debug_init() - suspend/resume low level debug initialization.
51 * @base: Virtual base of UART to use for suspend/resume debugging.
52 *
53 * This function needs to be called before S3C_PMDBG() can be used, to set up
54 * UART port base address and configuration.
55 */
56extern void s3c_pm_debug_init(void);
57
58#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
59
60extern void s3c_pm_save_uarts(void);
61extern void s3c_pm_restore_uarts(void);
62#else
63#define S3C_PMDBG(fmt...) pr_debug(fmt)
64#define s3c_pm_debug_init() do { } while (0)
65
66static inline void s3c_pm_save_uarts(void) { }
67static inline void s3c_pm_restore_uarts(void) { }
68#endif
69
70#endif
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index 21758c67bcc0..2e04396eb3f3 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -16,6 +16,7 @@
16*/ 16*/
17 17
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <plat/pm-common.h>
19 20
20struct device; 21struct device;
21 22
@@ -76,26 +77,6 @@ struct sleep_save {
76#define SAVE_ITEM(x) \ 77#define SAVE_ITEM(x) \
77 { .reg = (x) } 78 { .reg = (x) }
78 79
79/**
80 * struct pm_uart_save - save block for core UART
81 * @ulcon: Save value for S3C2410_ULCON
82 * @ucon: Save value for S3C2410_UCON
83 * @ufcon: Save value for S3C2410_UFCON
84 * @umcon: Save value for S3C2410_UMCON
85 * @ubrdiv: Save value for S3C2410_UBRDIV
86 *
87 * Save block for UART registers to be held over sleep and restored if they
88 * are needed (say by debug).
89*/
90struct pm_uart_save {
91 u32 ulcon;
92 u32 ucon;
93 u32 ufcon;
94 u32 umcon;
95 u32 ubrdiv;
96 u32 udivslot;
97};
98
99/* helper functions to save/restore lists of registers. */ 80/* helper functions to save/restore lists of registers. */
100 81
101extern void s3c_pm_do_save(struct sleep_save *ptr, int count); 82extern void s3c_pm_do_save(struct sleep_save *ptr, int count);
@@ -112,24 +93,6 @@ extern void s3c_cpu_resume(void);
112#define s3c_cpu_resume NULL 93#define s3c_cpu_resume NULL
113#endif 94#endif
114 95
115/* PM debug functions */
116
117#ifdef CONFIG_SAMSUNG_PM_DEBUG
118/**
119 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
120 * @msg: The message to print.
121 *
122 * This function is used mainly to debug the resume process before the system
123 * can rely on printk/console output. It uses the low-level debugging output
124 * routine printascii() to do its work.
125 */
126extern void s3c_pm_dbg(const char *msg, ...);
127
128#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
129#else
130#define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt)
131#endif
132
133#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 96#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
134/** 97/**
135 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs 98 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs