tps6586x.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef __LINUX_MFD_TPS6586X_H
  2. #define __LINUX_MFD_TPS6586X_H
  3. #define TPS6586X_SLEW_RATE_INSTANTLY 0x00
  4. #define TPS6586X_SLEW_RATE_110UV 0x01
  5. #define TPS6586X_SLEW_RATE_220UV 0x02
  6. #define TPS6586X_SLEW_RATE_440UV 0x03
  7. #define TPS6586X_SLEW_RATE_880UV 0x04
  8. #define TPS6586X_SLEW_RATE_1760UV 0x05
  9. #define TPS6586X_SLEW_RATE_3520UV 0x06
  10. #define TPS6586X_SLEW_RATE_7040UV 0x07
  11. #define TPS6586X_SLEW_RATE_SET 0x08
  12. #define TPS6586X_SLEW_RATE_MASK 0x07
  13. /* VERSION CRC */
  14. #define TPS658621A 0x15
  15. #define TPS658621CD 0x2c
  16. #define TPS658623 0x1b
  17. #define TPS658640 0x01
  18. #define TPS658640v2 0x02
  19. #define TPS658643 0x03
  20. enum {
  21. TPS6586X_ID_SYS,
  22. TPS6586X_ID_SM_0,
  23. TPS6586X_ID_SM_1,
  24. TPS6586X_ID_SM_2,
  25. TPS6586X_ID_LDO_0,
  26. TPS6586X_ID_LDO_1,
  27. TPS6586X_ID_LDO_2,
  28. TPS6586X_ID_LDO_3,
  29. TPS6586X_ID_LDO_4,
  30. TPS6586X_ID_LDO_5,
  31. TPS6586X_ID_LDO_6,
  32. TPS6586X_ID_LDO_7,
  33. TPS6586X_ID_LDO_8,
  34. TPS6586X_ID_LDO_9,
  35. TPS6586X_ID_LDO_RTC,
  36. TPS6586X_ID_MAX_REGULATOR,
  37. };
  38. enum {
  39. TPS6586X_INT_PLDO_0,
  40. TPS6586X_INT_PLDO_1,
  41. TPS6586X_INT_PLDO_2,
  42. TPS6586X_INT_PLDO_3,
  43. TPS6586X_INT_PLDO_4,
  44. TPS6586X_INT_PLDO_5,
  45. TPS6586X_INT_PLDO_6,
  46. TPS6586X_INT_PLDO_7,
  47. TPS6586X_INT_COMP_DET,
  48. TPS6586X_INT_ADC,
  49. TPS6586X_INT_PLDO_8,
  50. TPS6586X_INT_PLDO_9,
  51. TPS6586X_INT_PSM_0,
  52. TPS6586X_INT_PSM_1,
  53. TPS6586X_INT_PSM_2,
  54. TPS6586X_INT_PSM_3,
  55. TPS6586X_INT_RTC_ALM1,
  56. TPS6586X_INT_ACUSB_OVP,
  57. TPS6586X_INT_USB_DET,
  58. TPS6586X_INT_AC_DET,
  59. TPS6586X_INT_BAT_DET,
  60. TPS6586X_INT_CHG_STAT,
  61. TPS6586X_INT_CHG_TEMP,
  62. TPS6586X_INT_PP,
  63. TPS6586X_INT_RESUME,
  64. TPS6586X_INT_LOW_SYS,
  65. TPS6586X_INT_RTC_ALM2,
  66. };
  67. struct tps6586x_settings {
  68. int slew_rate;
  69. };
  70. struct tps6586x_subdev_info {
  71. int id;
  72. const char *name;
  73. void *platform_data;
  74. struct device_node *of_node;
  75. };
  76. struct tps6586x_platform_data {
  77. int num_subdevs;
  78. struct tps6586x_subdev_info *subdevs;
  79. int gpio_base;
  80. int irq_base;
  81. bool pm_off;
  82. struct regulator_init_data *reg_init_data[TPS6586X_ID_MAX_REGULATOR];
  83. };
  84. /*
  85. * NOTE: the functions below are not intended for use outside
  86. * of the TPS6586X sub-device drivers
  87. */
  88. extern int tps6586x_write(struct device *dev, int reg, uint8_t val);
  89. extern int tps6586x_writes(struct device *dev, int reg, int len, uint8_t *val);
  90. extern int tps6586x_read(struct device *dev, int reg, uint8_t *val);
  91. extern int tps6586x_reads(struct device *dev, int reg, int len, uint8_t *val);
  92. extern int tps6586x_set_bits(struct device *dev, int reg, uint8_t bit_mask);
  93. extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
  94. extern int tps6586x_update(struct device *dev, int reg, uint8_t val,
  95. uint8_t mask);
  96. extern int tps6586x_irq_get_virq(struct device *dev, int irq);
  97. extern int tps6586x_get_version(struct device *dev);
  98. #endif /*__LINUX_MFD_TPS6586X_H */