~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mfd/tps6594.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Functions to access TPS6594 Power Management IC
  4  *
  5  * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
  6  */
  7 
  8 #ifndef __LINUX_MFD_TPS6594_H
  9 #define __LINUX_MFD_TPS6594_H
 10 
 11 #include <linux/device.h>
 12 #include <linux/regmap.h>
 13 
 14 struct regmap_irq_chip_data;
 15 
 16 /* Chip id list */
 17 enum pmic_id {
 18         TPS6594,
 19         TPS6593,
 20         LP8764,
 21         TPS65224,
 22 };
 23 
 24 /* Macro to get page index from register address */
 25 #define TPS6594_REG_TO_PAGE(reg)        ((reg) >> 8)
 26 
 27 /* Registers for page 0 */
 28 #define TPS6594_REG_DEV_REV                             0x01
 29 
 30 #define TPS6594_REG_NVM_CODE_1                          0x02
 31 #define TPS6594_REG_NVM_CODE_2                          0x03
 32 
 33 #define TPS6594_REG_BUCKX_CTRL(buck_inst)               (0x04 + ((buck_inst) << 1))
 34 #define TPS6594_REG_BUCKX_CONF(buck_inst)               (0x05 + ((buck_inst) << 1))
 35 #define TPS6594_REG_BUCKX_VOUT_1(buck_inst)             (0x0e + ((buck_inst) << 1))
 36 #define TPS6594_REG_BUCKX_VOUT_2(buck_inst)             (0x0f + ((buck_inst) << 1))
 37 #define TPS6594_REG_BUCKX_PG_WINDOW(buck_inst)          (0x18 + (buck_inst))
 38 
 39 #define TPS6594_REG_LDOX_CTRL(ldo_inst)                 (0x1d + (ldo_inst))
 40 #define TPS6594_REG_LDORTC_CTRL                         0x22
 41 #define TPS6594_REG_LDOX_VOUT(ldo_inst)                 (0x23 + (ldo_inst))
 42 #define TPS6594_REG_LDOX_PG_WINDOW(ldo_inst)            (0x27 + (ldo_inst))
 43 
 44 #define TPS6594_REG_VCCA_VMON_CTRL                      0x2b
 45 #define TPS6594_REG_VCCA_PG_WINDOW                      0x2c
 46 #define TPS6594_REG_VMON1_PG_WINDOW                     0x2d
 47 #define TPS6594_REG_VMON1_PG_LEVEL                      0x2e
 48 #define TPS6594_REG_VMON2_PG_WINDOW                     0x2f
 49 #define TPS6594_REG_VMON2_PG_LEVEL                      0x30
 50 
 51 #define TPS6594_REG_GPIOX_CONF(gpio_inst)               (0x31 + (gpio_inst))
 52 #define TPS6594_REG_NPWRON_CONF                         0x3c
 53 #define TPS6594_REG_GPIO_OUT_1                          0x3d
 54 #define TPS6594_REG_GPIO_OUT_2                          0x3e
 55 #define TPS6594_REG_GPIO_IN_1                           0x3f
 56 #define TPS6594_REG_GPIO_IN_2                           0x40
 57 #define TPS6594_REG_GPIOX_OUT(gpio_inst)                (TPS6594_REG_GPIO_OUT_1 + (gpio_inst) / 8)
 58 #define TPS6594_REG_GPIOX_IN(gpio_inst)                 (TPS6594_REG_GPIO_IN_1 + (gpio_inst) / 8)
 59 
 60 #define TPS6594_REG_RAIL_SEL_1                          0x41
 61 #define TPS6594_REG_RAIL_SEL_2                          0x42
 62 #define TPS6594_REG_RAIL_SEL_3                          0x43
 63 
 64 #define TPS6594_REG_FSM_TRIG_SEL_1                      0x44
 65 #define TPS6594_REG_FSM_TRIG_SEL_2                      0x45
 66 #define TPS6594_REG_FSM_TRIG_MASK_1                     0x46
 67 #define TPS6594_REG_FSM_TRIG_MASK_2                     0x47
 68 #define TPS6594_REG_FSM_TRIG_MASK_3                     0x48
 69 
 70 #define TPS6594_REG_MASK_BUCK1_2                        0x49
 71 #define TPS65224_REG_MASK_BUCKS                         0x49
 72 #define TPS6594_REG_MASK_BUCK3_4                        0x4a
 73 #define TPS6594_REG_MASK_BUCK5                          0x4b
 74 #define TPS6594_REG_MASK_LDO1_2                         0x4c
 75 #define TPS65224_REG_MASK_LDOS                          0x4c
 76 #define TPS6594_REG_MASK_LDO3_4                         0x4d
 77 #define TPS6594_REG_MASK_VMON                           0x4e
 78 #define TPS6594_REG_MASK_GPIO_FALL                      0x4f
 79 #define TPS6594_REG_MASK_GPIO_RISE                      0x50
 80 #define TPS6594_REG_MASK_GPIO9_11                       0x51
 81 #define TPS6594_REG_MASK_STARTUP                        0x52
 82 #define TPS6594_REG_MASK_MISC                           0x53
 83 #define TPS6594_REG_MASK_MODERATE_ERR                   0x54
 84 #define TPS6594_REG_MASK_FSM_ERR                        0x56
 85 #define TPS6594_REG_MASK_COMM_ERR                       0x57
 86 #define TPS6594_REG_MASK_READBACK_ERR                   0x58
 87 #define TPS6594_REG_MASK_ESM                            0x59
 88 
 89 #define TPS6594_REG_INT_TOP                             0x5a
 90 #define TPS6594_REG_INT_BUCK                            0x5b
 91 #define TPS6594_REG_INT_BUCK1_2                         0x5c
 92 #define TPS6594_REG_INT_BUCK3_4                         0x5d
 93 #define TPS6594_REG_INT_BUCK5                           0x5e
 94 #define TPS6594_REG_INT_LDO_VMON                        0x5f
 95 #define TPS6594_REG_INT_LDO1_2                          0x60
 96 #define TPS6594_REG_INT_LDO3_4                          0x61
 97 #define TPS6594_REG_INT_VMON                            0x62
 98 #define TPS6594_REG_INT_GPIO                            0x63
 99 #define TPS6594_REG_INT_GPIO1_8                         0x64
