pmc.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * Copyright (c) 2010 Google, Inc
  3. * Copyright (c) 2014 NVIDIA Corporation
  4. *
  5. * Author:
  6. * Colin Cross <ccross@google.com>
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #ifndef __SOC_TEGRA_PMC_H__
  19. #define __SOC_TEGRA_PMC_H__
  20. #include <linux/reboot.h>
  21. #include <soc/tegra/pm.h>
  22. struct clk;
  23. struct reset_control;
  24. #ifdef CONFIG_PM_SLEEP
  25. enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
  26. void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode);
  27. void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode);
  28. #endif /* CONFIG_PM_SLEEP */
  29. #ifdef CONFIG_SMP
  30. bool tegra_pmc_cpu_is_powered(int cpuid);
  31. int tegra_pmc_cpu_power_on(int cpuid);
  32. int tegra_pmc_cpu_remove_clamping(int cpuid);
  33. #endif /* CONFIG_SMP */
  34. /*
  35. * powergate and I/O rail APIs
  36. */
  37. #define TEGRA_POWERGATE_CPU 0
  38. #define TEGRA_POWERGATE_3D 1
  39. #define TEGRA_POWERGATE_VENC 2
  40. #define TEGRA_POWERGATE_PCIE 3
  41. #define TEGRA_POWERGATE_VDEC 4
  42. #define TEGRA_POWERGATE_L2 5
  43. #define TEGRA_POWERGATE_MPE 6
  44. #define TEGRA_POWERGATE_HEG 7
  45. #define TEGRA_POWERGATE_SATA 8
  46. #define TEGRA_POWERGATE_CPU1 9
  47. #define TEGRA_POWERGATE_CPU2 10
  48. #define TEGRA_POWERGATE_CPU3 11
  49. #define TEGRA_POWERGATE_CELP 12
  50. #define TEGRA_POWERGATE_3D1 13
  51. #define TEGRA_POWERGATE_CPU0 14
  52. #define TEGRA_POWERGATE_C0NC 15
  53. #define TEGRA_POWERGATE_C1NC 16
  54. #define TEGRA_POWERGATE_SOR 17
  55. #define TEGRA_POWERGATE_DIS 18
  56. #define TEGRA_POWERGATE_DISB 19
  57. #define TEGRA_POWERGATE_XUSBA 20
  58. #define TEGRA_POWERGATE_XUSBB 21
  59. #define TEGRA_POWERGATE_XUSBC 22
  60. #define TEGRA_POWERGATE_VIC 23
  61. #define TEGRA_POWERGATE_IRAM 24
  62. #define TEGRA_POWERGATE_NVDEC 25
  63. #define TEGRA_POWERGATE_NVJPG 26
  64. #define TEGRA_POWERGATE_AUD 27
  65. #define TEGRA_POWERGATE_DFD 28
  66. #define TEGRA_POWERGATE_VE2 29
  67. #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
  68. #define TEGRA_IO_RAIL_CSIA 0
  69. #define TEGRA_IO_RAIL_CSIB 1
  70. #define TEGRA_IO_RAIL_DSI 2
  71. #define TEGRA_IO_RAIL_MIPI_BIAS 3
  72. #define TEGRA_IO_RAIL_PEX_BIAS 4
  73. #define TEGRA_IO_RAIL_PEX_CLK1 5
  74. #define TEGRA_IO_RAIL_PEX_CLK2 6
  75. #define TEGRA_IO_RAIL_USB0 9
  76. #define TEGRA_IO_RAIL_USB1 10
  77. #define TEGRA_IO_RAIL_USB2 11
  78. #define TEGRA_IO_RAIL_USB_BIAS 12
  79. #define TEGRA_IO_RAIL_NAND 13
  80. #define TEGRA_IO_RAIL_UART 14
  81. #define TEGRA_IO_RAIL_BB 15
  82. #define TEGRA_IO_RAIL_AUDIO 17
  83. #define TEGRA_IO_RAIL_HSIC 19
  84. #define TEGRA_IO_RAIL_COMP 22
  85. #define TEGRA_IO_RAIL_HDMI 28
  86. #define TEGRA_IO_RAIL_PEX_CNTRL 32
  87. #define TEGRA_IO_RAIL_SDMMC1 33
  88. #define TEGRA_IO_RAIL_SDMMC3 34
  89. #define TEGRA_IO_RAIL_SDMMC4 35
  90. #define TEGRA_IO_RAIL_CAM 36
  91. #define TEGRA_IO_RAIL_RES 37
  92. #define TEGRA_IO_RAIL_HV 38
  93. #define TEGRA_IO_RAIL_DSIB 39
  94. #define TEGRA_IO_RAIL_DSIC 40
  95. #define TEGRA_IO_RAIL_DSID 41
  96. #define TEGRA_IO_RAIL_CSIE 44
  97. #define TEGRA_IO_RAIL_LVDS 57
  98. #define TEGRA_IO_RAIL_SYS_DDC 58
  99. #ifdef CONFIG_ARCH_TEGRA
  100. int tegra_powergate_is_powered(int id);
  101. int tegra_powergate_power_on(int id);
  102. int tegra_powergate_power_off(int id);
  103. int tegra_powergate_remove_clamping(int id);
  104. /* Must be called with clk disabled, and returns with clk enabled */
  105. int tegra_powergate_sequence_power_up(int id, struct clk *clk,
  106. struct reset_control *rst);
  107. int tegra_io_rail_power_on(int id);
  108. int tegra_io_rail_power_off(int id);
  109. #else
  110. static inline int tegra_powergate_is_powered(int id)
  111. {
  112. return -ENOSYS;
  113. }
  114. static inline int tegra_powergate_power_on(int id)
  115. {
  116. return -ENOSYS;
  117. }
  118. static inline int tegra_powergate_power_off(int id)
  119. {
  120. return -ENOSYS;
  121. }
  122. static inline int tegra_powergate_remove_clamping(int id)
  123. {
  124. return -ENOSYS;
  125. }
  126. static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk,
  127. struct reset_control *rst)
  128. {
  129. return -ENOSYS;
  130. }
  131. static inline int tegra_io_rail_power_on(int id)
  132. {
  133. return -ENOSYS;
  134. }
  135. static inline int tegra_io_rail_power_off(int id)
  136. {
  137. return -ENOSYS;
  138. }
  139. #endif /* CONFIG_ARCH_TEGRA */
  140. #endif /* __SOC_TEGRA_PMC_H__ */