Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) 2013 Samsung Electronics Co., Ltd.
0004  *  Tomasz Figa <t.figa@samsung.com>
0005  * Copyright (c) 2004 Simtec Electronics
0006  *  http://armlinux.simtec.co.uk/
0007  *  Written by Ben Dooks, <ben@simtec.co.uk>
0008  */
0009 
0010 #ifndef __LINUX_SOC_SAMSUNG_S3C_PM_H
0011 #define __LINUX_SOC_SAMSUNG_S3C_PM_H __FILE__
0012 
0013 #include <linux/types.h>
0014 
0015 /* PM debug functions */
0016 
0017 /**
0018  * struct pm_uart_save - save block for core UART
0019  * @ulcon: Save value for S3C2410_ULCON
0020  * @ucon: Save value for S3C2410_UCON
0021  * @ufcon: Save value for S3C2410_UFCON
0022  * @umcon: Save value for S3C2410_UMCON
0023  * @ubrdiv: Save value for S3C2410_UBRDIV
0024  *
0025  * Save block for UART registers to be held over sleep and restored if they
0026  * are needed (say by debug).
0027 */
0028 struct pm_uart_save {
0029     u32 ulcon;
0030     u32 ucon;
0031     u32 ufcon;
0032     u32 umcon;
0033     u32 ubrdiv;
0034     u32 udivslot;
0035 };
0036 
0037 #ifdef CONFIG_SAMSUNG_PM_DEBUG
0038 /**
0039  * s3c_pm_dbg() - low level debug function for use in suspend/resume.
0040  * @msg: The message to print.
0041  *
0042  * This function is used mainly to debug the resume process before the system
0043  * can rely on printk/console output. It uses the low-level debugging output
0044  * routine printascii() to do its work.
0045  */
0046 extern void s3c_pm_dbg(const char *msg, ...);
0047 
0048 #define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
0049 
0050 extern void s3c_pm_save_uarts(bool is_s3c24xx);
0051 extern void s3c_pm_restore_uarts(bool is_s3c24xx);
0052 
0053 #ifdef CONFIG_ARCH_S3C64XX
0054 extern void s3c_pm_arch_update_uart(void __iomem *regs,
0055                     struct pm_uart_save *save);
0056 #else
0057 static inline void
0058 s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save)
0059 {
0060 }
0061 #endif
0062 
0063 #else
0064 #define S3C_PMDBG(fmt...) pr_debug(fmt)
0065 
0066 static inline void s3c_pm_save_uarts(bool is_s3c24xx) { }
0067 static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { }
0068 #endif
0069 
0070 /* suspend memory checking */
0071 
0072 #ifdef CONFIG_SAMSUNG_PM_CHECK
0073 extern void s3c_pm_check_prepare(void);
0074 extern void s3c_pm_check_restore(void);
0075 extern void s3c_pm_check_cleanup(void);
0076 extern void s3c_pm_check_store(void);
0077 #else
0078 #define s3c_pm_check_prepare() do { } while (0)
0079 #define s3c_pm_check_restore() do { } while (0)
0080 #define s3c_pm_check_cleanup() do { } while (0)
0081 #define s3c_pm_check_store()   do { } while (0)
0082 #endif
0083 
0084 /* system device subsystems */
0085 
0086 extern struct bus_type s3c2410_subsys;
0087 extern struct bus_type s3c2410a_subsys;
0088 extern struct bus_type s3c2412_subsys;
0089 extern struct bus_type s3c2416_subsys;
0090 extern struct bus_type s3c2440_subsys;
0091 extern struct bus_type s3c2442_subsys;
0092 extern struct bus_type s3c2443_subsys;
0093 
0094 #endif