proc_comm.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /* arch/arm/mach-msm/proc_comm.h
  2. *
  3. * Copyright (c) 2007 QUALCOMM Incorporated
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #ifndef _ARCH_ARM_MACH_MSM_PROC_COMM_H_
  16. #define _ARCH_ARM_MACH_MSM_PROC_COMM_H_
  17. enum {
  18. PCOM_CMD_IDLE = 0x0,
  19. PCOM_CMD_DONE,
  20. PCOM_RESET_APPS,
  21. PCOM_RESET_CHIP,
  22. PCOM_CONFIG_NAND_MPU,
  23. PCOM_CONFIG_USB_CLKS,
  24. PCOM_GET_POWER_ON_STATUS,
  25. PCOM_GET_WAKE_UP_STATUS,
  26. PCOM_GET_BATT_LEVEL,
  27. PCOM_CHG_IS_CHARGING,
  28. PCOM_POWER_DOWN,
  29. PCOM_USB_PIN_CONFIG,
  30. PCOM_USB_PIN_SEL,
  31. PCOM_SET_RTC_ALARM,
  32. PCOM_NV_READ,
  33. PCOM_NV_WRITE,
  34. PCOM_GET_UUID_HIGH,
  35. PCOM_GET_UUID_LOW,
  36. PCOM_GET_HW_ENTROPY,
  37. PCOM_RPC_GPIO_TLMM_CONFIG_REMOTE,
  38. PCOM_CLKCTL_RPC_ENABLE,
  39. PCOM_CLKCTL_RPC_DISABLE,
  40. PCOM_CLKCTL_RPC_RESET,
  41. PCOM_CLKCTL_RPC_SET_FLAGS,
  42. PCOM_CLKCTL_RPC_SET_RATE,
  43. PCOM_CLKCTL_RPC_MIN_RATE,
  44. PCOM_CLKCTL_RPC_MAX_RATE,
  45. PCOM_CLKCTL_RPC_RATE,
  46. PCOM_CLKCTL_RPC_PLL_REQUEST,
  47. PCOM_CLKCTL_RPC_ENABLED,
  48. PCOM_VREG_SWITCH,
  49. PCOM_VREG_SET_LEVEL,
  50. PCOM_GPIO_TLMM_CONFIG_GROUP,
  51. PCOM_GPIO_TLMM_UNCONFIG_GROUP,
  52. PCOM_NV_WRITE_BYTES_4_7,
  53. PCOM_CONFIG_DISP,
  54. PCOM_GET_FTM_BOOT_COUNT,
  55. PCOM_RPC_GPIO_TLMM_CONFIG_EX,
  56. PCOM_PM_MPP_CONFIG,
  57. PCOM_GPIO_IN,
  58. PCOM_GPIO_OUT,
  59. PCOM_RESET_MODEM,
  60. PCOM_RESET_CHIP_IMM,
  61. PCOM_PM_VID_EN,
  62. PCOM_VREG_PULLDOWN,
  63. PCOM_NUM_CMDS,
  64. };
  65. enum {
  66. PCOM_INVALID_STATUS = 0x0,
  67. PCOM_READY,
  68. PCOM_CMD_RUNNING,
  69. PCOM_CMD_SUCCESS,
  70. PCOM_CMD_FAIL,
  71. };
  72. /* List of VREGs that support the Pull Down Resistor setting. */
  73. enum {
  74. PM_VREG_PDOWN_MSMA_ID,
  75. PM_VREG_PDOWN_MSMP_ID,
  76. PM_VREG_PDOWN_MSME1_ID, /* Not supported in Panoramix */
  77. PM_VREG_PDOWN_MSMC1_ID, /* Not supported in PM6620 */
  78. PM_VREG_PDOWN_MSMC2_ID, /* Supported in PM7500 only */
  79. PM_VREG_PDOWN_GP3_ID, /* Supported in PM7500 only */
  80. PM_VREG_PDOWN_MSME2_ID, /* Supported in PM7500 and Panoramix only */
  81. PM_VREG_PDOWN_GP4_ID, /* Supported in PM7500 only */
  82. PM_VREG_PDOWN_GP1_ID, /* Supported in PM7500 only */
  83. PM_VREG_PDOWN_TCXO_ID,
  84. PM_VREG_PDOWN_PA_ID,
  85. PM_VREG_PDOWN_RFTX_ID,
  86. PM_VREG_PDOWN_RFRX1_ID,
  87. PM_VREG_PDOWN_RFRX2_ID,
  88. PM_VREG_PDOWN_SYNT_ID,
  89. PM_VREG_PDOWN_WLAN_ID,
  90. PM_VREG_PDOWN_USB_ID,
  91. PM_VREG_PDOWN_MMC_ID,
  92. PM_VREG_PDOWN_RUIM_ID,
  93. PM_VREG_PDOWN_MSMC0_ID, /* Supported in PM6610 only */
  94. PM_VREG_PDOWN_GP2_ID, /* Supported in PM7500 only */
  95. PM_VREG_PDOWN_GP5_ID, /* Supported in PM7500 only */
  96. PM_VREG_PDOWN_GP6_ID, /* Supported in PM7500 only */
  97. PM_VREG_PDOWN_RF_ID,
  98. PM_VREG_PDOWN_RF_VCO_ID,
  99. PM_VREG_PDOWN_MPLL_ID,
  100. PM_VREG_PDOWN_S2_ID,
  101. PM_VREG_PDOWN_S3_ID,
  102. PM_VREG_PDOWN_RFUBM_ID,
  103. /* new for HAN */
  104. PM_VREG_PDOWN_RF1_ID,
  105. PM_VREG_PDOWN_RF2_ID,
  106. PM_VREG_PDOWN_RFA_ID,
  107. PM_VREG_PDOWN_CDC2_ID,
  108. PM_VREG_PDOWN_RFTX2_ID,
  109. PM_VREG_PDOWN_USIM_ID,
  110. PM_VREG_PDOWN_USB2P6_ID,
  111. PM_VREG_PDOWN_USB3P3_ID,
  112. PM_VREG_PDOWN_INVALID_ID,
  113. /* backward compatible enums only */
  114. PM_VREG_PDOWN_CAM_ID = PM_VREG_PDOWN_GP1_ID,
  115. PM_VREG_PDOWN_MDDI_ID = PM_VREG_PDOWN_GP2_ID,
  116. PM_VREG_PDOWN_RUIM2_ID = PM_VREG_PDOWN_GP3_ID,
  117. PM_VREG_PDOWN_AUX_ID = PM_VREG_PDOWN_GP4_ID,
  118. PM_VREG_PDOWN_AUX2_ID = PM_VREG_PDOWN_GP5_ID,
  119. PM_VREG_PDOWN_BT_ID = PM_VREG_PDOWN_GP6_ID,
  120. PM_VREG_PDOWN_MSME_ID = PM_VREG_PDOWN_MSME1_ID,
  121. PM_VREG_PDOWN_MSMC_ID = PM_VREG_PDOWN_MSMC1_ID,
  122. PM_VREG_PDOWN_RFA1_ID = PM_VREG_PDOWN_RFRX2_ID,
  123. PM_VREG_PDOWN_RFA2_ID = PM_VREG_PDOWN_RFTX2_ID,
  124. PM_VREG_PDOWN_XO_ID = PM_VREG_PDOWN_TCXO_ID
  125. };
  126. /* gpio info for PCOM_RPC_GPIO_TLMM_CONFIG_EX */
  127. #define GPIO_ENABLE 0
  128. #define GPIO_DISABLE 1
  129. #define GPIO_INPUT 0
  130. #define GPIO_OUTPUT 1
  131. #define GPIO_NO_PULL 0
  132. #define GPIO_PULL_DOWN 1
  133. #define GPIO_KEEPER 2
  134. #define GPIO_PULL_UP 3
  135. #define GPIO_2MA 0
  136. #define GPIO_4MA 1
  137. #define GPIO_6MA 2
  138. #define GPIO_8MA 3
  139. #define GPIO_10MA 4
  140. #define GPIO_12MA 5
  141. #define GPIO_14MA 6
  142. #define GPIO_16MA 7
  143. #define PCOM_GPIO_CFG(gpio, func, dir, pull, drvstr) \
  144. ((((gpio) & 0x3FF) << 4) | \
  145. ((func) & 0xf) | \
  146. (((dir) & 0x1) << 14) | \
  147. (((pull) & 0x3) << 15) | \
  148. (((drvstr) & 0xF) << 17))
  149. int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2);
  150. #endif