100 #define TPS6594_REG_INT_STARTUP                         0x65
101 #define TPS6594_REG_INT_MISC                            0x66
102 #define TPS6594_REG_INT_MODERATE_ERR                    0x67
103 #define TPS6594_REG_INT_SEVERE_ERR                      0x68
104 #define TPS6594_REG_INT_FSM_ERR                         0x69
105 #define TPS6594_REG_INT_COMM_ERR                        0x6a
106 #define TPS6594_REG_INT_READBACK_ERR                    0x6b
107 #define TPS6594_REG_INT_ESM                             0x6c
108 
109 #define TPS6594_REG_STAT_BUCK1_2                        0x6d
110 #define TPS6594_REG_STAT_BUCK3_4                        0x6e
111 #define TPS6594_REG_STAT_BUCK5                          0x6f
112 #define TPS6594_REG_STAT_LDO1_2                         0x70
113 #define TPS6594_REG_STAT_LDO3_4                         0x71
114 #define TPS6594_REG_STAT_VMON                           0x72
115 #define TPS6594_REG_STAT_STARTUP                        0x73
116 #define TPS6594_REG_STAT_MISC                           0x74
117 #define TPS6594_REG_STAT_MODERATE_ERR                   0x75
118 #define TPS6594_REG_STAT_SEVERE_ERR                     0x76
119 #define TPS6594_REG_STAT_READBACK_ERR                   0x77
120 
121 #define TPS6594_REG_PGOOD_SEL_1                         0x78
122 #define TPS6594_REG_PGOOD_SEL_2                         0x79
123 #define TPS6594_REG_PGOOD_SEL_3                         0x7a
124 #define TPS6594_REG_PGOOD_SEL_4                         0x7b
125 
126 #define TPS6594_REG_PLL_CTRL                            0x7c
127 
128 #define TPS6594_REG_CONFIG_1                            0x7d
129 #define TPS6594_REG_CONFIG_2                            0x7e
130 
131 #define TPS6594_REG_ENABLE_DRV_REG                      0x80
132 
133 #define TPS6594_REG_MISC_CTRL                           0x81
134 
135 #define TPS6594_REG_ENABLE_DRV_STAT                     0x82
136 
137 #define TPS6594_REG_RECOV_CNT_REG_1                     0x83
138 #define TPS6594_REG_RECOV_CNT_REG_2                     0x84
139 
140 #define TPS6594_REG_FSM_I2C_TRIGGERS                    0x85
141 #define TPS6594_REG_FSM_NSLEEP_TRIGGERS                 0x86
142 
143 #define TPS6594_REG_BUCK_RESET_REG                      0x87
144 
145 #define TPS6594_REG_SPREAD_SPECTRUM_1                   0x88
146 
147 #define TPS6594_REG_FREQ_SEL                            0x8a
148 
149 #define TPS6594_REG_FSM_STEP_SIZE                       0x8b
150 
151 #define TPS6594_REG_LDO_RV_TIMEOUT_REG_1                0x8c
152 #define TPS6594_REG_LDO_RV_TIMEOUT_REG_2                0x8d
153 
154 #define TPS6594_REG_USER_SPARE_REGS                     0x8e
155 
156 #define TPS6594_REG_ESM_MCU_START_REG                   0x8f
157 #define TPS6594_REG_ESM_MCU_DELAY1_REG                  0x90
158 #define TPS6594_REG_ESM_MCU_DELAY2_REG                  0x91
159 #define TPS6594_REG_ESM_MCU_MODE_CFG                    0x92
160 #define TPS6594_REG_ESM_MCU_HMAX_REG                    0x93
161 #define TPS6594_REG_ESM_MCU_HMIN_REG                    0x94
162 #define TPS6594_REG_ESM_MCU_LMAX_REG                    0x95
163 #define TPS6594_REG_ESM_MCU_LMIN_REG                    0x96
164 #define TPS6594_REG_ESM_MCU_ERR_CNT_REG                 0x97
165 #define TPS6594_REG_ESM_SOC_START_REG                   0x98
166 #define TPS6594_REG_ESM_SOC_DELAY1_REG                  0x99
167 #define TPS6594_REG_ESM_SOC_DELAY2_REG                  0x9a
168 #define TPS6594_REG_ESM_SOC_MODE_CFG                    0x9b
169 #define TPS6594_REG_ESM_SOC_HMAX_REG                    0x9c
170 #define TPS6594_REG_ESM_SOC_HMIN_REG                    0x9d
171 #define TPS6594_REG_ESM_SOC_LMAX_REG                    0x9e
172 #define TPS6594_REG_ESM_SOC_LMIN_REG                    0x9f
173 #define TPS6594_REG_ESM_SOC_ERR_CNT_REG                 0xa0
174 
175 #define TPS6594_REG_REGISTER_LOCK                       0xa1
176 
177 #define TPS65224_REG_SRAM_ACCESS_1                      0xa2
178 #define TPS65224_REG_SRAM_ACCESS_2                      0xa3
179 #define TPS65224_REG_SRAM_ADDR_CTRL                     0xa4
180 #define TPS65224_REG_RECOV_CNT_PFSM_INCR                0xa5
181 #define TPS6594_REG_MANUFACTURING_VER                   0xa6
182 
183 #define TPS6594_REG_CUSTOMER_NVM_ID_REG                 0xa7
184 
185 #define TPS6594_REG_VMON_CONF_REG                       0xa8
186 
187 #define TPS6594_REG_SOFT_REBOOT_REG                     0xab
188 
189 #define TPS65224_REG_ADC_CTRL                           0xac
190 #define TPS65224_REG_ADC_RESULT_REG_1                   0xad
191 #define TPS65224_REG_ADC_RESULT_REG_2                   0xae
192 #define TPS6594_REG_RTC_SECONDS                         0xb5
193 #define TPS6594_REG_RTC_MINUTES                         0xb6
194 #define TPS6594_REG_RTC_HOURS                           0xb7
195 #define TPS6594_REG_RTC_DAYS                            0xb8
196 #define TPS6594_REG_RTC_MONTHS                          0xb9
197 #define TPS6594_REG_RTC_YEARS                           0xba
198 #define TPS6594_REG_RTC_WEEKS                           0xbb
199 
200 #define TPS6594_REG_ALARM_SECONDS                       0xbc
201 #define TPS6594_REG_ALARM_MINUTES                       0xbd
202 #define TPS6594_REG_ALARM_HOURS                         0xbe
203 #define TPS6594_REG_ALARM_DAYS                          0xbf
204 #define TPS6594_REG_ALARM_MONTHS                        0xc0
205 #define TPS6594_REG_ALARM_YEARS                         0xc1
206 
207 #define TPS6594_REG_RTC_CTRL_1                          0xc2
208 #define TPS6594_REG_RTC_CTRL_2                          0xc3
209 #define TPS65224_REG_STARTUP_CTRL                       0xc3
210 #define TPS6594_REG_RTC_STATUS                          0xc4
211 #define TPS6594_REG_RTC_INTERRUPTS                      0xc5
212 #define TPS6594_REG_RTC_COMP_LSB                        0xc6
213 #define TPS6594_REG_RTC_COMP_MSB                        0xc7
214 #define TPS6594_REG_RTC_RESET_STATUS                    0xc8
215 
216 #define TPS6594_REG_SCRATCH_PAD_REG_1                   0xc9
217 #define TPS6594_REG_SCRATCH_PAD_REG_2                   0xca
218 #define TPS6594_REG_SCRATCH_PAD_REG_3                   0xcb
219 #define TPS6594_REG_SCRATCH_PAD_REG_4                   0xcc
220 
221 #define TPS6594_REG_PFSM_DELAY_REG_1                    0xcd
222 #define TPS6594_REG_PFSM_DELAY_REG_2                    0xce
223 #define TPS6594_REG_PFSM_DELAY_REG_3                    0xcf
224 #define TPS6594_REG_PFSM_DELAY_REG_4                    0xd0
225 #define TPS65224_REG_ADC_GAIN_COMP_REG                  0xd0
226 #define TPS65224_REG_CRC_CALC_CONTROL                   0xef
227 #define TPS65224_REG_REGMAP_USER_CRC_LOW                0xf0
228 #define TPS65224_REG_REGMAP_USER_CRC_HIGH               0xf1
229 
230 /* Registers for page 1 */
231 #define TPS6594_REG_SERIAL_IF_CONFIG                    0x11a
232 #define TPS6594_REG_I2C1_ID                             0x122
233 #define TPS6594_REG_I2C2_ID                             0x123
234 
235 /* Registers for page 4 */
236 #define TPS6594_REG_WD_ANSWER_REG                       0x401
237 #define TPS6594_REG_WD_QUESTION_ANSW_CNT                0x402
238 #define TPS6594_REG_WD_WIN1_CFG                         0x403
239 #define TPS6594_REG_WD_WIN2_CFG                         0x404
240 #define TPS6594_REG_WD_LONGWIN_CFG                      0x405
241 #define TPS6594_REG_WD_MODE_REG                         0x406
242 #define TPS6594_REG_WD_QA_CFG                           0x407
243 #define TPS6594_REG_WD_ERR_STATUS                       0x408
244 #define TPS6594_REG_WD_THR_CFG                          0x409
245 #define TPS6594_REG_DWD_FAIL_CNT_REG                    0x40a
246 
247 /* BUCKX_CTRL register field definition */
248 #define TPS6594_BIT_BUCK_EN                             BIT(0)
249 #define TPS6594_BIT_BUCK_FPWM                           BIT(1)
250 #define TPS6594_BIT_BUCK_FPWM_MP                        BIT(2)
251 #define TPS6594_BIT_BUCK_VSEL                           BIT(3)
252 #define TPS6594_BIT_BUCK_VMON_EN                        BIT(4)
253 #define TPS6594_BIT_BUCK_PLDN                           BIT(5)
254 #define TPS6594_BIT_BUCK_RV_SEL                         BIT(7)
255 
256 /* TPS6594 BUCKX_CONF register field definition */
257 #define TPS6594_MASK_BUCK_SLEW_RATE                     GENMASK(2, 0)
258 #define TPS6594_MASK_BUCK_ILIM                          GENMASK(5, 3)
259 
260 /* TPS65224 BUCKX_CONF register field definition */
261 #define TPS65224_MASK_BUCK_SLEW_RATE                    GENMASK(1, 0)
262 
263 /* TPS6594 BUCKX_PG_WINDOW register field definition */
264 #define TPS6594_MASK_BUCK_OV_THR                        GENMASK(2, 0)
265 #define TPS6594_MASK_BUCK_UV_THR                        GENMASK(5, 3)
266 
267 /* TPS65224 BUCKX_PG_WINDOW register field definition */
268 #define TPS65224_MASK_BUCK_VMON_THR                     GENMASK(1, 0)
269 
270 /* TPS6594 BUCKX_VOUT register field definition */
271 #define TPS6594_MASK_BUCKS_VSET                         GENMASK(7, 0)
272 
273 /* TPS65224 BUCKX_VOUT register field definition */
274 #define TPS65224_MASK_BUCK1_VSET                        GENMASK(7, 0)
275 #define TPS65224_MASK_BUCKS_VSET                        GENMASK(6, 0)
276 
277 /* LDOX_CTRL register field definition */
278 #define TPS6594_BIT_LDO_EN                              BIT(0)
279 #define TPS6594_BIT_LDO_SLOW_RAMP                       BIT(1)
280 #define TPS6594_BIT_LDO_VMON_EN                         BIT(4)
281 #define TPS6594_MASK_LDO_PLDN                           GENMASK(6, 5)
282 #define TPS6594_BIT_LDO_RV_SEL                          BIT(7)
283 #define TPS65224_BIT_LDO_DISCHARGE_EN                   BIT(5)
284 
285 /* LDORTC_CTRL register field definition */
286 #define TPS6594_BIT_LDORTC_DIS                          BIT(0)
287 
288 /* LDOX_VOUT register field definition */
289 #define TPS6594_MASK_LDO123_VSET                        GENMASK(6, 1)
290 #define TPS6594_MASK_LDO4_VSET                          GENMASK(6, 0)
291 #define TPS6594_BIT_LDO_BYPASS                          BIT(7)
292 
293 /* LDOX_PG_WINDOW register field definition */
294 #define TPS6594_MASK_LDO_OV_THR                         GENMASK(2, 0)
295 #define TPS6594_MASK_LDO_UV_THR                         GENMASK(5, 3)
296 
297 /* LDOX_PG_WINDOW register field definition */
298 #define TPS65224_MASK_LDO_VMON_THR                      GENMASK(1, 0)
299 
300 /* VCCA_VMON_CTRL register field definition */
301 #define TPS6594_BIT_VMON_EN                             BIT(0)
302 #define TPS6594_BIT_VMON1_EN                            BIT(1)
303 #define TPS6594_BIT_VMON1_RV_SEL                        BIT(2)
304 #define TPS6594_BIT_VMON2_EN                            BIT(3)
305 #define TPS6594_BIT_VMON2_RV_SEL                        BIT(4)
306 #define TPS6594_BIT_VMON_DEGLITCH_SEL                   BIT(5)
307 #define TPS65224_BIT_VMON_DEGLITCH_SEL                  GENMASK(7, 5)
308 
309 /* VCCA_PG_WINDOW register field definition */
310 #define TPS6594_MASK_VCCA_OV_THR                        GENMASK(2, 0)
311 #define TPS6594_MASK_VCCA_UV_THR                        GENMASK(5, 3)
312 #define TPS65224_MASK_VCCA_VMON_THR                     GENMASK(1, 0)
313 #define TPS6594_BIT_VCCA_PG_SET                         BIT(6)
314 
315 /* VMONX_PG_WINDOW register field definition */
316 #define TPS6594_MASK_VMONX_OV_THR                       GENMASK(2, 0)
317 #define TPS6594_MASK_VMONX_UV_THR                       GENMASK(5, 3)
318 #define TPS6594_BIT_VMONX_RANGE                         BIT(6)
319 
320 /* VMONX_PG_WINDOW register field definition */
321 #define TPS65224_MASK_VMONX_THR                         GENMASK(1, 0)
322 
323 /* GPIOX_CONF register field definition */
324 #define TPS6594_BIT_GPIO_DIR                            BIT(0)
325 #define TPS6594_BIT_GPIO_OD                             BIT(1)
326 #define TPS6594_BIT_GPIO_PU_SEL                         BIT(2)
327 #define TPS6594_BIT_GPIO_PU_PD_EN                       BIT(3)
328 #define TPS6594_BIT_GPIO_DEGLITCH_EN                    BIT(4)
329 #define TPS6594_MASK_GPIO_SEL                           GENMASK(7, 5)
330 #define TPS65224_MASK_GPIO_SEL                          GENMASK(6, 5)
331 #define TPS65224_MASK_GPIO_SEL_GPIO6                    GENMASK(7, 5)
332 
333 /* NPWRON_CONF register field definition */
334 #define TPS6594_BIT_NRSTOUT_OD                          BIT(0)
335 #define TPS6594_BIT_ENABLE_PU_SEL                       BIT(2)
336 #define TPS6594_BIT_ENABLE_PU_PD_EN                     BIT(3)
337 #define TPS6594_BIT_ENABLE_DEGLITCH_EN                  BIT(4)
338 #define TPS6594_BIT_ENABLE_POL                          BIT(5)
339 #define TPS6594_MASK_NPWRON_SEL                         GENMASK(7, 6)
340 
341 /* POWER_ON_CONFIG register field definition */
342 #define TPS65224_BIT_NINT_ENDRV_PU_SEL                  BIT(0)
343 #define TPS65224_BIT_NINT_ENDRV_SEL                     BIT(1)
344 #define TPS65224_BIT_EN_PB_DEGL                         BIT(5)
345 #define TPS65224_MASK_EN_PB_VSENSE_CONFIG               GENMASK(7, 6)
346 
347 /* GPIO_OUT_X register field definition */
348 #define TPS6594_BIT_GPIOX_OUT(gpio_inst)                BIT((gpio_inst) % 8)
349 
350 /* GPIO_IN_X register field definition */
351 #define TPS6594_BIT_GPIOX_IN(gpio_inst)                 BIT((gpio_inst) % 8)
352 #define TPS6594_BIT_NPWRON_IN                           BIT(3)
353 
354 /* GPIO_OUT_X register field definition */
355 #define TPS65224_BIT_GPIOX_OUT(gpio_inst)               BIT((gpio_inst))
356 
357 /* GPIO_IN_X register field definition */
358 #define TPS65224_BIT_GPIOX_IN(gpio_inst)                BIT((gpio_inst))
359 
360 /* RAIL_SEL_1 register field definition */
361 #define TPS6594_MASK_BUCK1_GRP_SEL                      GENMASK(1, 0)
362 #define TPS6594_MASK_BUCK2_GRP_SEL                      GENMASK(3, 2)
363 #define TPS6594_MASK_BUCK3_GRP_SEL                      GENMASK(5, 4)
364 #define TPS6594_MASK_BUCK4_GRP_SEL                      GENMASK(7, 6)
365 
366 /* RAIL_SEL_2 register field definition */
367 #define TPS6594_MASK_BUCK5_GRP_SEL                      GENMASK(1, 0)
368 #define TPS6594_MASK_LDO1_GRP_SEL                       GENMASK(3, 2)
369 #define TPS6594_MASK_LDO2_GRP_SEL                       GENMASK(5, 4)
370 #define TPS6594_MASK_LDO3_GRP_SEL                       GENMASK(7, 6)
371 
372 /* RAIL_SEL_3 register field definition */
373 #define TPS6594_MASK_LDO4_GRP_SEL                       GENMASK(1, 0)
374 #define TPS6594_MASK_VCCA_GRP_SEL                       GENMASK(3, 2)
375 #define TPS6594_MASK_VMON1_GRP_SEL                      GENMASK(5, 4)
376 #define TPS6594_MASK_VMON2_GRP_SEL                      GENMASK(7, 6)
377 
378 /* FSM_TRIG_SEL_1 register field definition */
379 #define TPS6594_MASK_MCU_RAIL_TRIG                      GENMASK(1, 0)
380 #define TPS6594_MASK_SOC_RAIL_TRIG                      GENMASK(3, 2)
381 #define TPS6594_MASK_OTHER_RAIL_TRIG                    GENMASK(5, 4)
382 #define TPS6594_MASK_SEVERE_ERR_TRIG                    GENMASK(7, 6)
383 
384 /* FSM_TRIG_SEL_2 register field definition */
385 #define TPS6594_MASK_MODERATE_ERR_TRIG                  GENMASK(1, 0)
386 
387 /* FSM_TRIG_MASK_X register field definition */
388 #define TPS6594_BIT_GPIOX_FSM_MASK(gpio_inst)           BIT(((gpio_inst) << 1) % 8)
389 #define TPS6594_BIT_GPIOX_FSM_MASK_POL(gpio_inst)       BIT(((gpio_inst) << 1) % 8 + 1)
390 
391 #define TPS65224_BIT_GPIOX_FSM_MASK(gpio_inst)          BIT(((gpio_inst) << 1) % 6)
392 #define TPS65224_BIT_GPIOX_FSM_MASK_POL(gpio_inst)      BIT(((gpio_inst) << 1) % 6 + 1)
393 
394 /* MASK_BUCKX register field definition */
395 #define TPS6594_BIT_BUCKX_OV_MASK(buck_inst)            BIT(((buck_inst) << 2) % 8)
396 #define TPS6594_BIT_BUCKX_UV_MASK(buck_inst)            BIT(((buck_inst) << 2) % 8 + 1)
397 #define TPS6594_BIT_BUCKX_ILIM_MASK(buck_inst)          BIT(((buck_inst) << 2) % 8 + 3)
398 
399 /* MASK_LDOX register field definition */
400 #define TPS6594_BIT_LDOX_OV_MASK(ldo_inst)              BIT(((ldo_inst) << 2) % 8)
401 #define TPS6594_BIT_LDOX_UV_MASK(ldo_inst)              BIT(((ldo_inst) << 2) % 8 + 1)
402 #define TPS6594_BIT_LDOX_ILIM_MASK(ldo_inst)            BIT(((ldo_inst) << 2) % 8 + 3)
403 
404 /* MASK_VMON register field definition */
405 #define TPS6594_BIT_VCCA_OV_MASK                        BIT(0)
406 #define TPS6594_BIT_VCCA_UV_MASK                        BIT(1)
407 #define TPS6594_BIT_VMON1_OV_MASK                       BIT(2)
408 #define TPS6594_BIT_VMON1_UV_MASK                       BIT(3)
409 #define TPS6594_BIT_VMON2_OV_MASK                       BIT(5)
410 #define TPS6594_BIT_VMON2_UV_MASK                       BIT(6)
411 
412 /* MASK_BUCK Register field definition */
413 #define TPS65224_BIT_BUCK1_UVOV_MASK                    BIT(0)
414 #define TPS65224_BIT_BUCK2_UVOV_MASK                    BIT(1)
415 #define TPS65224_BIT_BUCK3_UVOV_MASK                    BIT(2)
416 #define TPS65224_BIT_BUCK4_UVOV_MASK                    BIT(4)
417 
418 /* MASK_LDO_VMON register field definition */
419 #define TPS65224_BIT_LDO1_UVOV_MASK                     BIT(0)
420 #define TPS65224_BIT_LDO2_UVOV_MASK                     BIT(1)
421 #define TPS65224_BIT_LDO3_UVOV_MASK                     BIT(2)
422 #define TPS65224_BIT_VCCA_UVOV_MASK                     BIT(4)
423 #define TPS65224_BIT_VMON1_UVOV_MASK                    BIT(5)
424 #define TPS65224_BIT_VMON2_UVOV_MASK                    BIT(6)
425 
426 /* MASK_GPIOX register field definition */
427 #define TPS6594_BIT_GPIOX_FALL_MASK(gpio_inst)          BIT((gpio_inst) < 8 ? \
428                                                             (gpio_inst) : (gpio_inst) % 8)
429 #define TPS6594_BIT_GPIOX_RISE_MASK(gpio_inst)          BIT((gpio_inst) < 8 ? \
430                                                             (gpio_inst) : (gpio_inst) % 8 + 3)
431 /* MASK_GPIOX register field definition */
432 #define TPS65224_BIT_GPIOX_FALL_MASK(gpio_inst)         BIT((gpio_inst))
433 #define TPS65224_BIT_GPIOX_RISE_MASK(gpio_inst)         BIT((gpio_inst))
434 
435 /* MASK_STARTUP register field definition */
436 #define TPS6594_BIT_NPWRON_START_MASK                   BIT(0)
437 #define TPS6594_BIT_ENABLE_MASK                         BIT(1)
438 #define TPS6594_BIT_FSD_MASK                            BIT(4)
439 #define TPS6594_BIT_SOFT_REBOOT_MASK                    BIT(5)
440 #define TPS65224_BIT_VSENSE_MASK                        BIT(0)
441 #define TPS65224_BIT_PB_SHORT_MASK                      BIT(2)
442 
443 /* MASK_MISC register field definition */
444 #define TPS6594_BIT_BIST_PASS_MASK                      BIT(0)
445 #define TPS6594_BIT_EXT_CLK_MASK                        BIT(1)
446 #define TPS65224_BIT_REG_UNLOCK_MASK                    BIT(2)
447 #define TPS6594_BIT_TWARN_MASK                          BIT(3)
448 #define TPS65224_BIT_PB_LONG_MASK                       BIT(4)
449 #define TPS65224_BIT_PB_FALL_MASK                       BIT(5)
450 #define TPS65224_BIT_PB_RISE_MASK                       BIT(6)
451 #define TPS65224_BIT_ADC_CONV_READY_MASK                BIT(7)
452 
453 /* MASK_MODERATE_ERR register field definition */
454 #define TPS6594_BIT_BIST_FAIL_MASK                      BIT(1)
455 #define TPS6594_BIT_REG_CRC_ERR_MASK                    BIT(2)
456 #define TPS6594_BIT_SPMI_ERR_MASK                       BIT(4)
457 #define TPS6594_BIT_NPWRON_LONG_MASK                    BIT(5)
458 #define TPS6594_BIT_NINT_READBACK_MASK                  BIT(6)
459 #define TPS6594_BIT_NRSTOUT_READBACK_MASK               BIT(7)
460 
461 /* MASK_FSM_ERR register field definition */
462 #define TPS6594_BIT_IMM_SHUTDOWN_MASK                   BIT(0)
463 #define TPS6594_BIT_ORD_SHUTDOWN_MASK                   BIT(1)
464 #define TPS6594_BIT_MCU_PWR_ERR_MASK                    BIT(2)
465 #define TPS6594_BIT_SOC_PWR_ERR_MASK                    BIT(3)
466 #define TPS65224_BIT_COMM_ERR_MASK                      BIT(4)
467 #define TPS65224_BIT_I2C2_ERR_MASK                      BIT(5)
468 
469 /* MASK_COMM_ERR register field definition */
470 #define TPS6594_BIT_COMM_FRM_ERR_MASK                   BIT(0)
471 #define TPS6594_BIT_COMM_CRC_ERR_MASK                   BIT(1)
472 #define TPS6594_BIT_COMM_ADR_ERR_MASK                   BIT(3)
473 #define TPS6594_BIT_I2C2_CRC_ERR_MASK                   BIT(5)
474 #define TPS6594_BIT_I2C2_ADR_ERR_MASK                   BIT(7)
475 
476 /* MASK_READBACK_ERR register field definition */
477 #define TPS6594_BIT_EN_DRV_READBACK_MASK                BIT(0)
478 #define TPS6594_BIT_NRSTOUT_SOC_READBACK_MASK           BIT(3)
479 
480 /* MASK_ESM register field definition */
481 #define TPS6594_BIT_ESM_SOC_PIN_MASK                    BIT(0)
482 #define TPS6594_BIT_ESM_SOC_FAIL_MASK                   BIT(1)
483 #define TPS6594_BIT_ESM_SOC_RST_MASK                    BIT(2)
484 #define TPS6594_BIT_ESM_MCU_PIN_MASK                    BIT(3)
485 #define TPS6594_BIT_ESM_MCU_FAIL_MASK                   BIT(4)
486 #define TPS6594_BIT_ESM_MCU_RST_MASK                    BIT(5)
487 
488 /* INT_TOP register field definition */
489 #define TPS6594_BIT_BUCK_INT                            BIT(0)
490 #define TPS6594_BIT_LDO_VMON_INT                        BIT(1)
491 #define TPS6594_BIT_GPIO_INT                            BIT(2)
492 #define TPS6594_BIT_STARTUP_INT                         BIT(3)
493 #define TPS6594_BIT_MISC_INT                            BIT(4)
494 #define TPS6594_BIT_MODERATE_ERR_INT                    BIT(5)
495 #define TPS6594_BIT_SEVERE_ERR_INT                      BIT(6)
496 #define TPS6594_BIT_FSM_ERR_INT                         BIT(7)
497 
498 /* INT_BUCK register field definition */
499 #define TPS6594_BIT_BUCK1_2_INT                         BIT(0)
500 #define TPS6594_BIT_BUCK3_4_INT                         BIT(1)
501 #define TPS6594_BIT_BUCK5_INT                           BIT(2)
502 
503 /* INT_BUCK register field definition */
504 #define TPS65224_BIT_BUCK1_UVOV_INT                     BIT(0)
505 #define TPS65224_BIT_BUCK2_UVOV_INT                     BIT(1)
506 #define TPS65224_BIT_BUCK3_UVOV_INT                     BIT(2)
507 #define TPS65224_BIT_BUCK4_UVOV_INT                     BIT(3)
508 
509 /* INT_BUCKX register field definition */
510 #define TPS6594_BIT_BUCKX_OV_INT(buck_inst)             BIT(((buck_inst) << 2) % 8)
511 #define TPS6594_BIT_BUCKX_UV_INT(buck_inst)             BIT(((buck_inst) << 2) % 8 + 1)
512 #define TPS6594_BIT_BUCKX_SC_INT(buck_inst)             BIT(((buck_inst) << 2) % 8 + 2)
513 #define TPS6594_BIT_BUCKX_ILIM_INT(buck_inst)           BIT(((buck_inst) << 2) % 8 + 3)
514 
515 /* INT_LDO_VMON register field definition */
516 #define TPS6594_BIT_LDO1_2_INT                          BIT(0)
517 #define TPS6594_BIT_LDO3_4_INT                          BIT(1)
518 #define TPS6594_BIT_VCCA_INT                            BIT(4)
519 
520 /* INT_LDO_VMON register field definition */
521 #define TPS65224_BIT_LDO1_UVOV_INT                      BIT(0)
522 #define TPS65224_BIT_LDO2_UVOV_INT                      BIT(1)
523 #define TPS65224_BIT_LDO3_UVOV_INT                      BIT(2)
524 #define TPS65224_BIT_VCCA_UVOV_INT                      BIT(4)
525 #define TPS65224_BIT_VMON1_UVOV_INT                     BIT(5)
526 #define TPS65224_BIT_VMON2_UVOV_INT                     BIT(6)
527 
528 /* INT_LDOX register field definition */
529 #define TPS6594_BIT_LDOX_OV_INT(ldo_inst)               BIT(((ldo_inst) << 2) % 8)
530 #define TPS6594_BIT_LDOX_UV_INT(ldo_inst)               BIT(((ldo_inst) << 2) % 8 + 1)
531 #define TPS6594_BIT_LDOX_SC_INT(ldo_inst)               BIT(((ldo_inst) << 2) % 8 + 2)
532 #define TPS6594_BIT_LDOX_ILIM_INT(ldo_inst)             BIT(((ldo_inst) << 2) % 8 + 3)
533 
534 /* INT_VMON register field definition */
535 #define TPS6594_BIT_VCCA_OV_INT                         BIT(0)
536 #define TPS6594_BIT_VCCA_UV_INT                         BIT(1)
537 #define TPS6594_BIT_VMON1_OV_INT                        BIT(2)
538 #define TPS6594_BIT_VMON1_UV_INT                        BIT(3)
539 #define TPS6594_BIT_VMON1_RV_INT                        BIT(4)
540 #define TPS6594_BIT_VMON2_OV_INT                        BIT(5)
541 #define TPS6594_BIT_VMON2_UV_INT                        BIT(6)
542 #define TPS6594_BIT_VMON2_RV_INT                        BIT(7)
543 
544 /* INT_GPIO register field definition */
545 #define TPS6594_BIT_GPIO9_INT                           BIT(0)
546 #define TPS6594_BIT_GPIO10_INT                          BIT(1)
547 #define TPS6594_BIT_GPIO11_INT                          BIT(2)
548 #define TPS6594_BIT_GPIO1_8_INT                         BIT(3)
549 
550 /* INT_GPIOX register field definition */
551 #define TPS6594_BIT_GPIOX_INT(gpio_inst)                BIT(gpio_inst)
552 
553 /* INT_GPIO register field definition */
554 #define TPS65224_BIT_GPIO1_INT                          BIT(0)
555 #define TPS65224_BIT_GPIO2_INT                          BIT(1)
556 #define TPS65224_BIT_GPIO3_INT                          BIT(2)
557 #define TPS65224_BIT_GPIO4_INT                          BIT(3)
558 #define TPS65224_BIT_GPIO5_INT                          BIT(4)
559 #define TPS65224_BIT_GPIO6_INT                          BIT(5)
560 
561 /* INT_STARTUP register field definition */
562 #define TPS6594_BIT_NPWRON_START_INT                    BIT(0)
563 #define TPS65224_BIT_VSENSE_INT                         BIT(0)
564 #define TPS6594_BIT_ENABLE_INT                          BIT(1)
565 #define TPS6594_BIT_RTC_INT                             BIT(2)
566 #define TPS65224_BIT_PB_SHORT_INT                       BIT(2)
567 #define TPS6594_BIT_FSD_INT                             BIT(4)
568 #define TPS6594_BIT_SOFT_REBOOT_INT                     BIT(5)
569 
570 /* INT_MISC register field definition */
571 #define TPS6594_BIT_BIST_PASS_INT                       BIT(0)
572 #define TPS6594_BIT_EXT_CLK_INT                         BIT(1)
573 #define TPS65224_BIT_REG_UNLOCK_INT                     BIT(2)
574 #define TPS6594_BIT_TWARN_INT                           BIT(3)
575 #define TPS65224_BIT_PB_LONG_INT                        BIT(4)
576 #define TPS65224_BIT_PB_FALL_INT                        BIT(5)
577 #define TPS65224_BIT_PB_RISE_INT                        BIT(6)
578 #define TPS65224_BIT_ADC_CONV_READY_INT                 BIT(7)
579 
580 /* INT_MODERATE_ERR register field definition */
581 #define TPS6594_BIT_TSD_ORD_INT                         BIT(0)
582 #define TPS6594_BIT_BIST_FAIL_INT                       BIT(1)
583 #define TPS6594_BIT_REG_CRC_ERR_INT                     BIT(2)
584 #define TPS6594_BIT_RECOV_CNT_INT                       BIT(3)
585 #define TPS6594_BIT_SPMI_ERR_INT                        BIT(4)
586 #define TPS6594_BIT_NPWRON_LONG_INT                     BIT(5)
587 #define TPS6594_BIT_NINT_READBACK_INT                   BIT(6)
588 #define TPS6594_BIT_NRSTOUT_READBACK_INT                BIT(7)
589 
590 /* INT_SEVERE_ERR register field definition */
591 #define TPS6594_BIT_TSD_IMM_INT                         BIT(0)
592 #define TPS6594_BIT_VCCA_OVP_INT                        BIT(1)
593 #define TPS6594_BIT_PFSM_ERR_INT                        BIT(2)
594 #define TPS65224_BIT_BG_XMON_INT                        BIT(3)
595 
596 /* INT_FSM_ERR register field definition */
597 #define TPS6594_BIT_IMM_SHUTDOWN_INT                    BIT(0)
598 #define TPS6594_BIT_ORD_SHUTDOWN_INT                    BIT(1)
599 #define TPS6594_BIT_MCU_PWR_ERR_INT                     BIT(2)
600 #define TPS6594_BIT_SOC_PWR_ERR_INT                     BIT(3)
601 #define TPS6594_BIT_COMM_ERR_INT                        BIT(4)
602 #define TPS6594_BIT_READBACK_ERR_INT                    BIT(5)
603 #define TPS65224_BIT_I2C2_ERR_INT                       BIT(5)
604 #define TPS6594_BIT_ESM_INT                             BIT(6)
605 #define TPS6594_BIT_WD_INT                              BIT(7)
606 
607 /* INT_COMM_ERR register field definition */
608 #define TPS6594_BIT_COMM_FRM_ERR_INT                    BIT(0)
609 #define TPS6594_BIT_COMM_CRC_ERR_INT                    BIT(1)
610 #define TPS6594_BIT_COMM_ADR_ERR_INT                    BIT(3)
611 #define TPS6594_BIT_I2C2_CRC_ERR_INT                    BIT(5)
612 #define TPS6594_BIT_I2C2_ADR_ERR_INT                    BIT(7)
613 
614 /* INT_READBACK_ERR register field definition */
615 #define TPS6594_BIT_EN_DRV_READBACK_INT                 BIT(0)
616 #define TPS6594_BIT_NRSTOUT_SOC_READBACK_INT            BIT(3)
617 
618 /* INT_ESM register field definition */
619 #define TPS6594_BIT_ESM_SOC_PIN_INT                     BIT(0)
620 #define TPS6594_BIT_ESM_SOC_FAIL_INT                    BIT(1)
621 #define TPS6594_BIT_ESM_SOC_RST_INT                     BIT(2)
622 #define TPS6594_BIT_ESM_MCU_PIN_INT                     BIT(3)
623 #define TPS6594_BIT_ESM_MCU_FAIL_INT                    BIT(4)
624 #define TPS6594_BIT_ESM_MCU_RST_INT                     BIT(5)
625 
626 /* STAT_BUCKX register field definition */
627 #define TPS6594_BIT_BUCKX_OV_STAT(buck_inst)            BIT(((buck_inst) << 2) % 8)
628 #define TPS6594_BIT_BUCKX_UV_STAT(buck_inst)            BIT(((buck_inst) << 2) % 8 + 1)
629 #define TPS6594_BIT_BUCKX_ILIM_STAT(buck_inst)          BIT(((buck_inst) << 2) % 8 + 3)
630 
631 /* STAT_LDOX register field definition */
632 #define TPS6594_BIT_LDOX_OV_STAT(ldo_inst)              BIT(((ldo_inst) << 2) % 8)
633 #define TPS6594_BIT_LDOX_UV_STAT(ldo_inst)              BIT(((ldo_inst) << 2) % 8 + 1)
634 #define TPS6594_BIT_LDOX_ILIM_STAT(ldo_inst)            BIT(((ldo_inst) << 2) % 8 + 3)
635 
636 /* STAT_VMON register field definition */
637 #define TPS6594_BIT_VCCA_OV_STAT                        BIT(0)
638 #define TPS6594_BIT_VCCA_UV_STAT                        BIT(1)
639 #define TPS6594_BIT_VMON1_OV_STAT                       BIT(2)
640 #define TPS6594_BIT_VMON1_UV_STAT                       BIT(3)
641 #define TPS6594_BIT_VMON2_OV_STAT                       BIT(5)
642 #define TPS6594_BIT_VMON2_UV_STAT                       BIT(6)
643 
644 /* STAT_LDO_VMON register field definition */
645 #define TPS65224_BIT_LDO1_UVOV_STAT                     BIT(0)
646 #define TPS65224_BIT_LDO2_UVOV_STAT                     BIT(1)
647 #define TPS65224_BIT_LDO3_UVOV_STAT                     BIT(2)
648 #define TPS65224_BIT_VCCA_UVOV_STAT                     BIT(4)
649 #define TPS65224_BIT_VMON1_UVOV_STAT                    BIT(5)
650 #define TPS65224_BIT_VMON2_UVOV_STAT                    BIT(6)
651 
652 /* STAT_STARTUP register field definition */
653 #define TPS65224_BIT_VSENSE_STAT                        BIT(0)
654 #define TPS6594_BIT_ENABLE_STAT                         BIT(1)
655 #define TPS65224_BIT_PB_LEVEL_STAT                      BIT(2)
656 
657 /* STAT_MISC register field definition */
658 #define TPS6594_BIT_EXT_CLK_STAT                        BIT(1)
659 #define TPS6594_BIT_TWARN_STAT                          BIT(3)
660 
661 /* STAT_MODERATE_ERR register field definition */
662 #define TPS6594_BIT_TSD_ORD_STAT                        BIT(0)
663 
664 /* STAT_SEVERE_ERR register field definition */
665 #define TPS6594_BIT_TSD_IMM_STAT                        BIT(0)
666 #define TPS6594_BIT_VCCA_OVP_STAT                       BIT(1)
667 #define TPS65224_BIT_BG_XMON_STAT                       BIT(3)
668 
669 /* STAT_READBACK_ERR register field definition */
670 #define TPS6594_BIT_EN_DRV_READBACK_STAT                BIT(0)
671 #define TPS6594_BIT_NINT_READBACK_STAT                  BIT(1)
672 #define TPS6594_BIT_NRSTOUT_READBACK_STAT               BIT(2)
673 #define TPS6594_BIT_NRSTOUT_SOC_READBACK_STAT           BIT(3)
674 
675 /* PGOOD_SEL_1 register field definition */
676 #define TPS6594_MASK_PGOOD_SEL_BUCK1                    GENMASK(1, 0)
677 #define TPS6594_MASK_PGOOD_SEL_BUCK2                    GENMASK(3, 2)
678 #define TPS6594_MASK_PGOOD_SEL_BUCK3                    GENMASK(5, 4)
679 #define TPS6594_MASK_PGOOD_SEL_BUCK4                    GENMASK(7, 6)
680 
681 /* PGOOD_SEL_2 register field definition */
682 #define TPS6594_MASK_PGOOD_SEL_BUCK5                    GENMASK(1, 0)
683 
684 /* PGOOD_SEL_3 register field definition */
685 #define TPS6594_MASK_PGOOD_SEL_LDO1                     GENMASK(1, 0)
686 #define TPS6594_MASK_PGOOD_SEL_LDO2                     GENMASK(3, 2)
687 #define TPS6594_MASK_PGOOD_SEL_LDO3                     GENMASK(5, 4)
688 #define TPS6594_MASK_PGOOD_SEL_LDO4                     GENMASK(7, 6)
689 
690 /* PGOOD_SEL_4 register field definition */
691 #define TPS6594_BIT_PGOOD_SEL_VCCA                      BIT(0)
692 #define TPS6594_BIT_PGOOD_SEL_VMON1                     BIT(1)
693 #define TPS6594_BIT_PGOOD_SEL_VMON2                     BIT(2)
694 #define TPS6594_BIT_PGOOD_SEL_TDIE_WARN                 BIT(3)
695 #define TPS6594_BIT_PGOOD_SEL_NRSTOUT                   BIT(4)
696 #define TPS6594_BIT_PGOOD_SEL_NRSTOUT_SOC               BIT(5)
697 #define TPS6594_BIT_PGOOD_POL                           BIT(6)
698 #define TPS6594_BIT_PGOOD_WINDOW                        BIT(7)
699 
700 /* PLL_CTRL register field definition */
701 #define TPS6594_MASK_EXT_CLK_FREQ                       GENMASK(1, 0)
702 
703 /* CONFIG_1 register field definition */
704 #define TPS6594_BIT_TWARN_LEVEL                         BIT(0)
705 #define TPS6594_BIT_TSD_ORD_LEVEL                       BIT(1)
706 #define TPS6594_BIT_I2C1_HS                             BIT(3)
707 #define TPS6594_BIT_I2C2_HS                             BIT(4)
708 #define TPS6594_BIT_EN_ILIM_FSM_CTRL                    BIT(5)
709 #define TPS6594_BIT_NSLEEP1_MASK                        BIT(6)
710 #define TPS6594_BIT_NSLEEP2_MASK                        BIT(7)
711 
712 /* CONFIG_2 register field definition */
713 #define TPS6594_BIT_BB_CHARGER_EN                       BIT(0)
714 #define TPS6594_BIT_BB_ICHR                             BIT(1)
715 #define TPS6594_MASK_BB_VEOC                            GENMASK(3, 2)
716 #define TPS65224_BIT_I2C1_SPI_CRC_EN                    BIT(4)
717 #define TPS65224_BIT_I2C2_CRC_EN                        BIT(5)
718 #define TPS6594_BB_EOC_RDY                              BIT(7)
719 
720 /* ENABLE_DRV_REG register field definition */
721 #define TPS6594_BIT_ENABLE_DRV                          BIT(0)
722 
723 /* MISC_CTRL register field definition */
724 #define TPS6594_BIT_NRSTOUT                             BIT(0)
725 #define TPS6594_BIT_NRSTOUT_SOC                         BIT(1)
726 #define TPS6594_BIT_LPM_EN                              BIT(2)
727 #define TPS6594_BIT_CLKMON_EN                           BIT(3)
728 #define TPS6594_BIT_AMUXOUT_EN                          BIT(4)
729 #define TPS6594_BIT_SEL_EXT_CLK                         BIT(5)
730 #define TPS6594_MASK_SYNCCLKOUT_FREQ_SEL                GENMASK(7, 6)
731 
732 /* ENABLE_DRV_STAT register field definition */
733 #define TPS6594_BIT_EN_DRV_IN                           BIT(0)
734 #define TPS6594_BIT_NRSTOUT_IN                          BIT(1)
735 #define TPS6594_BIT_NRSTOUT_SOC_IN                      BIT(2)
736 #define TPS6594_BIT_FORCE_EN_DRV_LOW                    BIT(3)
737 #define TPS6594_BIT_SPMI_LPM_EN                         BIT(4)
738 #define TPS65224_BIT_TSD_DISABLE                        BIT(5)
739 
740 /* RECOV_CNT_REG_1 register field definition */
741 #define TPS6594_MASK_RECOV_CNT                          GENMASK(3, 0)
742 
743 /* RECOV_CNT_REG_2 register field definition */
744 #define TPS6594_MASK_RECOV_CNT_THR                      GENMASK(3, 0)
745 #define TPS6594_BIT_RECOV_CNT_CLR                       BIT(4)
746 
747 /* FSM_I2C_TRIGGERS register field definition */
748 #define TPS6594_BIT_TRIGGER_I2C(bit)                    BIT(bit)
749 
750 /* FSM_NSLEEP_TRIGGERS register field definition */
751 #define TPS6594_BIT_NSLEEP1B                            BIT(0)
752 #define TPS6594_BIT_NSLEEP2B                            BIT(1)
753 
754 /* BUCK_RESET_REG register field definition */
755 #define TPS6594_BIT_BUCKX_RESET(buck_inst)              BIT(buck_inst)
756 
757 /* SPREAD_SPECTRUM_1 register field definition */
758 #define TPS6594_MASK_SS_DEPTH                           GENMASK(1, 0)
759 #define TPS6594_BIT_SS_EN                               BIT(2)
760 
761 /* FREQ_SEL register field definition */
762 #define TPS6594_BIT_BUCKX_FREQ_SEL(buck_inst)           BIT(buck_inst)
763 
764 /* FSM_STEP_SIZE register field definition */
765 #define TPS6594_MASK_PFSM_DELAY_STEP                    GENMASK(4, 0)
766 
767 /* LDO_RV_TIMEOUT_REG_1 register field definition */
768 #define TPS6594_MASK_LDO1_RV_TIMEOUT                    GENMASK(3, 0)
769 #define TPS6594_MASK_LDO2_RV_TIMEOUT                    GENMASK(7, 4)
770 
771 /* LDO_RV_TIMEOUT_REG_2 register field definition */
772 #define TPS6594_MASK_LDO3_RV_TIMEOUT                    GENMASK(3, 0)
773 #define TPS6594_MASK_LDO4_RV_TIMEOUT                    GENMASK(7, 4)
774 
775 /* USER_SPARE_REGS register field definition */
776 #define TPS6594_BIT_USER_SPARE(bit)                     BIT(bit)
777 
778 /* ESM_MCU_START_REG register field definition */
779 #define TPS6594_BIT_ESM_MCU_START                       BIT(0)
780 
781 /* ESM_MCU_MODE_CFG register field definition */
782 #define TPS6594_MASK_ESM_MCU_ERR_CNT_TH                 GENMASK(3, 0)
783 #define TPS6594_BIT_ESM_MCU_ENDRV                       BIT(5)
784 #define TPS6594_BIT_ESM_MCU_EN                          BIT(6)
785 #define TPS6594_BIT_ESM_MCU_MODE                        BIT(7)
786 
787 /* ESM_MCU_ERR_CNT_REG register field definition */
788 #define TPS6594_MASK_ESM_MCU_ERR_CNT                    GENMASK(4, 0)
789 
790 /* ESM_SOC_START_REG register field definition */
791 #define TPS6594_BIT_ESM_SOC_START                       BIT(0)
792 
793 /* ESM_MCU_START_REG register field definition */
794 #define TPS65224_BIT_ESM_MCU_START                      BIT(0)
795 
796 /* ESM_SOC_MODE_CFG register field definition */
797 #define TPS6594_MASK_ESM_SOC_ERR_CNT_TH                 GENMASK(3, 0)
798 #define TPS6594_BIT_ESM_SOC_ENDRV                       BIT(5)
799 #define TPS6594_BIT_ESM_SOC_EN                          BIT(6)
800 #define TPS6594_BIT_ESM_SOC_MODE                        BIT(7)
801 
802 /* ESM_MCU_MODE_CFG register field definition */
803 #define TPS65224_MASK_ESM_MCU_ERR_CNT_TH                GENMASK(3, 0)
804 #define TPS65224_BIT_ESM_MCU_ENDRV                      BIT(5)
805 #define TPS65224_BIT_ESM_MCU_EN                         BIT(6)
806 #define TPS65224_BIT_ESM_MCU_MODE                       BIT(7)
807 
808 /* ESM_SOC_ERR_CNT_REG register field definition */
809 #define TPS6594_MASK_ESM_SOC_ERR_CNT                    GENMASK(4, 0)
810 
811 /* ESM_MCU_ERR_CNT_REG register field definition */
812 #define TPS6594_MASK_ESM_MCU_ERR_CNT                    GENMASK(4, 0)
813 
814 /* REGISTER_LOCK register field definition */
815 #define TPS6594_BIT_REGISTER_LOCK_STATUS                BIT(0)
816 
817 /* VMON_CONF register field definition */
818 #define TPS6594_MASK_VMON1_SLEW_RATE                    GENMASK(2, 0)
819 #define TPS6594_MASK_VMON2_SLEW_RATE                    GENMASK(5, 3)
820 
821 /* SRAM_ACCESS_1 Register field definition */
822 #define TPS65224_MASk_SRAM_UNLOCK_SEQ                   GENMASK(7, 0)
823 
824 /* SRAM_ACCESS_2 Register field definition */
825 #define TPS65224_BIT_SRAM_WRITE_MODE                    BIT(0)
826 #define TPS65224_BIT_OTP_PROG_USER                      BIT(1)
827 #define TPS65224_BIT_OTP_PROG_PFSM                      BIT(2)
828 #define TPS65224_BIT_OTP_PROG_STATUS                    BIT(3)
829 #define TPS65224_BIT_SRAM_UNLOCKED                      BIT(6)
830 #define TPS65224_USER_PROG_ALLOWED                      BIT(7)
831 
832 /* SRAM_ADDR_CTRL Register field definition */
833 #define TPS65224_MASk_SRAM_SEL                          GENMASK(1, 0)
834 
835 /* RECOV_CNT_PFSM_INCR Register field definition */
836 #define TPS65224_BIT_INCREMENT_RECOV_CNT                BIT(0)
837 
838 /* MANUFACTURING_VER Register field definition */
839 #define TPS65224_MASK_SILICON_REV                       GENMASK(7, 0)
840 
841 /* CUSTOMER_NVM_ID_REG Register field definition */
842 #define TPS65224_MASK_CUSTOMER_NVM_ID                   GENMASK(7, 0)
843 
844 /* SOFT_REBOOT_REG register field definition */
845 #define TPS6594_BIT_SOFT_REBOOT                         BIT(0)
846 
847 /* RTC_SECONDS & ALARM_SECONDS register field definition */
848 #define TPS6594_MASK_SECOND_0                           GENMASK(3, 0)
849 #define TPS6594_MASK_SECOND_1                           GENMASK(6, 4)
850 
851 /* RTC_MINUTES & ALARM_MINUTES register field definition */
852 #define TPS6594_MASK_MINUTE_0                           GENMASK(3, 0)
853 #define TPS6594_MASK_MINUTE_1                           GENMASK(6, 4)
854 
855 /* RTC_HOURS & ALARM_HOURS register field definition */
856 #define TPS6594_MASK_HOUR_0                             GENMASK(3, 0)
857 #define TPS6594_MASK_HOUR_1                             GENMASK(5, 4)
858 #define TPS6594_BIT_PM_NAM                              BIT(7)
859 
860 /* RTC_DAYS & ALARM_DAYS register field definition */
861 #define TPS6594_MASK_DAY_0                              GENMASK(3, 0)
862 #define TPS6594_MASK_DAY_1                              GENMASK(5, 4)
863 
864 /* RTC_MONTHS & ALARM_MONTHS register field definition */
865 #define TPS6594_MASK_MONTH_0                            GENMASK(3, 0)
866 #define TPS6594_BIT_MONTH_1                             BIT(4)
867 
868 /* RTC_YEARS & ALARM_YEARS register field definition */
869 #define TPS6594_MASK_YEAR_0                             GENMASK(3, 0)
870 #define TPS6594_MASK_YEAR_1                             GENMASK(7, 4)
871 
872 /* RTC_WEEKS register field definition */
873 #define TPS6594_MASK_WEEK                               GENMASK(2, 0)
874 
875 /* RTC_CTRL_1 register field definition */
876 #define TPS6594_BIT_STOP_RTC                            BIT(0)
877 #define TPS6594_BIT_ROUND_30S                           BIT(1)
878 #define TPS6594_BIT_AUTO_COMP                           BIT(2)
879 #define TPS6594_BIT_MODE_12_24                          BIT(3)
880 #define TPS6594_BIT_SET_32_COUNTER                      BIT(5)
881 #define TPS6594_BIT_GET_TIME                            BIT(6)
882 #define TPS6594_BIT_RTC_V_OPT                           BIT(7)
883 
884 /* RTC_CTRL_2 register field definition */
885 #define TPS6594_BIT_XTAL_EN                             BIT(0)
886 #define TPS6594_MASK_XTAL_SEL                           GENMASK(2, 1)
887 #define TPS6594_BIT_LP_STANDBY_SEL                      BIT(3)
888 #define TPS6594_BIT_FAST_BIST                           BIT(4)
889 #define TPS6594_MASK_STARTUP_DEST                       GENMASK(6, 5)
890 #define TPS6594_BIT_FIRST_STARTUP_DONE                  BIT(7)
891 
892 /* RTC_STATUS register field definition */
893 #define TPS6594_BIT_RUN                                 BIT(1)
894 #define TPS6594_BIT_TIMER                               BIT(5)
895 #define TPS6594_BIT_ALARM                               BIT(6)
896 #define TPS6594_BIT_POWER_UP                            BIT(7)
897 
898 /* RTC_INTERRUPTS register field definition */
899 #define TPS6594_MASK_EVERY                              GENMASK(1, 0)
900 #define TPS6594_BIT_IT_TIMER                            BIT(2)
901 #define TPS6594_BIT_IT_ALARM                            BIT(3)
902 
903 /* RTC_RESET_STATUS register field definition */
904 #define TPS6594_BIT_RESET_STATUS_RTC                    BIT(0)
905 
906 /* SERIAL_IF_CONFIG register field definition */
907 #define TPS6594_BIT_I2C_SPI_SEL                         BIT(0)
908 #define TPS6594_BIT_I2C1_SPI_CRC_EN                     BIT(1)
909 #define TPS6594_BIT_I2C2_CRC_EN                         BIT(2)
910 #define TPS6594_MASK_T_CRC                              GENMASK(7, 3)
911 
912 /* ADC_CTRL Register field definition */
913 #define TPS65224_BIT_ADC_START                          BIT(0)
914 #define TPS65224_BIT_ADC_CONT_CONV                      BIT(1)
915 #define TPS65224_BIT_ADC_THERMAL_SEL                    BIT(2)
916 #define TPS65224_BIT_ADC_RDIV_EN                        BIT(3)
917 #define TPS65224_BIT_ADC_STATUS                         BIT(7)
918 
919 /* ADC_RESULT_REG_1 Register field definition */
920 #define TPS65224_MASK_ADC_RESULT_11_4                   GENMASK(7, 0)
921 
922 /* ADC_RESULT_REG_2 Register field definition */
923 #define TPS65224_MASK_ADC_RESULT_3_0                    GENMASK(7, 4)
924 
925 /* STARTUP_CTRL Register field definition */
926 #define TPS65224_MASK_STARTUP_DEST                      GENMASK(6, 5)
927 #define TPS65224_BIT_FIRST_STARTUP_DONE                 BIT(7)
928 
929 /* SCRATCH_PAD_REG_1 Register field definition */
930 #define TPS6594_MASK_SCRATCH_PAD_1                      GENMASK(7, 0)
931 
932 /* SCRATCH_PAD_REG_2 Register field definition */
933 #define TPS6594_MASK_SCRATCH_PAD_2                      GENMASK(7, 0)
934 
935 /* SCRATCH_PAD_REG_3 Register field definition */
936 #define TPS6594_MASK_SCRATCH_PAD_3                      GENMASK(7, 0)
937 
938 /* SCRATCH_PAD_REG_4 Register field definition */
939 #define TPS6594_MASK_SCRATCH_PAD_4                      GENMASK(7, 0)
940 
941 /* PFSM_DELAY_REG_1 Register field definition */
942 #define TPS6594_MASK_PFSM_DELAY1                        GENMASK(7, 0)
943 
944 /* PFSM_DELAY_REG_2 Register field definition */
945 #define TPS6594_MASK_PFSM_DELAY2                        GENMASK(7, 0)
946 
947 /* PFSM_DELAY_REG_3 Register field definition */
948 #define TPS6594_MASK_PFSM_DELAY3                        GENMASK(7, 0)
949 
950 /* PFSM_DELAY_REG_4 Register field definition */
951 #define TPS6594_MASK_PFSM_DELAY4                        GENMASK(7, 0)
952 
953 /* CRC_CALC_CONTROL Register field definition */
954 #define TPS65224_BIT_RUN_CRC_BIST                       BIT(0)
955 #define TPS65224_BIT_RUN_CRC_UPDATE                     BIT(1)
956 
957 /* ADC_GAIN_COMP_REG Register field definition */
958 #define TPS65224_MASK_ADC_GAIN_COMP                     GENMASK(7, 0)
959 
960 /* REGMAP_USER_CRC_LOW Register field definition */
961 #define TPS65224_MASK_REGMAP_USER_CRC16_LOW             GENMASK(7, 0)
962 
963 /* REGMAP_USER_CRC_HIGH Register field definition */
964 #define TPS65224_MASK_REGMAP_USER_CRC16_HIGH            GENMASK(7, 0)
965 
966 /* WD_ANSWER_REG Register field definition */
967 #define TPS6594_MASK_WD_ANSWER                          GENMASK(7, 0)
968 
969 /* WD_QUESTION_ANSW_CNT register field definition */
970 #define TPS6594_MASK_WD_QUESTION                        GENMASK(3, 0)
971 #define TPS6594_MASK_WD_ANSW_CNT                        GENMASK(5, 4)
972 #define TPS65224_BIT_INT_TOP_STATUS                     BIT(7)
973 
974 /* WD WIN1_CFG register field definition */
975 #define TPS6594_MASK_WD_WIN1_CFG                        GENMASK(6, 0)
976 
977 /* WD WIN2_CFG register field definition */
978 #define TPS6594_MASK_WD_WIN2_CFG                        GENMASK(6, 0)
979 
980 /* WD LongWin register field definition */
981 #define TPS6594_MASK_WD_LONGWIN_CFG                     GENMASK(7, 0)
982 
983 /* WD_MODE_REG register field definition */
984 #define TPS6594_BIT_WD_RETURN_LONGWIN                   BIT(0)
985 #define TPS6594_BIT_WD_MODE_SELECT                      BIT(1)
986 #define TPS6594_BIT_WD_PWRHOLD                          BIT(2)
987 #define TPS65224_BIT_WD_ENDRV_SEL                       BIT(6)
988 #define TPS65224_BIT_WD_CNT_SEL                         BIT(7)
989 
990 /* WD_QA_CFG register field definition */
991 #define TPS6594_MASK_WD_QUESTION_SEED                   GENMASK(3, 0)
992 #define TPS6594_MASK_WD_QA_LFSR                         GENMASK(5, 4)
993 #define TPS6594_MASK_WD_QA_FDBK                         GENMASK(7, 6)
994 
995 /* WD_ERR_STATUS register field definition */
996 #define TPS6594_BIT_WD_LONGWIN_TIMEOUT_INT              BIT(0)
997 #define TPS6594_BIT_WD_TIMEOUT                          BIT(1)
998 #define TPS6594_BIT_WD_TRIG_EARLY                       BIT(2)
999 #define TPS6594_BIT_WD_ANSW_EARLY                       BIT(3)
1000 #define TPS6594_BIT_WD_SEQ_ERR                          BIT(4)
1001 #define TPS6594_BIT_WD_ANSW_ERR                         BIT(5)
1002 #define TPS6594_BIT_WD_FAIL_INT                         BIT(6)
1003 #define TPS6594_BIT_WD_RST_INT                          BIT(7)
1004 
1005 /* WD_THR_CFG register field definition */
1006 #define TPS6594_MASK_WD_RST_TH                          GENMASK(2, 0)
1007 #define TPS6594_MASK_WD_FAIL_TH                         GENMASK(5, 3)
1008 #define TPS6594_BIT_WD_EN                               BIT(6)
1009 #define TPS6594_BIT_WD_RST_EN                           BIT(7)
1010 
1011 /* WD_FAIL_CNT_REG register field definition */
1012 #define TPS6594_MASK_WD_FAIL_CNT                        GENMASK(3, 0)
1013 #define TPS6594_BIT_WD_FIRST_OK                         BIT(5)
1014 #define TPS6594_BIT_WD_BAD_EVENT                        BIT(6)
1015 
1016 /* CRC8 polynomial for I2C & SPI protocols */
1017 #define TPS6594_CRC8_POLYNOMIAL 0x07
1018 
1019 /* IRQs */
1020 enum tps6594_irqs {
1021         /* INT_BUCK1_2 register */
1022         TPS6594_IRQ_BUCK1_OV,
1023         TPS6594_IRQ_BUCK1_UV,
1024         TPS6594_IRQ_BUCK1_SC,
1025         TPS6594_IRQ_BUCK1_ILIM,
1026         TPS6594_IRQ_BUCK2_OV,
1027         TPS6594_IRQ_BUCK2_UV,
1028         TPS6594_IRQ_BUCK2_SC,
1029         TPS6594_IRQ_BUCK2_ILIM,
1030         /* INT_BUCK3_4 register */
1031         TPS6594_IRQ_BUCK3_OV,
1032         TPS6594_IRQ_BUCK3_UV,
1033         TPS6594_IRQ_BUCK3_SC,
1034         TPS6594_IRQ_BUCK3_ILIM,
1035         TPS6594_IRQ_BUCK4_OV,
1036         TPS6594_IRQ_BUCK4_UV,
1037         TPS6594_IRQ_BUCK4_SC,
1038         TPS6594_IRQ_BUCK4_ILIM,
1039         /* INT_BUCK5 register */
1040         TPS6594_IRQ_BUCK5_OV,
1041         TPS6594_IRQ_BUCK5_UV,
1042         TPS6594_IRQ_BUCK5_SC,
1043         TPS6594_IRQ_BUCK5_ILIM,
1044         /* INT_LDO1_2 register */
1045         TPS6594_IRQ_LDO1_OV,
1046         TPS6594_IRQ_LDO1_UV,
1047         TPS6594_IRQ_LDO1_SC,
1048         TPS6594_IRQ_LDO1_ILIM,
1049         TPS6594_IRQ_LDO2_OV,
1050         TPS6594_IRQ_LDO2_UV,
1051         TPS6594_IRQ_LDO2_SC,
1052         TPS6594_IRQ_LDO2_ILIM,
1053         /* INT_LDO3_4 register */
1054         TPS6594_IRQ_LDO3_OV,
1055         TPS6594_IRQ_LDO3_UV,
1056         TPS6594_IRQ_LDO3_SC,
1057         TPS6594_IRQ_LDO3_ILIM,
1058         TPS6594_IRQ_LDO4_OV,
1059         TPS6594_IRQ_LDO4_UV,
1060         TPS6594_IRQ_LDO4_SC,
1061         TPS6594_IRQ_LDO4_ILIM,
1062         /* INT_VMON register */
1063         TPS6594_IRQ_VCCA_OV,
1064         TPS6594_IRQ_VCCA_UV,
1065         TPS6594_IRQ_VMON1_OV,
1066         TPS6594_IRQ_VMON1_UV,
1067         TPS6594_IRQ_VMON1_RV,
1068         TPS6594_IRQ_VMON2_OV,
1069         TPS6594_IRQ_VMON2_UV,
1070         TPS6594_IRQ_VMON2_RV,
1071         /* INT_GPIO register */
1072         TPS6594_IRQ_GPIO9,
1073         TPS6594_IRQ_GPIO10,
1074         TPS6594_IRQ_GPIO11,
1075         /* INT_GPIO1_8 register */
1076         TPS6594_IRQ_GPIO1,
1077         TPS6594_IRQ_GPIO2,
1078         TPS6594_IRQ_GPIO3,
1079         TPS6594_IRQ_GPIO4,
1080         TPS6594_IRQ_GPIO5,
1081         TPS6594_IRQ_GPIO6,
1082         TPS6594_IRQ_GPIO7,
1083         TPS6594_IRQ_GPIO8,
1084         /* INT_STARTUP register */
1085         TPS6594_IRQ_NPWRON_START,
1086         TPS6594_IRQ_ENABLE,
1087         TPS6594_IRQ_FSD,
1088         TPS6594_IRQ_SOFT_REBOOT,
1089         /* INT_MISC register */
1090         TPS6594_IRQ_BIST_PASS,
1091         TPS6594_IRQ_EXT_CLK,
1092         TPS6594_IRQ_TWARN,
1093         /* INT_MODERATE_ERR register */
1094         TPS6594_IRQ_TSD_ORD,
1095         TPS6594_IRQ_BIST_FAIL,
1096         TPS6594_IRQ_REG_CRC_ERR,
1097         TPS6594_IRQ_RECOV_CNT,
1098         TPS6594_IRQ_SPMI_ERR,
1099         TPS6594_IRQ_NPWRON_LONG,
1100         TPS6594_IRQ_NINT_READBACK,
1101         TPS6594_IRQ_NRSTOUT_READBACK,
1102         /* INT_SEVERE_ERR register */
1103         TPS6594_IRQ_TSD_IMM,
1104         TPS6594_IRQ_VCCA_OVP,
1105         TPS6594_IRQ_PFSM_ERR,
1106         /* INT_FSM_ERR register */
1107         TPS6594_IRQ_IMM_SHUTDOWN,
1108         TPS6594_IRQ_ORD_SHUTDOWN,
1109         TPS6594_IRQ_MCU_PWR_ERR,
1110         TPS6594_IRQ_SOC_PWR_ERR,
1111         /* INT_COMM_ERR register */
1112         TPS6594_IRQ_COMM_FRM_ERR,
1113         TPS6594_IRQ_COMM_CRC_ERR,
1114         TPS6594_IRQ_COMM_ADR_ERR,
1115         TPS6594_IRQ_I2C2_CRC_ERR,
1116         TPS6594_IRQ_I2C2_ADR_ERR,
1117         /* INT_READBACK_ERR register */
1118         TPS6594_IRQ_EN_DRV_READBACK,
1119         TPS6594_IRQ_NRSTOUT_SOC_READBACK,
1120         /* INT_ESM register */
1121         TPS6594_IRQ_ESM_SOC_PIN,
1122         TPS6594_IRQ_ESM_SOC_FAIL,
1123         TPS6594_IRQ_ESM_SOC_RST,
1124         /* RTC_STATUS register */
1125         TPS6594_IRQ_TIMER,
1126         TPS6594_IRQ_ALARM,
1127         TPS6594_IRQ_POWER_UP,
1128 };
1129 
1130 #define TPS6594_IRQ_NAME_BUCK1_OV               "buck1_ov"
1131 #define TPS6594_IRQ_NAME_BUCK1_UV               "buck1_uv"
1132 #define TPS6594_IRQ_NAME_BUCK1_SC               "buck1_sc"
1133 #define TPS6594_IRQ_NAME_BUCK1_ILIM             "buck1_ilim"
1134 #define TPS6594_IRQ_NAME_BUCK2_OV               "buck2_ov"
1135 #define TPS6594_IRQ_NAME_BUCK2_UV               "buck2_uv"
1136 #define TPS6594_IRQ_NAME_BUCK2_SC               "buck2_sc"
1137 #define TPS6594_IRQ_NAME_BUCK2_ILIM             "buck2_ilim"
1138 #define TPS6594_IRQ_NAME_BUCK3_OV               "buck3_ov"
1139 #define TPS6594_IRQ_NAME_BUCK3_UV               "buck3_uv"
1140 #define TPS6594_IRQ_NAME_BUCK3_SC               "buck3_sc"
1141 #define TPS6594_IRQ_NAME_BUCK3_ILIM             "buck3_ilim"
1142 #define TPS6594_IRQ_NAME_BUCK4_OV               "buck4_ov"
1143 #define TPS6594_IRQ_NAME_BUCK4_UV               "buck4_uv"
1144 #define TPS6594_IRQ_NAME_BUCK4_SC               "buck4_sc"
1145 #define TPS6594_IRQ_NAME_BUCK4_ILIM             "buck4_ilim"
1146 #define TPS6594_IRQ_NAME_BUCK5_OV               "buck5_ov"
1147 #define TPS6594_IRQ_NAME_BUCK5_UV               "buck5_uv"
1148 #define TPS6594_IRQ_NAME_BUCK5_SC               "buck5_sc"
1149 #define TPS6594_IRQ_NAME_BUCK5_ILIM             "buck5_ilim"
1150 #define TPS6594_IRQ_NAME_LDO1_OV                "ldo1_ov"
1151 #define TPS6594_IRQ_NAME_LDO1_UV                "ldo1_uv"
1152 #define TPS6594_IRQ_NAME_LDO1_SC                "ldo1_sc"
1153 #define TPS6594_IRQ_NAME_LDO1_ILIM              "ldo1_ilim"
1154 #define TPS6594_IRQ_NAME_LDO2_OV                "ldo2_ov"
1155 #define TPS6594_IRQ_NAME_LDO2_UV                "ldo2_uv"
1156 #define TPS6594_IRQ_NAME_LDO2_SC                "ldo2_sc"
1157 #define TPS6594_IRQ_NAME_LDO2_ILIM              "ldo2_ilim"
1158 #define TPS6594_IRQ_NAME_LDO3_OV                "ldo3_ov"
1159 #define TPS6594_IRQ_NAME_LDO3_UV                "ldo3_uv"
1160 #define TPS6594_IRQ_NAME_LDO3_SC                "ldo3_sc"
1161 #define TPS6594_IRQ_NAME_LDO3_ILIM              "ldo3_ilim"
1162 #define TPS6594_IRQ_NAME_LDO4_OV                "ldo4_ov"
1163 #define TPS6594_IRQ_NAME_LDO4_UV                "ldo4_uv"
1164 #define TPS6594_IRQ_NAME_LDO4_SC                "ldo4_sc"
1165 #define TPS6594_IRQ_NAME_LDO4_ILIM              "ldo4_ilim"
1166 #define TPS6594_IRQ_NAME_VCCA_OV                "vcca_ov"
1167 #define TPS6594_IRQ_NAME_VCCA_UV                "vcca_uv"
1168 #define TPS6594_IRQ_NAME_VMON1_OV               "vmon1_ov"
1169 #define TPS6594_IRQ_NAME_VMON1_UV               "vmon1_uv"
1170 #define TPS6594_IRQ_NAME_VMON1_RV               "vmon1_rv"
1171 #define TPS6594_IRQ_NAME_VMON2_OV               "vmon2_ov"
1172 #define TPS6594_IRQ_NAME_VMON2_UV               "vmon2_uv"
1173 #define TPS6594_IRQ_NAME_VMON2_RV               "vmon2_rv"
1174 #define TPS6594_IRQ_NAME_GPIO9                  "gpio9"
1175 #define TPS6594_IRQ_NAME_GPIO10                 "gpio10"
1176 #define TPS6594_IRQ_NAME_GPIO11                 "gpio11"
1177 #define TPS6594_IRQ_NAME_GPIO1                  "gpio1"
1178 #define TPS6594_IRQ_NAME_GPIO2                  "gpio2"
1179 #define TPS6594_IRQ_NAME_GPIO3                  "gpio3"
1180 #define TPS6594_IRQ_NAME_GPIO4                  "gpio4"
1181 #define TPS6594_IRQ_NAME_GPIO5                  "gpio5"
1182 #define TPS6594_IRQ_NAME_GPIO6                  "gpio6"
1183 #define TPS6594_IRQ_NAME_GPIO7                  "gpio7"
1184 #define TPS6594_IRQ_NAME_GPIO8                  "gpio8"
1185 #define TPS6594_IRQ_NAME_NPWRON_START           "npwron_start"
1186 #define TPS6594_IRQ_NAME_ENABLE                 "enable"
1187 #define TPS6594_IRQ_NAME_FSD                    "fsd"
1188 #define TPS6594_IRQ_NAME_SOFT_REBOOT            "soft_reboot"
1189 #define TPS6594_IRQ_NAME_BIST_PASS              "bist_pass"
1190 #define TPS6594_IRQ_NAME_EXT_CLK                "ext_clk"
1191 #define TPS6594_IRQ_NAME_TWARN                  "twarn"
1192 #define TPS6594_IRQ_NAME_TSD_ORD                "tsd_ord"
1193 #define TPS6594_IRQ_NAME_BIST_FAIL              "bist_fail"
1194 #define TPS6594_IRQ_NAME_REG_CRC_ERR            "reg_crc_err"
1195 #define TPS6594_IRQ_NAME_RECOV_CNT              "recov_cnt"
1196 #define TPS6594_IRQ_NAME_SPMI_ERR               "spmi_err"
1197 #define TPS6594_IRQ_NAME_NPWRON_LONG            "npwron_long"
1198 #define TPS6594_IRQ_NAME_NINT_READBACK          "nint_readback"
1199 #define TPS6594_IRQ_NAME_NRSTOUT_READBACK       "nrstout_readback"
1200 #define TPS6594_IRQ_NAME_TSD_IMM                "tsd_imm"
1201 #define TPS6594_IRQ_NAME_VCCA_OVP               "vcca_ovp"
1202 #define TPS6594_IRQ_NAME_PFSM_ERR               "pfsm_err"
1203 #define TPS6594_IRQ_NAME_IMM_SHUTDOWN           "imm_shutdown"
1204 #define TPS6594_IRQ_NAME_ORD_SHUTDOWN           "ord_shutdown"
1205 #define TPS6594_IRQ_NAME_MCU_PWR_ERR            "mcu_pwr_err"
1206 #define TPS6594_IRQ_NAME_SOC_PWR_ERR            "soc_pwr_err"
1207 #define TPS6594_IRQ_NAME_COMM_FRM_ERR           "comm_frm_err"
1208 #define TPS6594_IRQ_NAME_COMM_CRC_ERR           "comm_crc_err"
1209 #define TPS6594_IRQ_NAME_COMM_ADR_ERR           "comm_adr_err"
1210 #define TPS6594_IRQ_NAME_EN_DRV_READBACK        "en_drv_readback"
1211 #define TPS6594_IRQ_NAME_NRSTOUT_SOC_READBACK   "nrstout_soc_readback"
1212 #define TPS6594_IRQ_NAME_ESM_SOC_PIN            "esm_soc_pin"
1213 #define TPS6594_IRQ_NAME_ESM_SOC_FAIL           "esm_soc_fail"
1214 #define TPS6594_IRQ_NAME_ESM_SOC_RST            "esm_soc_rst"
1215 #define TPS6594_IRQ_NAME_TIMER                  "timer"
1216 #define TPS6594_IRQ_NAME_ALARM                  "alarm"
1217 #define TPS6594_IRQ_NAME_POWERUP                "powerup"
1218 
1219 /* IRQs */
1220 enum tps65224_irqs {
1221         /* INT_BUCK register */
1222         TPS65224_IRQ_BUCK1_UVOV,
1223         TPS65224_IRQ_BUCK2_UVOV,
1224         TPS65224_IRQ_BUCK3_UVOV,
1225         TPS65224_IRQ_BUCK4_UVOV,
1226         /* INT_LDO_VMON register */
1227         TPS65224_IRQ_LDO1_UVOV,
1228         TPS65224_IRQ_LDO2_UVOV,
1229         TPS65224_IRQ_LDO3_UVOV,
1230         TPS65224_IRQ_VCCA_UVOV,
1231         TPS65224_IRQ_VMON1_UVOV,
1232         TPS65224_IRQ_VMON2_UVOV,
1233         /* INT_GPIO register */
1234         TPS65224_IRQ_GPIO1,
1235         TPS65224_IRQ_GPIO2,
1236         TPS65224_IRQ_GPIO3,
1237         TPS65224_IRQ_GPIO4,
1238         TPS65224_IRQ_GPIO5,
1239         TPS65224_IRQ_GPIO6,
1240         /* INT_STARTUP register */
1241         TPS65224_IRQ_VSENSE,
1242         TPS65224_IRQ_ENABLE,
1243         TPS65224_IRQ_PB_SHORT,
1244         TPS65224_IRQ_FSD,
1245         TPS65224_IRQ_SOFT_REBOOT,
1246         /* INT_MISC register */
1247         TPS65224_IRQ_BIST_PASS,
1248         TPS65224_IRQ_EXT_CLK,
1249         TPS65224_IRQ_REG_UNLOCK,
1250         TPS65224_IRQ_TWARN,
1251         TPS65224_IRQ_PB_LONG,
1252         TPS65224_IRQ_PB_FALL,
1253         TPS65224_IRQ_PB_RISE,
1254         TPS65224_IRQ_ADC_CONV_READY,
1255         /* INT_MODERATE_ERR register */
1256         TPS65224_IRQ_TSD_ORD,
1257         TPS65224_IRQ_BIST_FAIL,
1258         TPS65224_IRQ_REG_CRC_ERR,
1259         TPS65224_IRQ_RECOV_CNT,
1260         /* INT_SEVERE_ERR register */
1261         TPS65224_IRQ_TSD_IMM,
1262         TPS65224_IRQ_VCCA_OVP,
1263         TPS65224_IRQ_PFSM_ERR,
1264         TPS65224_IRQ_BG_XMON,
1265         /* INT_FSM_ERR register */
1266         TPS65224_IRQ_IMM_SHUTDOWN,
1267         TPS65224_IRQ_ORD_SHUTDOWN,
1268         TPS65224_IRQ_MCU_PWR_ERR,
1269         TPS65224_IRQ_SOC_PWR_ERR,
1270         TPS65224_IRQ_COMM_ERR,
1271         TPS65224_IRQ_I2C2_ERR,
1272 };
1273 
1274 #define TPS65224_IRQ_NAME_BUCK1_UVOV            "buck1_uvov"
1275 #define TPS65224_IRQ_NAME_BUCK2_UVOV            "buck2_uvov"
1276 #define TPS65224_IRQ_NAME_BUCK3_UVOV            "buck3_uvov"
1277 #define TPS65224_IRQ_NAME_BUCK4_UVOV            "buck4_uvov"
1278 #define TPS65224_IRQ_NAME_LDO1_UVOV             "ldo1_uvov"
1279 #define TPS65224_IRQ_NAME_LDO2_UVOV             "ldo2_uvov"
1280 #define TPS65224_IRQ_NAME_LDO3_UVOV             "ldo3_uvov"
1281 #define TPS65224_IRQ_NAME_VCCA_UVOV             "vcca_uvov"
1282 #define TPS65224_IRQ_NAME_VMON1_UVOV            "vmon1_uvov"
1283 #define TPS65224_IRQ_NAME_VMON2_UVOV            "vmon2_uvov"
1284 #define TPS65224_IRQ_NAME_GPIO1                 "gpio1"
1285 #define TPS65224_IRQ_NAME_GPIO2                 "gpio2"
1286 #define TPS65224_IRQ_NAME_GPIO3                 "gpio3"
1287 #define TPS65224_IRQ_NAME_GPIO4                 "gpio4"
1288 #define TPS65224_IRQ_NAME_GPIO5                 "gpio5"
1289 #define TPS65224_IRQ_NAME_GPIO6                 "gpio6"
1290 #define TPS65224_IRQ_NAME_VSENSE                "vsense"
1291 #define TPS65224_IRQ_NAME_ENABLE                "enable"
1292 #define TPS65224_IRQ_NAME_PB_SHORT              "pb_short"
1293 #define TPS65224_IRQ_NAME_FSD                   "fsd"
1294 #define TPS65224_IRQ_NAME_SOFT_REBOOT           "soft_reboot"
1295 #define TPS65224_IRQ_NAME_BIST_PASS             "bist_pass"
1296 #define TPS65224_IRQ_NAME_EXT_CLK               "ext_clk"
1297 #define TPS65224_IRQ_NAME_REG_UNLOCK            "reg_unlock"
1298 #define TPS65224_IRQ_NAME_TWARN                 "twarn"
1299 #define TPS65224_IRQ_NAME_PB_LONG               "pb_long"
1300 #define TPS65224_IRQ_NAME_PB_FALL               "pb_fall"
1301 #define TPS65224_IRQ_NAME_PB_RISE               "pb_rise"
1302 #define TPS65224_IRQ_NAME_ADC_CONV_READY        "adc_conv_ready"
1303 #define TPS65224_IRQ_NAME_TSD_ORD               "tsd_ord"
1304 #define TPS65224_IRQ_NAME_BIST_FAIL             "bist_fail"
1305 #define TPS65224_IRQ_NAME_REG_CRC_ERR           "reg_crc_err"
1306 #define TPS65224_IRQ_NAME_RECOV_CNT             "recov_cnt"
1307 #define TPS65224_IRQ_NAME_TSD_IMM               "tsd_imm"
1308 #define TPS65224_IRQ_NAME_VCCA_OVP              "vcca_ovp"
1309 #define TPS65224_IRQ_NAME_PFSM_ERR              "pfsm_err"
1310 #define TPS65224_IRQ_NAME_BG_XMON               "bg_xmon"
1311 #define TPS65224_IRQ_NAME_IMM_SHUTDOWN          "imm_shutdown"
1312 #define TPS65224_IRQ_NAME_ORD_SHUTDOWN          "ord_shutdown"
1313 #define TPS65224_IRQ_NAME_MCU_PWR_ERR           "mcu_pwr_err"
1314 #define TPS65224_IRQ_NAME_SOC_PWR_ERR           "soc_pwr_err"
1315 #define TPS65224_IRQ_NAME_COMM_ERR              "comm_err"
1316 #define TPS65224_IRQ_NAME_I2C2_ERR              "i2c2_err"
1317 #define TPS65224_IRQ_NAME_POWERUP               "powerup"
1318 
1319 /**
1320  * struct tps6594 - device private data structure
1321  *
1322  * @dev:      MFD parent device
1323  * @chip_id:  chip ID
1324  * @reg:      I2C slave address or SPI chip select number
1325  * @use_crc:  if true, use CRC for I2C and SPI interface protocols
1326  * @regmap:   regmap for accessing the device registers
1327  * @irq:      irq generated by the device
1328  * @irq_data: regmap irq data used for the irq chip
1329  */
1330 struct tps6594 {
1331         struct device *dev;
1332         unsigned long chip_id;
1333         unsigned short reg;
1334         bool use_crc;
1335         struct regmap *regmap;
1336         int irq;
1337         struct regmap_irq_chip_data *irq_data;
1338 };
1339 
1340 extern const struct regmap_access_table tps6594_volatile_table;
1341 extern const struct regmap_access_table tps65224_volatile_table;
1342 
1343 int tps6594_device_init(struct tps6594 *tps, bool enable_crc);
1344 
1345 #endif /*  __LINUX_MFD_TPS6594_H */
1346 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php