0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef __LINUX_MFD_MAX77693_PRIV_H
0012 #define __LINUX_MFD_MAX77693_PRIV_H
0013
0014 #include <linux/i2c.h>
0015
0016 #define MAX77693_REG_INVALID (0xff)
0017
0018
0019 enum max77693_pmic_reg {
0020 MAX77693_LED_REG_IFLASH1 = 0x00,
0021 MAX77693_LED_REG_IFLASH2 = 0x01,
0022 MAX77693_LED_REG_ITORCH = 0x02,
0023 MAX77693_LED_REG_ITORCHTIMER = 0x03,
0024 MAX77693_LED_REG_FLASH_TIMER = 0x04,
0025 MAX77693_LED_REG_FLASH_EN = 0x05,
0026 MAX77693_LED_REG_MAX_FLASH1 = 0x06,
0027 MAX77693_LED_REG_MAX_FLASH2 = 0x07,
0028 MAX77693_LED_REG_MAX_FLASH3 = 0x08,
0029 MAX77693_LED_REG_MAX_FLASH4 = 0x09,
0030 MAX77693_LED_REG_VOUT_CNTL = 0x0A,
0031 MAX77693_LED_REG_VOUT_FLASH1 = 0x0B,
0032 MAX77693_LED_REG_VOUT_FLASH2 = 0x0C,
0033 MAX77693_LED_REG_FLASH_INT = 0x0E,
0034 MAX77693_LED_REG_FLASH_INT_MASK = 0x0F,
0035 MAX77693_LED_REG_FLASH_STATUS = 0x10,
0036
0037 MAX77693_PMIC_REG_PMIC_ID1 = 0x20,
0038 MAX77693_PMIC_REG_PMIC_ID2 = 0x21,
0039 MAX77693_PMIC_REG_INTSRC = 0x22,
0040 MAX77693_PMIC_REG_INTSRC_MASK = 0x23,
0041 MAX77693_PMIC_REG_TOPSYS_INT = 0x24,
0042 MAX77693_PMIC_REG_TOPSYS_INT_MASK = 0x26,
0043 MAX77693_PMIC_REG_TOPSYS_STAT = 0x28,
0044 MAX77693_PMIC_REG_MAINCTRL1 = 0x2A,
0045 MAX77693_PMIC_REG_LSCNFG = 0x2B,
0046
0047 MAX77693_CHG_REG_CHG_INT = 0xB0,
0048 MAX77693_CHG_REG_CHG_INT_MASK = 0xB1,
0049 MAX77693_CHG_REG_CHG_INT_OK = 0xB2,
0050 MAX77693_CHG_REG_CHG_DETAILS_00 = 0xB3,
0051 MAX77693_CHG_REG_CHG_DETAILS_01 = 0xB4,
0052 MAX77693_CHG_REG_CHG_DETAILS_02 = 0xB5,
0053 MAX77693_CHG_REG_CHG_DETAILS_03 = 0xB6,
0054 MAX77693_CHG_REG_CHG_CNFG_00 = 0xB7,
0055 MAX77693_CHG_REG_CHG_CNFG_01 = 0xB8,
0056 MAX77693_CHG_REG_CHG_CNFG_02 = 0xB9,
0057 MAX77693_CHG_REG_CHG_CNFG_03 = 0xBA,
0058 MAX77693_CHG_REG_CHG_CNFG_04 = 0xBB,
0059 MAX77693_CHG_REG_CHG_CNFG_05 = 0xBC,
0060 MAX77693_CHG_REG_CHG_CNFG_06 = 0xBD,
0061 MAX77693_CHG_REG_CHG_CNFG_07 = 0xBE,
0062 MAX77693_CHG_REG_CHG_CNFG_08 = 0xBF,
0063 MAX77693_CHG_REG_CHG_CNFG_09 = 0xC0,
0064 MAX77693_CHG_REG_CHG_CNFG_10 = 0xC1,
0065 MAX77693_CHG_REG_CHG_CNFG_11 = 0xC2,
0066 MAX77693_CHG_REG_CHG_CNFG_12 = 0xC3,
0067 MAX77693_CHG_REG_CHG_CNFG_13 = 0xC4,
0068 MAX77693_CHG_REG_CHG_CNFG_14 = 0xC5,
0069 MAX77693_CHG_REG_SAFEOUT_CTRL = 0xC6,
0070
0071 MAX77693_PMIC_REG_END,
0072 };
0073
0074
0075 #define TORCH_IOUT1_SHIFT 0
0076 #define TORCH_IOUT2_SHIFT 4
0077 #define TORCH_IOUT_MASK(x) (0xf << (x))
0078 #define TORCH_IOUT_MIN 15625
0079 #define TORCH_IOUT_MAX 250000
0080 #define TORCH_IOUT_STEP 15625
0081
0082
0083 #define FLASH_IOUT_MIN 15625
0084 #define FLASH_IOUT_MAX_1LED 1000000
0085 #define FLASH_IOUT_MAX_2LEDS 625000
0086 #define FLASH_IOUT_STEP 15625
0087
0088
0089 #define TORCH_TMR_NO_TIMER 0x40
0090 #define TORCH_TIMEOUT_MIN 262000
0091 #define TORCH_TIMEOUT_MAX 15728000
0092
0093
0094 #define FLASH_TMR_LEVEL 0x80
0095 #define FLASH_TIMEOUT_MIN 62500
0096 #define FLASH_TIMEOUT_MAX 1000000
0097 #define FLASH_TIMEOUT_STEP 62500
0098
0099
0100 #define FLASH_EN_OFF 0x0
0101 #define FLASH_EN_FLASH 0x1
0102 #define FLASH_EN_TORCH 0x2
0103 #define FLASH_EN_ON 0x3
0104 #define FLASH_EN_SHIFT(x) (6 - (x) * 2)
0105 #define TORCH_EN_SHIFT(x) (2 - (x) * 2)
0106
0107
0108 #define MAX_FLASH1_MAX_FL_EN 0x80
0109 #define MAX_FLASH1_VSYS_MIN 2400
0110 #define MAX_FLASH1_VSYS_MAX 3400
0111 #define MAX_FLASH1_VSYS_STEP 33
0112
0113
0114 #define FLASH_BOOST_FIXED 0x04
0115 #define FLASH_BOOST_LEDNUM_2 0x80
0116
0117
0118 #define FLASH_VOUT_MIN 3300
0119 #define FLASH_VOUT_MAX 5500
0120 #define FLASH_VOUT_STEP 25
0121 #define FLASH_VOUT_RMIN 0x0c
0122
0123
0124 #define FLASH_STATUS_FLASH_ON BIT(3)
0125 #define FLASH_STATUS_TORCH_ON BIT(2)
0126
0127
0128 #define FLASH_INT_FLED2_OPEN BIT(0)
0129 #define FLASH_INT_FLED2_SHORT BIT(1)
0130 #define FLASH_INT_FLED1_OPEN BIT(2)
0131 #define FLASH_INT_FLED1_SHORT BIT(3)
0132 #define FLASH_INT_OVER_CURRENT BIT(4)
0133
0134
0135 #define DEFAULT_FAST_CHARGE_TIMER 4
0136
0137 #define DEFAULT_TOP_OFF_THRESHOLD_CURRENT 150000
0138
0139 #define DEFAULT_TOP_OFF_TIMER 30
0140
0141 #define DEFAULT_CONSTANT_VOLT 4200000
0142
0143 #define DEFAULT_MIN_SYSTEM_VOLT 3600000
0144
0145 #define DEFAULT_THERMAL_REGULATION_TEMP 100
0146
0147 #define DEFAULT_BATTERY_OVERCURRENT 3500000
0148
0149 #define DEFAULT_CHARGER_INPUT_THRESHOLD_VOLT 4300000
0150
0151
0152 #define CHG_INT_OK_BYP_SHIFT 0
0153 #define CHG_INT_OK_BAT_SHIFT 3
0154 #define CHG_INT_OK_CHG_SHIFT 4
0155 #define CHG_INT_OK_CHGIN_SHIFT 6
0156 #define CHG_INT_OK_DETBAT_SHIFT 7
0157 #define CHG_INT_OK_BYP_MASK BIT(CHG_INT_OK_BYP_SHIFT)
0158 #define CHG_INT_OK_BAT_MASK BIT(CHG_INT_OK_BAT_SHIFT)
0159 #define CHG_INT_OK_CHG_MASK BIT(CHG_INT_OK_CHG_SHIFT)
0160 #define CHG_INT_OK_CHGIN_MASK BIT(CHG_INT_OK_CHGIN_SHIFT)
0161 #define CHG_INT_OK_DETBAT_MASK BIT(CHG_INT_OK_DETBAT_SHIFT)
0162
0163
0164 #define CHG_DETAILS_00_CHGIN_SHIFT 5
0165 #define CHG_DETAILS_00_CHGIN_MASK (0x3 << CHG_DETAILS_00_CHGIN_SHIFT)
0166
0167
0168 #define CHG_DETAILS_01_CHG_SHIFT 0
0169 #define CHG_DETAILS_01_BAT_SHIFT 4
0170 #define CHG_DETAILS_01_TREG_SHIFT 7
0171 #define CHG_DETAILS_01_CHG_MASK (0xf << CHG_DETAILS_01_CHG_SHIFT)
0172 #define CHG_DETAILS_01_BAT_MASK (0x7 << CHG_DETAILS_01_BAT_SHIFT)
0173 #define CHG_DETAILS_01_TREG_MASK BIT(7)
0174
0175
0176 enum max77693_charger_charging_state {
0177 MAX77693_CHARGING_PREQUALIFICATION = 0x0,
0178 MAX77693_CHARGING_FAST_CONST_CURRENT,
0179 MAX77693_CHARGING_FAST_CONST_VOLTAGE,
0180 MAX77693_CHARGING_TOP_OFF,
0181 MAX77693_CHARGING_DONE,
0182 MAX77693_CHARGING_HIGH_TEMP,
0183 MAX77693_CHARGING_TIMER_EXPIRED,
0184 MAX77693_CHARGING_THERMISTOR_SUSPEND,
0185 MAX77693_CHARGING_OFF,
0186 MAX77693_CHARGING_RESERVED,
0187 MAX77693_CHARGING_OVER_TEMP,
0188 MAX77693_CHARGING_WATCHDOG_EXPIRED,
0189 };
0190
0191
0192 enum max77693_charger_battery_state {
0193 MAX77693_BATTERY_NOBAT = 0x0,
0194
0195 MAX77693_BATTERY_PREQUALIFICATION,
0196 MAX77693_BATTERY_TIMER_EXPIRED,
0197 MAX77693_BATTERY_GOOD,
0198 MAX77693_BATTERY_LOWVOLTAGE,
0199 MAX77693_BATTERY_OVERVOLTAGE,
0200 MAX77693_BATTERY_OVERCURRENT,
0201 MAX77693_BATTERY_RESERVED,
0202 };
0203
0204
0205 #define CHG_DETAILS_02_BYP_SHIFT 0
0206 #define CHG_DETAILS_02_BYP_MASK (0xf << CHG_DETAILS_02_BYP_SHIFT)
0207
0208
0209 #define CHG_CNFG_00_CHG_MASK 0x1
0210 #define CHG_CNFG_00_BUCK_MASK 0x4
0211
0212
0213 #define CHG_CNFG_01_FCHGTIME_SHIFT 0
0214 #define CHG_CNFG_01_CHGRSTRT_SHIFT 4
0215 #define CHG_CNFG_01_PQEN_SHIFT 7
0216 #define CHG_CNFG_01_FCHGTIME_MASK (0x7 << CHG_CNFG_01_FCHGTIME_SHIFT)
0217 #define CHG_CNFG_01_CHGRSTRT_MASK (0x3 << CHG_CNFG_01_CHGRSTRT_SHIFT)
0218 #define CHG_CNFG_01_PQEN_MAKS BIT(CHG_CNFG_01_PQEN_SHIFT)
0219
0220
0221 #define CHG_CNFG_03_TOITH_SHIFT 0
0222 #define CHG_CNFG_03_TOTIME_SHIFT 3
0223 #define CHG_CNFG_03_TOITH_MASK (0x7 << CHG_CNFG_03_TOITH_SHIFT)
0224 #define CHG_CNFG_03_TOTIME_MASK (0x7 << CHG_CNFG_03_TOTIME_SHIFT)
0225
0226
0227 #define CHG_CNFG_04_CHGCVPRM_SHIFT 0
0228 #define CHG_CNFG_04_MINVSYS_SHIFT 5
0229 #define CHG_CNFG_04_CHGCVPRM_MASK (0x1f << CHG_CNFG_04_CHGCVPRM_SHIFT)
0230 #define CHG_CNFG_04_MINVSYS_MASK (0x7 << CHG_CNFG_04_MINVSYS_SHIFT)
0231
0232
0233 #define CHG_CNFG_06_CHGPROT_SHIFT 2
0234 #define CHG_CNFG_06_CHGPROT_MASK (0x3 << CHG_CNFG_06_CHGPROT_SHIFT)
0235
0236
0237 #define CHG_CNFG_07_REGTEMP_SHIFT 5
0238 #define CHG_CNFG_07_REGTEMP_MASK (0x3 << CHG_CNFG_07_REGTEMP_SHIFT)
0239
0240
0241 #define CHG_CNFG_12_B2SOVRC_SHIFT 0
0242 #define CHG_CNFG_12_VCHGINREG_SHIFT 3
0243 #define CHG_CNFG_12_B2SOVRC_MASK (0x7 << CHG_CNFG_12_B2SOVRC_SHIFT)
0244 #define CHG_CNFG_12_VCHGINREG_MASK (0x3 << CHG_CNFG_12_VCHGINREG_SHIFT)
0245
0246
0247 #define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F
0248
0249
0250 #define SAFEOUT_CTRL_SAFEOUT1_MASK 0x3
0251 #define SAFEOUT_CTRL_SAFEOUT2_MASK 0xC
0252 #define SAFEOUT_CTRL_ENSAFEOUT1_MASK 0x40
0253 #define SAFEOUT_CTRL_ENSAFEOUT2_MASK 0x80
0254
0255
0256 enum max77693_muic_reg {
0257 MAX77693_MUIC_REG_ID = 0x00,
0258 MAX77693_MUIC_REG_INT1 = 0x01,
0259 MAX77693_MUIC_REG_INT2 = 0x02,
0260 MAX77693_MUIC_REG_INT3 = 0x03,
0261 MAX77693_MUIC_REG_STATUS1 = 0x04,
0262 MAX77693_MUIC_REG_STATUS2 = 0x05,
0263 MAX77693_MUIC_REG_STATUS3 = 0x06,
0264 MAX77693_MUIC_REG_INTMASK1 = 0x07,
0265 MAX77693_MUIC_REG_INTMASK2 = 0x08,
0266 MAX77693_MUIC_REG_INTMASK3 = 0x09,
0267 MAX77693_MUIC_REG_CDETCTRL1 = 0x0A,
0268 MAX77693_MUIC_REG_CDETCTRL2 = 0x0B,
0269 MAX77693_MUIC_REG_CTRL1 = 0x0C,
0270 MAX77693_MUIC_REG_CTRL2 = 0x0D,
0271 MAX77693_MUIC_REG_CTRL3 = 0x0E,
0272
0273 MAX77693_MUIC_REG_END,
0274 };
0275
0276
0277 #define INTMASK1_ADC1K_SHIFT 3
0278 #define INTMASK1_ADCERR_SHIFT 2
0279 #define INTMASK1_ADCLOW_SHIFT 1
0280 #define INTMASK1_ADC_SHIFT 0
0281 #define INTMASK1_ADC1K_MASK (1 << INTMASK1_ADC1K_SHIFT)
0282 #define INTMASK1_ADCERR_MASK (1 << INTMASK1_ADCERR_SHIFT)
0283 #define INTMASK1_ADCLOW_MASK (1 << INTMASK1_ADCLOW_SHIFT)
0284 #define INTMASK1_ADC_MASK (1 << INTMASK1_ADC_SHIFT)
0285
0286 #define INTMASK2_VIDRM_SHIFT 5
0287 #define INTMASK2_VBVOLT_SHIFT 4
0288 #define INTMASK2_DXOVP_SHIFT 3
0289 #define INTMASK2_DCDTMR_SHIFT 2
0290 #define INTMASK2_CHGDETRUN_SHIFT 1
0291 #define INTMASK2_CHGTYP_SHIFT 0
0292 #define INTMASK2_VIDRM_MASK (1 << INTMASK2_VIDRM_SHIFT)
0293 #define INTMASK2_VBVOLT_MASK (1 << INTMASK2_VBVOLT_SHIFT)
0294 #define INTMASK2_DXOVP_MASK (1 << INTMASK2_DXOVP_SHIFT)
0295 #define INTMASK2_DCDTMR_MASK (1 << INTMASK2_DCDTMR_SHIFT)
0296 #define INTMASK2_CHGDETRUN_MASK (1 << INTMASK2_CHGDETRUN_SHIFT)
0297 #define INTMASK2_CHGTYP_MASK (1 << INTMASK2_CHGTYP_SHIFT)
0298
0299
0300 #define MAX77693_STATUS1_ADC_SHIFT 0
0301 #define MAX77693_STATUS1_ADCLOW_SHIFT 5
0302 #define MAX77693_STATUS1_ADCERR_SHIFT 6
0303 #define MAX77693_STATUS1_ADC1K_SHIFT 7
0304 #define MAX77693_STATUS1_ADC_MASK (0x1f << MAX77693_STATUS1_ADC_SHIFT)
0305 #define MAX77693_STATUS1_ADCLOW_MASK BIT(MAX77693_STATUS1_ADCLOW_SHIFT)
0306 #define MAX77693_STATUS1_ADCERR_MASK BIT(MAX77693_STATUS1_ADCERR_SHIFT)
0307 #define MAX77693_STATUS1_ADC1K_MASK BIT(MAX77693_STATUS1_ADC1K_SHIFT)
0308
0309 #define MAX77693_STATUS2_CHGTYP_SHIFT 0
0310 #define MAX77693_STATUS2_CHGDETRUN_SHIFT 3
0311 #define MAX77693_STATUS2_DCDTMR_SHIFT 4
0312 #define MAX77693_STATUS2_DXOVP_SHIFT 5
0313 #define MAX77693_STATUS2_VBVOLT_SHIFT 6
0314 #define MAX77693_STATUS2_VIDRM_SHIFT 7
0315 #define MAX77693_STATUS2_CHGTYP_MASK (0x7 << MAX77693_STATUS2_CHGTYP_SHIFT)
0316 #define MAX77693_STATUS2_CHGDETRUN_MASK BIT(MAX77693_STATUS2_CHGDETRUN_SHIFT)
0317 #define MAX77693_STATUS2_DCDTMR_MASK BIT(MAX77693_STATUS2_DCDTMR_SHIFT)
0318 #define MAX77693_STATUS2_DXOVP_MASK BIT(MAX77693_STATUS2_DXOVP_SHIFT)
0319 #define MAX77693_STATUS2_VBVOLT_MASK BIT(MAX77693_STATUS2_VBVOLT_SHIFT)
0320 #define MAX77693_STATUS2_VIDRM_MASK BIT(MAX77693_STATUS2_VIDRM_SHIFT)
0321
0322 #define MAX77693_STATUS3_OVP_SHIFT 2
0323 #define MAX77693_STATUS3_OVP_MASK BIT(MAX77693_STATUS3_OVP_SHIFT)
0324
0325
0326 #define CDETCTRL1_CHGDETEN_SHIFT (0)
0327 #define CDETCTRL1_CHGTYPMAN_SHIFT (1)
0328 #define CDETCTRL1_DCDEN_SHIFT (2)
0329 #define CDETCTRL1_DCD2SCT_SHIFT (3)
0330 #define CDETCTRL1_CDDELAY_SHIFT (4)
0331 #define CDETCTRL1_DCDCPL_SHIFT (5)
0332 #define CDETCTRL1_CDPDET_SHIFT (7)
0333 #define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT)
0334 #define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT)
0335 #define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT)
0336 #define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT)
0337 #define CDETCTRL1_CDDELAY_MASK (0x1 << CDETCTRL1_CDDELAY_SHIFT)
0338 #define CDETCTRL1_DCDCPL_MASK (0x1 << CDETCTRL1_DCDCPL_SHIFT)
0339 #define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT)
0340
0341 #define CDETCTRL2_VIDRMEN_SHIFT (1)
0342 #define CDETCTRL2_DXOVPEN_SHIFT (3)
0343 #define CDETCTRL2_VIDRMEN_MASK (0x1 << CDETCTRL2_VIDRMEN_SHIFT)
0344 #define CDETCTRL2_DXOVPEN_MASK (0x1 << CDETCTRL2_DXOVPEN_SHIFT)
0345
0346
0347 #define COMN1SW_SHIFT (0)
0348 #define COMP2SW_SHIFT (3)
0349 #define COMN1SW_MASK (0x7 << COMN1SW_SHIFT)
0350 #define COMP2SW_MASK (0x7 << COMP2SW_SHIFT)
0351 #define COMP_SW_MASK (COMP2SW_MASK | COMN1SW_MASK)
0352 #define MAX77693_CONTROL1_SW_USB ((1 << COMP2SW_SHIFT) \
0353 | (1 << COMN1SW_SHIFT))
0354 #define MAX77693_CONTROL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \
0355 | (2 << COMN1SW_SHIFT))
0356 #define MAX77693_CONTROL1_SW_UART ((3 << COMP2SW_SHIFT) \
0357 | (3 << COMN1SW_SHIFT))
0358 #define MAX77693_CONTROL1_SW_OPEN ((0 << COMP2SW_SHIFT) \
0359 | (0 << COMN1SW_SHIFT))
0360
0361 #define MAX77693_CONTROL2_LOWPWR_SHIFT 0
0362 #define MAX77693_CONTROL2_ADCEN_SHIFT 1
0363 #define MAX77693_CONTROL2_CPEN_SHIFT 2
0364 #define MAX77693_CONTROL2_SFOUTASRT_SHIFT 3
0365 #define MAX77693_CONTROL2_SFOUTORD_SHIFT 4
0366 #define MAX77693_CONTROL2_ACCDET_SHIFT 5
0367 #define MAX77693_CONTROL2_USBCPINT_SHIFT 6
0368 #define MAX77693_CONTROL2_RCPS_SHIFT 7
0369 #define MAX77693_CONTROL2_LOWPWR_MASK BIT(MAX77693_CONTROL2_LOWPWR_SHIFT)
0370 #define MAX77693_CONTROL2_ADCEN_MASK BIT(MAX77693_CONTROL2_ADCEN_SHIFT)
0371 #define MAX77693_CONTROL2_CPEN_MASK BIT(MAX77693_CONTROL2_CPEN_SHIFT)
0372 #define MAX77693_CONTROL2_SFOUTASRT_MASK BIT(MAX77693_CONTROL2_SFOUTASRT_SHIFT)
0373 #define MAX77693_CONTROL2_SFOUTORD_MASK BIT(MAX77693_CONTROL2_SFOUTORD_SHIFT)
0374 #define MAX77693_CONTROL2_ACCDET_MASK BIT(MAX77693_CONTROL2_ACCDET_SHIFT)
0375 #define MAX77693_CONTROL2_USBCPINT_MASK BIT(MAX77693_CONTROL2_USBCPINT_SHIFT)
0376 #define MAX77693_CONTROL2_RCPS_MASK BIT(MAX77693_CONTROL2_RCPS_SHIFT)
0377
0378 #define MAX77693_CONTROL3_JIGSET_SHIFT 0
0379 #define MAX77693_CONTROL3_BTLDSET_SHIFT 2
0380 #define MAX77693_CONTROL3_ADCDBSET_SHIFT 4
0381 #define MAX77693_CONTROL3_JIGSET_MASK (0x3 << MAX77693_CONTROL3_JIGSET_SHIFT)
0382 #define MAX77693_CONTROL3_BTLDSET_MASK (0x3 << MAX77693_CONTROL3_BTLDSET_SHIFT)
0383 #define MAX77693_CONTROL3_ADCDBSET_MASK (0x3 << MAX77693_CONTROL3_ADCDBSET_SHIFT)
0384
0385
0386 enum max77693_haptic_reg {
0387 MAX77693_HAPTIC_REG_STATUS = 0x00,
0388 MAX77693_HAPTIC_REG_CONFIG1 = 0x01,
0389 MAX77693_HAPTIC_REG_CONFIG2 = 0x02,
0390 MAX77693_HAPTIC_REG_CONFIG_CHNL = 0x03,
0391 MAX77693_HAPTIC_REG_CONFG_CYC1 = 0x04,
0392 MAX77693_HAPTIC_REG_CONFG_CYC2 = 0x05,
0393 MAX77693_HAPTIC_REG_CONFIG_PER1 = 0x06,
0394 MAX77693_HAPTIC_REG_CONFIG_PER2 = 0x07,
0395 MAX77693_HAPTIC_REG_CONFIG_PER3 = 0x08,
0396 MAX77693_HAPTIC_REG_CONFIG_PER4 = 0x09,
0397 MAX77693_HAPTIC_REG_CONFIG_DUTY1 = 0x0A,
0398 MAX77693_HAPTIC_REG_CONFIG_DUTY2 = 0x0B,
0399 MAX77693_HAPTIC_REG_CONFIG_PWM1 = 0x0C,
0400 MAX77693_HAPTIC_REG_CONFIG_PWM2 = 0x0D,
0401 MAX77693_HAPTIC_REG_CONFIG_PWM3 = 0x0E,
0402 MAX77693_HAPTIC_REG_CONFIG_PWM4 = 0x0F,
0403 MAX77693_HAPTIC_REG_REV = 0x10,
0404
0405 MAX77693_HAPTIC_REG_END,
0406 };
0407
0408
0409 #define MAX77693_PMIC_LOW_SYS_MASK 0x80
0410 #define MAX77693_PMIC_LOW_SYS_SHIFT 7
0411
0412
0413 #define MAX77693_CONFIG2_MODE 7
0414 #define MAX77693_CONFIG2_MEN 6
0415 #define MAX77693_CONFIG2_HTYP 5
0416
0417 enum max77693_irq_source {
0418 LED_INT = 0,
0419 TOPSYS_INT,
0420 CHG_INT,
0421 MUIC_INT1,
0422 MUIC_INT2,
0423 MUIC_INT3,
0424
0425 MAX77693_IRQ_GROUP_NR,
0426 };
0427
0428 #define SRC_IRQ_CHARGER BIT(0)
0429 #define SRC_IRQ_TOP BIT(1)
0430 #define SRC_IRQ_FLASH BIT(2)
0431 #define SRC_IRQ_MUIC BIT(3)
0432 #define SRC_IRQ_ALL (SRC_IRQ_CHARGER | SRC_IRQ_TOP \
0433 | SRC_IRQ_FLASH | SRC_IRQ_MUIC)
0434
0435 #define LED_IRQ_FLED2_OPEN BIT(0)
0436 #define LED_IRQ_FLED2_SHORT BIT(1)
0437 #define LED_IRQ_FLED1_OPEN BIT(2)
0438 #define LED_IRQ_FLED1_SHORT BIT(3)
0439 #define LED_IRQ_MAX_FLASH BIT(4)
0440
0441 #define TOPSYS_IRQ_T120C_INT BIT(0)
0442 #define TOPSYS_IRQ_T140C_INT BIT(1)
0443 #define TOPSYS_IRQ_LOWSYS_INT BIT(3)
0444
0445 #define CHG_IRQ_BYP_I BIT(0)
0446 #define CHG_IRQ_THM_I BIT(2)
0447 #define CHG_IRQ_BAT_I BIT(3)
0448 #define CHG_IRQ_CHG_I BIT(4)
0449 #define CHG_IRQ_CHGIN_I BIT(6)
0450
0451 #define MUIC_IRQ_INT1_ADC BIT(0)
0452 #define MUIC_IRQ_INT1_ADC_LOW BIT(1)
0453 #define MUIC_IRQ_INT1_ADC_ERR BIT(2)
0454 #define MUIC_IRQ_INT1_ADC1K BIT(3)
0455
0456 #define MUIC_IRQ_INT2_CHGTYP BIT(0)
0457 #define MUIC_IRQ_INT2_CHGDETREUN BIT(1)
0458 #define MUIC_IRQ_INT2_DCDTMR BIT(2)
0459 #define MUIC_IRQ_INT2_DXOVP BIT(3)
0460 #define MUIC_IRQ_INT2_VBVOLT BIT(4)
0461 #define MUIC_IRQ_INT2_VIDRM BIT(5)
0462
0463 #define MUIC_IRQ_INT3_EOC BIT(0)
0464 #define MUIC_IRQ_INT3_CGMBC BIT(1)
0465 #define MUIC_IRQ_INT3_OVP BIT(2)
0466 #define MUIC_IRQ_INT3_MBCCHG_ERR BIT(3)
0467 #define MUIC_IRQ_INT3_CHG_ENABLED BIT(4)
0468 #define MUIC_IRQ_INT3_BAT_DET BIT(5)
0469
0470 enum max77693_irq {
0471
0472 MAX77693_LED_IRQ_FLED2_OPEN,
0473 MAX77693_LED_IRQ_FLED2_SHORT,
0474 MAX77693_LED_IRQ_FLED1_OPEN,
0475 MAX77693_LED_IRQ_FLED1_SHORT,
0476 MAX77693_LED_IRQ_MAX_FLASH,
0477
0478
0479 MAX77693_TOPSYS_IRQ_T120C_INT,
0480 MAX77693_TOPSYS_IRQ_T140C_INT,
0481 MAX77693_TOPSYS_IRQ_LOWSYS_INT,
0482
0483
0484 MAX77693_CHG_IRQ_BYP_I,
0485 MAX77693_CHG_IRQ_THM_I,
0486 MAX77693_CHG_IRQ_BAT_I,
0487 MAX77693_CHG_IRQ_CHG_I,
0488 MAX77693_CHG_IRQ_CHGIN_I,
0489
0490 MAX77693_IRQ_NR,
0491 };
0492
0493 enum max77693_irq_muic {
0494
0495 MAX77693_MUIC_IRQ_INT1_ADC,
0496 MAX77693_MUIC_IRQ_INT1_ADC_LOW,
0497 MAX77693_MUIC_IRQ_INT1_ADC_ERR,
0498 MAX77693_MUIC_IRQ_INT1_ADC1K,
0499
0500
0501 MAX77693_MUIC_IRQ_INT2_CHGTYP,
0502 MAX77693_MUIC_IRQ_INT2_CHGDETREUN,
0503 MAX77693_MUIC_IRQ_INT2_DCDTMR,
0504 MAX77693_MUIC_IRQ_INT2_DXOVP,
0505 MAX77693_MUIC_IRQ_INT2_VBVOLT,
0506 MAX77693_MUIC_IRQ_INT2_VIDRM,
0507
0508
0509 MAX77693_MUIC_IRQ_INT3_EOC,
0510 MAX77693_MUIC_IRQ_INT3_CGMBC,
0511 MAX77693_MUIC_IRQ_INT3_OVP,
0512 MAX77693_MUIC_IRQ_INT3_MBCCHG_ERR,
0513 MAX77693_MUIC_IRQ_INT3_CHG_ENABLED,
0514 MAX77693_MUIC_IRQ_INT3_BAT_DET,
0515
0516 MAX77693_MUIC_IRQ_NR,
0517 };
0518
0519 #endif