pv88080-regulator.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * pv88080-regulator.h - Regulator definitions for PV88080
  3. * Copyright (C) 2016 Powerventure Semiconductor Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef __PV88080_REGISTERS_H__
  16. #define __PV88080_REGISTERS_H__
  17. /* System Control and Event Registers */
  18. #define PV88080_REG_EVENT_A 0x04
  19. #define PV88080_REG_MASK_A 0x09
  20. #define PV88080_REG_MASK_B 0x0a
  21. #define PV88080_REG_MASK_C 0x0b
  22. /* Regulator Registers */
  23. #define PV88080_REG_BUCK1_CONF0 0x27
  24. #define PV88080_REG_BUCK1_CONF1 0x28
  25. #define PV88080_REG_BUCK1_CONF2 0x59
  26. #define PV88080_REG_BUCK1_CONF5 0x5c
  27. #define PV88080_REG_BUCK2_CONF0 0x29
  28. #define PV88080_REG_BUCK2_CONF1 0x2a
  29. #define PV88080_REG_BUCK2_CONF2 0x61
  30. #define PV88080_REG_BUCK2_CONF5 0x64
  31. #define PV88080_REG_BUCK3_CONF0 0x2b
  32. #define PV88080_REG_BUCK3_CONF1 0x2c
  33. #define PV88080_REG_BUCK3_CONF2 0x69
  34. #define PV88080_REG_BUCK3_CONF5 0x6c
  35. /* PV88080_REG_EVENT_A (addr=0x04) */
  36. #define PV88080_E_VDD_FLT 0x01
  37. #define PV88080_E_OVER_TEMP 0x02
  38. /* PV88080_REG_MASK_A (addr=0x09) */
  39. #define PV88080_M_VDD_FLT 0x01
  40. #define PV88080_M_OVER_TEMP 0x02
  41. /* PV88080_REG_BUCK1_CONF0 (addr=0x27) */
  42. #define PV88080_BUCK1_EN 0x80
  43. #define PV88080_VBUCK1_MASK 0x7F
  44. /* PV88080_REG_BUCK2_CONF0 (addr=0x29) */
  45. #define PV88080_BUCK2_EN 0x80
  46. #define PV88080_VBUCK2_MASK 0x7F
  47. /* PV88080_REG_BUCK3_CONF0 (addr=0x2b) */
  48. #define PV88080_BUCK3_EN 0x80
  49. #define PV88080_VBUCK3_MASK 0x7F
  50. /* PV88080_REG_BUCK1_CONF1 (addr=0x28) */
  51. #define PV88080_BUCK1_ILIM_SHIFT 2
  52. #define PV88080_BUCK1_ILIM_MASK 0x0C
  53. #define PV88080_BUCK1_MODE_MASK 0x03
  54. /* PV88080_REG_BUCK2_CONF1 (addr=0x2a) */
  55. #define PV88080_BUCK2_ILIM_SHIFT 2
  56. #define PV88080_BUCK2_ILIM_MASK 0x0C
  57. #define PV88080_BUCK2_MODE_MASK 0x03
  58. /* PV88080_REG_BUCK3_CONF1 (addr=0x2c) */
  59. #define PV88080_BUCK3_ILIM_SHIFT 2
  60. #define PV88080_BUCK3_ILIM_MASK 0x0C
  61. #define PV88080_BUCK3_MODE_MASK 0x03
  62. #define PV88080_BUCK_MODE_SLEEP 0x00
  63. #define PV88080_BUCK_MODE_AUTO 0x01
  64. #define PV88080_BUCK_MODE_SYNC 0x02
  65. /* PV88080_REG_BUCK2_CONF2 (addr=0x61) */
  66. /* PV88080_REG_BUCK3_CONF2 (addr=0x69) */
  67. #define PV88080_BUCK_VDAC_RANGE_SHIFT 7
  68. #define PV88080_BUCK_VDAC_RANGE_MASK 0x01
  69. #define PV88080_BUCK_VDAC_RANGE_1 0x00
  70. #define PV88080_BUCK_VDAC_RANGE_2 0x01
  71. /* PV88080_REG_BUCK2_CONF5 (addr=0x64) */
  72. /* PV88080_REG_BUCK3_CONF5 (addr=0x6c) */
  73. #define PV88080_BUCK_VRANGE_GAIN_SHIFT 0
  74. #define PV88080_BUCK_VRANGE_GAIN_MASK 0x01
  75. #define PV88080_BUCK_VRANGE_GAIN_1 0x00
  76. #define PV88080_BUCK_VRANGE_GAIN_2 0x01
  77. #endif /* __PV88080_REGISTERS_H__ */