pv88080-regulator.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * pv88080-regulator.h - Regulator definitions for PV88080
  4. * Copyright (C) 2016 Powerventure Semiconductor Ltd.
  5. */
  6. #ifndef __PV88080_REGISTERS_H__
  7. #define __PV88080_REGISTERS_H__
  8. /* System Control and Event Registers */
  9. #define PV88080_REG_EVENT_A 0x04
  10. #define PV88080_REG_MASK_A 0x09
  11. #define PV88080_REG_MASK_B 0x0A
  12. #define PV88080_REG_MASK_C 0x0B
  13. /* Regulator Registers - rev. AA */
  14. #define PV88080AA_REG_HVBUCK_CONF1 0x2D
  15. #define PV88080AA_REG_HVBUCK_CONF2 0x2E
  16. #define PV88080AA_REG_BUCK1_CONF0 0x27
  17. #define PV88080AA_REG_BUCK1_CONF1 0x28
  18. #define PV88080AA_REG_BUCK1_CONF2 0x59
  19. #define PV88080AA_REG_BUCK1_CONF5 0x5C
  20. #define PV88080AA_REG_BUCK2_CONF0 0x29
  21. #define PV88080AA_REG_BUCK2_CONF1 0x2A
  22. #define PV88080AA_REG_BUCK2_CONF2 0x61
  23. #define PV88080AA_REG_BUCK2_CONF5 0x64
  24. #define PV88080AA_REG_BUCK3_CONF0 0x2B
  25. #define PV88080AA_REG_BUCK3_CONF1 0x2C
  26. #define PV88080AA_REG_BUCK3_CONF2 0x69
  27. #define PV88080AA_REG_BUCK3_CONF5 0x6C
  28. /* Regulator Registers - rev. BA */
  29. #define PV88080BA_REG_HVBUCK_CONF1 0x33
  30. #define PV88080BA_REG_HVBUCK_CONF2 0x34
  31. #define PV88080BA_REG_BUCK1_CONF0 0x2A
  32. #define PV88080BA_REG_BUCK1_CONF1 0x2C
  33. #define PV88080BA_REG_BUCK1_CONF2 0x5A
  34. #define PV88080BA_REG_BUCK1_CONF5 0x5D
  35. #define PV88080BA_REG_BUCK2_CONF0 0x2D
  36. #define PV88080BA_REG_BUCK2_CONF1 0x2F
  37. #define PV88080BA_REG_BUCK2_CONF2 0x63
  38. #define PV88080BA_REG_BUCK2_CONF5 0x66
  39. #define PV88080BA_REG_BUCK3_CONF0 0x30
  40. #define PV88080BA_REG_BUCK3_CONF1 0x32
  41. #define PV88080BA_REG_BUCK3_CONF2 0x6C
  42. #define PV88080BA_REG_BUCK3_CONF5 0x6F
  43. /* PV88080_REG_EVENT_A (addr=0x04) */
  44. #define PV88080_E_VDD_FLT 0x01
  45. #define PV88080_E_OVER_TEMP 0x02
  46. /* PV88080_REG_MASK_A (addr=0x09) */
  47. #define PV88080_M_VDD_FLT 0x01
  48. #define PV88080_M_OVER_TEMP 0x02
  49. /* PV88080_REG_BUCK1_CONF0 (addr=0x27|0x2A) */
  50. #define PV88080_BUCK1_EN 0x80
  51. #define PV88080_VBUCK1_MASK 0x7F
  52. /* PV88080_REG_BUCK2_CONF0 (addr=0x29|0x2D) */
  53. #define PV88080_BUCK2_EN 0x80
  54. #define PV88080_VBUCK2_MASK 0x7F
  55. /* PV88080_REG_BUCK3_CONF0 (addr=0x2B|0x30) */
  56. #define PV88080_BUCK3_EN 0x80
  57. #define PV88080_VBUCK3_MASK 0x7F
  58. /* PV88080_REG_BUCK1_CONF1 (addr=0x28|0x2C) */
  59. #define PV88080_BUCK1_ILIM_SHIFT 2
  60. #define PV88080_BUCK1_ILIM_MASK 0x0C
  61. #define PV88080_BUCK1_MODE_MASK 0x03
  62. /* PV88080_REG_BUCK2_CONF1 (addr=0x2A|0x2F) */
  63. #define PV88080_BUCK2_ILIM_SHIFT 2
  64. #define PV88080_BUCK2_ILIM_MASK 0x0C
  65. #define PV88080_BUCK2_MODE_MASK 0x03
  66. /* PV88080_REG_BUCK3_CONF1 (addr=0x2C|0x32) */
  67. #define PV88080_BUCK3_ILIM_SHIFT 2
  68. #define PV88080_BUCK3_ILIM_MASK 0x0C
  69. #define PV88080_BUCK3_MODE_MASK 0x03
  70. #define PV88080_BUCK_MODE_SLEEP 0x00
  71. #define PV88080_BUCK_MODE_AUTO 0x01
  72. #define PV88080_BUCK_MODE_SYNC 0x02
  73. /* PV88080_REG_HVBUCK_CONF1 (addr=0x2D|0x33) */
  74. #define PV88080_VHVBUCK_MASK 0xFF
  75. /* PV88080_REG_HVBUCK_CONF1 (addr=0x2E|0x34) */
  76. #define PV88080_HVBUCK_EN 0x01
  77. /* PV88080_REG_BUCK2_CONF2 (addr=0x61|0x63) */
  78. /* PV88080_REG_BUCK3_CONF2 (addr=0x69|0x6C) */
  79. #define PV88080_BUCK_VDAC_RANGE_SHIFT 7
  80. #define PV88080_BUCK_VDAC_RANGE_MASK 0x01
  81. #define PV88080_BUCK_VDAC_RANGE_1 0x00
  82. #define PV88080_BUCK_VDAC_RANGE_2 0x01
  83. /* PV88080_REG_BUCK2_CONF5 (addr=0x64|0x66) */
  84. /* PV88080_REG_BUCK3_CONF5 (addr=0x6C|0x6F) */
  85. #define PV88080_BUCK_VRANGE_GAIN_SHIFT 0
  86. #define PV88080_BUCK_VRANGE_GAIN_MASK 0x01
  87. #define PV88080_BUCK_VRANGE_GAIN_1 0x00
  88. #define PV88080_BUCK_VRANGE_GAIN_2 0x01
  89. #endif /* __PV88080_REGISTERS_H__ */