tps65217.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2011-2013
  4. * Texas Instruments, <www.ti.com>
  5. *
  6. * For more details, please see the TRM at http://www.ti.com/product/tps65217a
  7. */
  8. #ifndef __POWER_TPS65217_H__
  9. #define __POWER_TPS65217_H__
  10. /* I2C chip address */
  11. #define TPS65217_CHIP_PM 0x24
  12. /* Registers */
  13. enum {
  14. TPS65217_CHIPID = 0x00,
  15. TPS65217_POWER_PATH,
  16. TPS65217_INTERRUPT,
  17. TPS65217_CHGCONFIG0,
  18. TPS65217_CHGCONFIG1,
  19. TPS65217_CHGCONFIG2,
  20. TPS65217_CHGCONFIG3,
  21. TPS65217_WLEDCTRL1,
  22. TPS65217_WLEDCTRL2,
  23. TPS65217_MUXCTRL,
  24. TPS65217_STATUS,
  25. TPS65217_PASSWORD,
  26. TPS65217_PGOOD,
  27. TPS65217_DEFPG,
  28. TPS65217_DEFDCDC1,
  29. TPS65217_DEFDCDC2,
  30. TPS65217_DEFDCDC3,
  31. TPS65217_DEFSLEW,
  32. TPS65217_DEFLDO1,
  33. TPS65217_DEFLDO2,
  34. TPS65217_DEFLS1,
  35. TPS65217_DEFLS2,
  36. TPS65217_ENABLE,
  37. TPS65217_RESERVED0, /* no 0x17 register available */
  38. TPS65217_DEFUVLO,
  39. TPS65217_SEQ1,
  40. TPS65217_SEQ2,
  41. TPS65217_SEQ3,
  42. TPS65217_SEQ4,
  43. TPS65217_SEQ5,
  44. TPS65217_SEQ6,
  45. TPS65217_PMIC_NUM_OF_REGS,
  46. };
  47. #define TPS65217_PROT_LEVEL_NONE 0x00
  48. #define TPS65217_PROT_LEVEL_1 0x01
  49. #define TPS65217_PROT_LEVEL_2 0x02
  50. #define TPS65217_PASSWORD_LOCK_FOR_WRITE 0x00
  51. #define TPS65217_PASSWORD_UNLOCK 0x7D
  52. #define TPS65217_DCDC_GO 0x80
  53. #define TPS65217_MASK_ALL_BITS 0xFF
  54. #define TPS65217_USB_INPUT_CUR_LIMIT_MASK 0x03
  55. #define TPS65217_USB_INPUT_CUR_LIMIT_100MA 0x00
  56. #define TPS65217_USB_INPUT_CUR_LIMIT_500MA 0x01
  57. #define TPS65217_USB_INPUT_CUR_LIMIT_1300MA 0x02
  58. #define TPS65217_USB_INPUT_CUR_LIMIT_1800MA 0x03
  59. #define TPS65217_DCDC_VOLT_SEL_950MV 0x02
  60. #define TPS65217_DCDC_VOLT_SEL_1100MV 0x08
  61. #define TPS65217_DCDC_VOLT_SEL_1125MV 0x09
  62. #define TPS65217_DCDC_VOLT_SEL_1200MV 0x0c
  63. #define TPS65217_DCDC_VOLT_SEL_1275MV 0x0F
  64. #define TPS65217_DCDC_VOLT_SEL_1325MV 0x11
  65. #define TPS65217_LDO_MASK 0x1F
  66. #define TPS65217_LDO_VOLTAGE_OUT_1_8 0x06
  67. #define TPS65217_LDO_VOLTAGE_OUT_3_3 0x1F
  68. #define TPS65217_PWR_OFF 0x80
  69. #define TPS65217_PWR_SRC_USB_BITMASK 0x4
  70. #define TPS65217_PWR_SRC_AC_BITMASK 0x8
  71. int power_tps65217_init(unsigned char bus);
  72. int tps65217_reg_read(uchar src_reg, uchar *src_val);
  73. int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
  74. uchar mask);
  75. int tps65217_voltage_update(uchar dc_cntrl_reg, uchar volt_sel);
  76. #endif /* __POWER_TPS65217_H__ */