qcom,rpmh-regulator.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __QCOM_RPMH_REGULATOR_H
  13. #define __QCOM_RPMH_REGULATOR_H
  14. /* This offset is needed as 0 is considered an invalid voltage. */
  15. #define RPMH_REGULATOR_LEVEL_OFFSET 1
  16. /* These levels may be used for RPMH ARC resource regulators */
  17. #define RPMH_REGULATOR_LEVEL_MIN (0 + RPMH_REGULATOR_LEVEL_OFFSET)
  18. #define RPMH_REGULATOR_LEVEL_OFF (0 + RPMH_REGULATOR_LEVEL_OFFSET)
  19. #define RPMH_REGULATOR_LEVEL_RETENTION (16 + RPMH_REGULATOR_LEVEL_OFFSET)
  20. #define RPMH_REGULATOR_LEVEL_MIN_SVS (48 + RPMH_REGULATOR_LEVEL_OFFSET)
  21. #define RPMH_REGULATOR_LEVEL_LOW_SVS (64 + RPMH_REGULATOR_LEVEL_OFFSET)
  22. #define RPMH_REGULATOR_LEVEL_SVS (128 + RPMH_REGULATOR_LEVEL_OFFSET)
  23. #define RPMH_REGULATOR_LEVEL_SVS_L1 (192 + RPMH_REGULATOR_LEVEL_OFFSET)
  24. #define RPMH_REGULATOR_LEVEL_NOM (256 + RPMH_REGULATOR_LEVEL_OFFSET)
  25. #define RPMH_REGULATOR_LEVEL_NOM_L1 (320 + RPMH_REGULATOR_LEVEL_OFFSET)
  26. #define RPMH_REGULATOR_LEVEL_NOM_L2 (336 + RPMH_REGULATOR_LEVEL_OFFSET)
  27. #define RPMH_REGULATOR_LEVEL_TURBO (384 + RPMH_REGULATOR_LEVEL_OFFSET)
  28. #define RPMH_REGULATOR_LEVEL_TURBO_L1 (416 + RPMH_REGULATOR_LEVEL_OFFSET)
  29. #define RPMH_REGULATOR_LEVEL_MAX (65535 + RPMH_REGULATOR_LEVEL_OFFSET)
  30. /*
  31. * These set constants may be used as the value for qcom,set of an RPMh
  32. * resource device.
  33. */
  34. #define RPMH_REGULATOR_SET_ACTIVE 1
  35. #define RPMH_REGULATOR_SET_SLEEP 2
  36. #define RPMH_REGULATOR_SET_ALL 3
  37. /*
  38. * These mode constants may be used for qcom,supported-modes and qcom,init-mode
  39. * properties of an RPMh resource. Each type of regulator supports a subset of
  40. * the possible modes.
  41. *
  42. * %RPMH_REGULATOR_MODE_PASS: Pass-through mode in which output is directly
  43. * tied to input. This mode is only supported by
  44. * BOB type regulators.
  45. * %RPMH_REGULATOR_MODE_RET: Retention mode in which only an extremely small
  46. * load current is allowed. This mode is supported
  47. * by LDO and SMPS type regulators.
  48. * %RPMH_REGULATOR_MODE_LPM: Low power mode in which a small load current is
  49. * allowed. This mode corresponds to PFM for SMPS
  50. * and BOB type regulators. This mode is supported
  51. * by LDO, HFSMPS, BOB, and PMIC4 FTSMPS type
  52. * regulators.
  53. * %RPMH_REGULATOR_MODE_AUTO: Auto mode in which the regulator hardware
  54. * automatically switches between LPM and HPM based
  55. * upon the real-time load current. This mode is
  56. * supported by HFSMPS, BOB, and PMIC4 FTSMPS type
  57. * regulators.
  58. * %RPMH_REGULATOR_MODE_HPM: High power mode in which the full rated current
  59. * of the regulator is allowed. This mode
  60. * corresponds to PWM for SMPS and BOB type
  61. * regulators. This mode is supported by all types
  62. * of regulators.
  63. */
  64. #define RPMH_REGULATOR_MODE_PASS 0
  65. #define RPMH_REGULATOR_MODE_RET 1
  66. #define RPMH_REGULATOR_MODE_LPM 2
  67. #define RPMH_REGULATOR_MODE_AUTO 3
  68. #define RPMH_REGULATOR_MODE_HPM 4
  69. #endif