s3c-pm.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2013 Samsung Electronics Co., Ltd.
  4. * Tomasz Figa <[email protected]>
  5. * Copyright (c) 2004 Simtec Electronics
  6. * http://armlinux.simtec.co.uk/
  7. * Written by Ben Dooks, <[email protected]>
  8. */
  9. #ifndef __LINUX_SOC_SAMSUNG_S3C_PM_H
  10. #define __LINUX_SOC_SAMSUNG_S3C_PM_H __FILE__
  11. #include <linux/types.h>
  12. /* PM debug functions */
  13. /**
  14. * struct pm_uart_save - save block for core UART
  15. * @ulcon: Save value for S3C2410_ULCON
  16. * @ucon: Save value for S3C2410_UCON
  17. * @ufcon: Save value for S3C2410_UFCON
  18. * @umcon: Save value for S3C2410_UMCON
  19. * @ubrdiv: Save value for S3C2410_UBRDIV
  20. *
  21. * Save block for UART registers to be held over sleep and restored if they
  22. * are needed (say by debug).
  23. */
  24. struct pm_uart_save {
  25. u32 ulcon;
  26. u32 ucon;
  27. u32 ufcon;
  28. u32 umcon;
  29. u32 ubrdiv;
  30. u32 udivslot;
  31. };
  32. #ifdef CONFIG_SAMSUNG_PM_DEBUG
  33. /**
  34. * s3c_pm_dbg() - low level debug function for use in suspend/resume.
  35. * @msg: The message to print.
  36. *
  37. * This function is used mainly to debug the resume process before the system
  38. * can rely on printk/console output. It uses the low-level debugging output
  39. * routine printascii() to do its work.
  40. */
  41. extern void s3c_pm_dbg(const char *msg, ...);
  42. #define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
  43. extern void s3c_pm_save_uarts(bool is_s3c24xx);
  44. extern void s3c_pm_restore_uarts(bool is_s3c24xx);
  45. #ifdef CONFIG_ARCH_S3C64XX
  46. extern void s3c_pm_arch_update_uart(void __iomem *regs,
  47. struct pm_uart_save *save);
  48. #else
  49. static inline void
  50. s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save)
  51. {
  52. }
  53. #endif
  54. #else
  55. #define S3C_PMDBG(fmt...) pr_debug(fmt)
  56. static inline void s3c_pm_save_uarts(bool is_s3c24xx) { }
  57. static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { }
  58. #endif
  59. /* suspend memory checking */
  60. #ifdef CONFIG_SAMSUNG_PM_CHECK
  61. extern void s3c_pm_check_prepare(void);
  62. extern void s3c_pm_check_restore(void);
  63. extern void s3c_pm_check_cleanup(void);
  64. extern void s3c_pm_check_store(void);
  65. #else
  66. #define s3c_pm_check_prepare() do { } while (0)
  67. #define s3c_pm_check_restore() do { } while (0)
  68. #define s3c_pm_check_cleanup() do { } while (0)
  69. #define s3c_pm_check_store() do { } while (0)
  70. #endif
  71. /* system device subsystems */
  72. extern struct bus_type s3c2410_subsys;
  73. extern struct bus_type s3c2410a_subsys;
  74. extern struct bus_type s3c2412_subsys;
  75. extern struct bus_type s3c2416_subsys;
  76. extern struct bus_type s3c2440_subsys;
  77. extern struct bus_type s3c2442_subsys;
  78. extern struct bus_type s3c2443_subsys;
  79. #endif