rpm-smd-regulator.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2012-2013, 2015, 2017, 2019-2020, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _LINUX_REGULATOR_RPM_SMD_H
  7. #define _LINUX_REGULATOR_RPM_SMD_H
  8. #include <linux/device.h>
  9. struct rpm_regulator;
  10. /**
  11. * enum rpm_regulator_voltage_corner - possible voltage corner values
  12. *
  13. * These should be used in regulator_set_voltage() and
  14. * rpm_regulator_set_voltage() calls for corner type regulators as if they had
  15. * units of uV.
  16. *
  17. * Note, the meaning of corner values is set by the RPM. It is possible that
  18. * future platforms will utilize different corner values. The values specified
  19. * in this enum correspond to MSM8974 for PMIC PM8841 SMPS 2 (VDD_Dig).
  20. */
  21. enum rpm_regulator_voltage_corner {
  22. RPM_REGULATOR_CORNER_NONE = 1,
  23. RPM_REGULATOR_CORNER_RETENTION,
  24. RPM_REGULATOR_CORNER_SVS_KRAIT,
  25. RPM_REGULATOR_CORNER_SVS_SOC,
  26. RPM_REGULATOR_CORNER_NORMAL,
  27. RPM_REGULATOR_CORNER_TURBO,
  28. RPM_REGULATOR_CORNER_SUPER_TURBO,
  29. };
  30. /**
  31. * enum rpm_regulator_voltage_level - possible voltage level values
  32. *
  33. * These should be used in regulator_set_voltage() and
  34. * rpm_regulator_set_voltage() calls for level type regulators as if they had
  35. * units of uV.
  36. *
  37. * Note: the meaning of level values is set by the RPM.
  38. */
  39. enum rpm_regulator_voltage_level {
  40. RPM_REGULATOR_LEVEL_NONE = 0,
  41. RPM_REGULATOR_LEVEL_RETENTION = 16,
  42. RPM_REGULATOR_LEVEL_RETENTION_PLUS = 32,
  43. RPM_REGULATOR_LEVEL_MIN_SVS = 48,
  44. RPM_REGULATOR_LEVEL_LOW_SVS = 64,
  45. RPM_REGULATOR_LEVEL_SVS = 128,
  46. RPM_REGULATOR_LEVEL_SVS_PLUS = 192,
  47. RPM_REGULATOR_LEVEL_NOM = 256,
  48. RPM_REGULATOR_LEVEL_NOM_PLUS = 320,
  49. RPM_REGULATOR_LEVEL_TURBO = 384,
  50. RPM_REGULATOR_LEVEL_TURBO_NO_CPR = 416,
  51. RPM_REGULATOR_LEVEL_BINNING = 512,
  52. RPM_REGULATOR_LEVEL_MAX = 65535,
  53. };
  54. /**
  55. * enum rpm_regulator_mode - control mode for LDO or SMPS type regulators
  56. * %RPM_REGULATOR_MODE_AUTO: For SMPS type regulators, use SMPS auto mode so
  57. * that the hardware can automatically switch
  58. * between PFM and PWM modes based on realtime
  59. * load.
  60. * LDO type regulators do not support this mode.
  61. * %RPM_REGULATOR_MODE_IPEAK: For SMPS type regulators, use aggregated
  62. * software current requests to determine
  63. * usage of PFM or PWM mode.
  64. * For LDO type regulators, use aggregated
  65. * software current requests to determine
  66. * usage of LPM or HPM mode.
  67. * %RPM_REGULATOR_MODE_HPM: For SMPS type regulators, force the
  68. * usage of PWM mode.
  69. * For LDO type regulators, force the
  70. * usage of HPM mode.
  71. *
  72. * These values should be used in calls to rpm_regulator_set_mode().
  73. */
  74. enum rpm_regulator_mode {
  75. RPM_REGULATOR_MODE_AUTO,
  76. RPM_REGULATOR_MODE_IPEAK,
  77. RPM_REGULATOR_MODE_HPM,
  78. };
  79. #ifdef CONFIG_DEBUG_FS
  80. static void rpm_vreg_create_debugfs(struct rpm_regulator *reg);
  81. #else
  82. static inline void rpm_vreg_create_debugfs(struct rpm_regulator *reg)
  83. {
  84. }
  85. #endif
  86. #endif