mt6370.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2022 Richtek Technology Corp.
  4. *
  5. * Author: ChiYuan Huang <[email protected]>
  6. */
  7. #ifndef __MFD_MT6370_H__
  8. #define __MFD_MT6370_H__
  9. /* IRQ definitions */
  10. #define MT6370_IRQ_DIRCHGON 0
  11. #define MT6370_IRQ_CHG_TREG 4
  12. #define MT6370_IRQ_CHG_AICR 5
  13. #define MT6370_IRQ_CHG_MIVR 6
  14. #define MT6370_IRQ_PWR_RDY 7
  15. #define MT6370_IRQ_FL_CHG_VINOVP 11
  16. #define MT6370_IRQ_CHG_VSYSUV 12
  17. #define MT6370_IRQ_CHG_VSYSOV 13
  18. #define MT6370_IRQ_CHG_VBATOV 14
  19. #define MT6370_IRQ_CHG_VINOVPCHG 15
  20. #define MT6370_IRQ_TS_BAT_COLD 20
  21. #define MT6370_IRQ_TS_BAT_COOL 21
  22. #define MT6370_IRQ_TS_BAT_WARM 22
  23. #define MT6370_IRQ_TS_BAT_HOT 23
  24. #define MT6370_IRQ_TS_STATC 24
  25. #define MT6370_IRQ_CHG_FAULT 25
  26. #define MT6370_IRQ_CHG_STATC 26
  27. #define MT6370_IRQ_CHG_TMR 27
  28. #define MT6370_IRQ_CHG_BATABS 28
  29. #define MT6370_IRQ_CHG_ADPBAD 29
  30. #define MT6370_IRQ_CHG_RVP 30
  31. #define MT6370_IRQ_TSHUTDOWN 31
  32. #define MT6370_IRQ_CHG_IINMEAS 32
  33. #define MT6370_IRQ_CHG_ICCMEAS 33
  34. #define MT6370_IRQ_CHGDET_DONE 34
  35. #define MT6370_IRQ_WDTMR 35
  36. #define MT6370_IRQ_SSFINISH 36
  37. #define MT6370_IRQ_CHG_RECHG 37
  38. #define MT6370_IRQ_CHG_TERM 38
  39. #define MT6370_IRQ_CHG_IEOC 39
  40. #define MT6370_IRQ_ADC_DONE 40
  41. #define MT6370_IRQ_PUMPX_DONE 41
  42. #define MT6370_IRQ_BST_BATUV 45
  43. #define MT6370_IRQ_BST_MIDOV 46
  44. #define MT6370_IRQ_BST_OLP 47
  45. #define MT6370_IRQ_ATTACH 48
  46. #define MT6370_IRQ_DETACH 49
  47. #define MT6370_IRQ_HVDCP_STPDONE 51
  48. #define MT6370_IRQ_HVDCP_VBUSDET_DONE 52
  49. #define MT6370_IRQ_HVDCP_DET 53
  50. #define MT6370_IRQ_CHGDET 54
  51. #define MT6370_IRQ_DCDT 55
  52. #define MT6370_IRQ_DIRCHG_VGOK 59
  53. #define MT6370_IRQ_DIRCHG_WDTMR 60
  54. #define MT6370_IRQ_DIRCHG_UC 61
  55. #define MT6370_IRQ_DIRCHG_OC 62
  56. #define MT6370_IRQ_DIRCHG_OV 63
  57. #define MT6370_IRQ_OVPCTRL_SWON 67
  58. #define MT6370_IRQ_OVPCTRL_UVP_D 68
  59. #define MT6370_IRQ_OVPCTRL_UVP 69
  60. #define MT6370_IRQ_OVPCTRL_OVP_D 70
  61. #define MT6370_IRQ_OVPCTRL_OVP 71
  62. #define MT6370_IRQ_FLED_STRBPIN 72
  63. #define MT6370_IRQ_FLED_TORPIN 73
  64. #define MT6370_IRQ_FLED_TX 74
  65. #define MT6370_IRQ_FLED_LVF 75
  66. #define MT6370_IRQ_FLED2_SHORT 78
  67. #define MT6370_IRQ_FLED1_SHORT 79
  68. #define MT6370_IRQ_FLED2_STRB 80
  69. #define MT6370_IRQ_FLED1_STRB 81
  70. #define mT6370_IRQ_FLED2_STRB_TO 82
  71. #define MT6370_IRQ_FLED1_STRB_TO 83
  72. #define MT6370_IRQ_FLED2_TOR 84
  73. #define MT6370_IRQ_FLED1_TOR 85
  74. #define MT6370_IRQ_OTP 93
  75. #define MT6370_IRQ_VDDA_OVP 94
  76. #define MT6370_IRQ_VDDA_UV 95
  77. #define MT6370_IRQ_LDO_OC 103
  78. #define MT6370_IRQ_BLED_OCP 118
  79. #define MT6370_IRQ_BLED_OVP 119
  80. #define MT6370_IRQ_DSV_VNEG_OCP 123
  81. #define MT6370_IRQ_DSV_VPOS_OCP 124
  82. #define MT6370_IRQ_DSV_BST_OCP 125
  83. #define MT6370_IRQ_DSV_VNEG_SCP 126
  84. #define MT6370_IRQ_DSV_VPOS_SCP 127
  85. enum {
  86. MT6370_USBC_I2C = 0,
  87. MT6370_PMU_I2C,
  88. MT6370_MAX_I2C
  89. };
  90. struct mt6370_info {
  91. struct i2c_client *i2c[MT6370_MAX_I2C];
  92. struct regmap_irq_chip_data *irq_data;
  93. };
  94. #endif /* __MFD_MT6375_H__ */