tps65086.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
  3. * Andrew F. Davis <afd@ti.com>
  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 version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  10. * kind, whether expressed or implied; without even the implied warranty
  11. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License version 2 for more details.
  13. *
  14. * Based on the TPS65912 driver
  15. */
  16. #ifndef __LINUX_MFD_TPS65086_H
  17. #define __LINUX_MFD_TPS65086_H
  18. #include <linux/device.h>
  19. #include <linux/regmap.h>
  20. /* List of registers for TPS65086 */
  21. #define TPS65086_DEVICEID 0x01
  22. #define TPS65086_IRQ 0x02
  23. #define TPS65086_IRQ_MASK 0x03
  24. #define TPS65086_PMICSTAT 0x04
  25. #define TPS65086_SHUTDNSRC 0x05
  26. #define TPS65086_BUCK1CTRL 0x20
  27. #define TPS65086_BUCK2CTRL 0x21
  28. #define TPS65086_BUCK3DECAY 0x22
  29. #define TPS65086_BUCK3VID 0x23
  30. #define TPS65086_BUCK3SLPCTRL 0x24
  31. #define TPS65086_BUCK4CTRL 0x25
  32. #define TPS65086_BUCK5CTRL 0x26
  33. #define TPS65086_BUCK6CTRL 0x27
  34. #define TPS65086_LDOA2CTRL 0x28
  35. #define TPS65086_LDOA3CTRL 0x29
  36. #define TPS65086_DISCHCTRL1 0x40
  37. #define TPS65086_DISCHCTRL2 0x41
  38. #define TPS65086_DISCHCTRL3 0x42
  39. #define TPS65086_PG_DELAY1 0x43
  40. #define TPS65086_FORCESHUTDN 0x91
  41. #define TPS65086_BUCK1SLPCTRL 0x92
  42. #define TPS65086_BUCK2SLPCTRL 0x93
  43. #define TPS65086_BUCK4VID 0x94
  44. #define TPS65086_BUCK4SLPVID 0x95
  45. #define TPS65086_BUCK5VID 0x96
  46. #define TPS65086_BUCK5SLPVID 0x97
  47. #define TPS65086_BUCK6VID 0x98
  48. #define TPS65086_BUCK6SLPVID 0x99
  49. #define TPS65086_LDOA2VID 0x9A
  50. #define TPS65086_LDOA3VID 0x9B
  51. #define TPS65086_BUCK123CTRL 0x9C
  52. #define TPS65086_PG_DELAY2 0x9D
  53. #define TPS65086_PIN_EN_MASK1 0x9E
  54. #define TPS65086_PIN_EN_MASK2 0x9F
  55. #define TPS65086_SWVTT_EN 0x9F
  56. #define TPS65086_PIN_EN_OVR1 0xA0
  57. #define TPS65086_PIN_EN_OVR2 0xA1
  58. #define TPS65086_GPOCTRL 0xA1
  59. #define TPS65086_PWR_FAULT_MASK1 0xA2
  60. #define TPS65086_PWR_FAULT_MASK2 0xA3
  61. #define TPS65086_GPO1PG_CTRL1 0xA4
  62. #define TPS65086_GPO1PG_CTRL2 0xA5
  63. #define TPS65086_GPO4PG_CTRL1 0xA6
  64. #define TPS65086_GPO4PG_CTRL2 0xA7
  65. #define TPS65086_GPO2PG_CTRL1 0xA8
  66. #define TPS65086_GPO2PG_CTRL2 0xA9
  67. #define TPS65086_GPO3PG_CTRL1 0xAA
  68. #define TPS65086_GPO3PG_CTRL2 0xAB
  69. #define TPS65086_LDOA1CTRL 0xAE
  70. #define TPS65086_PG_STATUS1 0xB0
  71. #define TPS65086_PG_STATUS2 0xB1
  72. #define TPS65086_PWR_FAULT_STATUS1 0xB2
  73. #define TPS65086_PWR_FAULT_STATUS2 0xB3
  74. #define TPS65086_TEMPCRIT 0xB4
  75. #define TPS65086_TEMPHOT 0xB5
  76. #define TPS65086_OC_STATUS 0xB6
  77. /* IRQ Register field definitions */
  78. #define TPS65086_IRQ_DIETEMP_MASK BIT(0)
  79. #define TPS65086_IRQ_SHUTDN_MASK BIT(3)
  80. #define TPS65086_IRQ_FAULT_MASK BIT(7)
  81. /* DEVICEID Register field definitions */
  82. #define TPS65086_DEVICEID_PART_MASK GENMASK(3, 0)
  83. #define TPS65086_DEVICEID_OTP_MASK GENMASK(5, 4)
  84. #define TPS65086_DEVICEID_REV_MASK GENMASK(7, 6)
  85. /* VID Masks */
  86. #define BUCK_VID_MASK GENMASK(7, 1)
  87. #define VDOA1_VID_MASK GENMASK(4, 1)
  88. #define VDOA23_VID_MASK GENMASK(3, 0)
  89. /* Define the TPS65086 IRQ numbers */
  90. enum tps65086_irqs {
  91. TPS65086_IRQ_DIETEMP,
  92. TPS65086_IRQ_SHUTDN,
  93. TPS65086_IRQ_FAULT,
  94. };
  95. /**
  96. * struct tps65086 - state holder for the tps65086 driver
  97. *
  98. * Device data may be used to access the TPS65086 chip
  99. */
  100. struct tps65086 {
  101. struct device *dev;
  102. struct regmap *regmap;
  103. /* IRQ Data */
  104. int irq;
  105. struct regmap_irq_chip_data *irq_data;
  106. };
  107. #endif /* __LINUX_MFD_TPS65086_H */