linux/drivers/power/supply/bd99954-charger.h

/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (C) 2020 ROHM Semiconductors */
#ifndef BD99954_CHARGER_H
#define BD99954_CHARGER_H

#include <linux/regmap.h>

#define BD9995X_MANUFACTURER
#define BD9995X_IRQ_PIN

#define BD9995X_VSYS_PRECHARGE_OFFSET_MV

#define BD99954_ID
#define BD99955_ID
#define BD99956_ID

/* Battery Charger Commands */
#define CHARGING_CURRENT
#define CHARGING_VOLTAGE
#define PROTECT_SET
#define MAP_SET

/* Extended commands */
#define CHGSTM_STATUS
#define VBAT_VSYS_STATUS
#define VBUS_VCC_STATUS
#define CHGOP_STATUS
#define WDT_STATUS
#define CUR_ILIM_VAL
#define SEL_ILIM_VAL
#define IBUS_LIM_SET
#define ICC_LIM_SET
#define IOTG_LIM_SET
#define VIN_CTRL_SET
#define CHGOP_SET1
#define CHGOP_SET2
#define VBUSCLPS_TH_SET
#define VCCCLPS_TH_SET
#define CHGWDT_SET
#define BATTWDT_SET
#define VSYSREG_SET
#define VSYSVAL_THH_SET
#define VSYSVAL_THL_SET
#define ITRICH_SET
#define IPRECH_SET
#define ICHG_SET
#define ITERM_SET
#define VPRECHG_TH_SET
#define VRBOOST_SET
#define VFASTCHG_REG_SET1
#define VFASTCHG_REG_SET2
#define VFASTCHG_REG_SET3
#define VRECHG_SET
#define VBATOVP_SET
#define IBATSHORT_SET
#define PROCHOT_CTRL_SET
#define PROCHOT_ICRIT_SET
#define PROCHOT_INORM_SET
#define PROCHOT_IDCHG_SET
#define PROCHOT_VSYS_SET
#define PMON_IOUT_CTRL_SET
#define PMON_DACIN_VAL
#define IOUT_DACIN_VAL
#define VCC_UCD_SET
#define VCC_UCD_STATUS
#define VCC_IDD_STATUS
#define VCC_UCD_FCTRL_SET
#define VCC_UCD_FCTRL_EN
#define VBUS_UCD_SET
#define VBUS_UCD_STATUS
#define VBUS_IDD_STATUS
#define VBUS_UCD_FCTRL_SET
#define VBUS_UCD_FCTRL_EN
#define CHIP_ID
#define CHIP_REV
#define IC_SET1
#define IC_SET2
#define SYSTEM_STATUS
#define SYSTEM_CTRL_SET
#define VM_CTRL_SET
#define THERM_WINDOW_SET1
#define THERM_WINDOW_SET2
#define THERM_WINDOW_SET3
#define THERM_WINDOW_SET4
#define THERM_WINDOW_SET5
#define IBATP_TH_SET
#define IBATM_TH_SET
#define VBAT_TH_SET
#define THERM_TH_SET
#define IACP_TH_SET
#define VACP_TH_SET
#define VBUS_TH_SET
#define VCC_TH_SET
#define VSYS_TH_SET
#define EXTIADP_TH_SET
#define IBATP_VAL
#define IBATP_AVE_VAL
#define IBATM_VAL
#define IBATM_AVE_VAL
#define VBAT_VAL
#define VBAT_AVE_VAL
#define THERM_VAL
#define VTH_VAL
#define IACP_VAL
#define IACP_AVE_VAL
#define VACP_VAL
#define VACP_AVE_VAL
#define VBUS_VAL
#define VBUS_AVE_VAL
#define VCC_VAL
#define VCC_AVE_VAL
#define VSYS_VAL
#define VSYS_AVE_VAL
#define EXTIADP_VAL
#define EXTIADP_AVE_VAL
#define VACPCLPS_TH_SET
#define INT0_SET
#define INT1_SET
#define INT2_SET
#define INT3_SET
#define INT4_SET
#define INT5_SET
#define INT6_SET
#define INT7_SET
#define INT0_STATUS
#define INT1_STATUS
#define INT2_STATUS
#define INT3_STATUS
#define INT4_STATUS
#define INT5_STATUS
#define INT6_STATUS
#define INT7_STATUS
#define OTPREG0
#define OTPREG1
#define SMBREG
#define DEBUG_MODE_SET
#define DEBUG0x14
#define DEBUG0x1A

enum bd9995x_fields {};

static const struct reg_field bd9995x_reg_fields[] =;

/* CHGSTM_STATEs */
#define CHGSTM_SUSPEND
#define CHGSTM_TRICKLE_CHARGE
#define CHGSTM_PRE_CHARGE
#define CHGSTM_FAST_CHARGE
#define CHGSTM_TOP_OFF
#define CHGSTM_DONE
#define CHGSTM_OTG
#define CHGSTM_OTG_DONE
#define CHGSTM_TEMPERATURE_ERROR_1
#define CHGSTM_TEMPERATURE_ERROR_2
#define CHGSTM_TEMPERATURE_ERROR_3
#define CHGSTM_TEMPERATURE_ERROR_4
#define CHGSTM_TEMPERATURE_ERROR_5
#define CHGSTM_TEMPERATURE_ERROR_6
#define CHGSTM_TEMPERATURE_ERROR_7
#define CHGSTM_THERMAL_SHUT_DOWN_1
#define CHGSTM_THERMAL_SHUT_DOWN_2
#define CHGSTM_THERMAL_SHUT_DOWN_3
#define CHGSTM_THERMAL_SHUT_DOWN_4
#define CHGSTM_THERMAL_SHUT_DOWN_5
#define CHGSTM_THERMAL_SHUT_DOWN_6
#define CHGSTM_THERMAL_SHUT_DOWN_7
#define CHGSTM_BATTERY_ERROR

/* VBAT_VSYS_STATUS */
#define STATUS_VSYS_OV
#define STATUS_VSYS_SSD
#define STATUS_VSYS_SCP
#define STATUS_VSYS_UVN
#define STATUS_IBAT_SHORT
#define STATUS_VBAT_OV
#define STATUS_DEAD_BAT

/* VBUS_VCC_STATUS */
#define STATUS_VACP_DET
#define STATUS_VCC_OVP
#define STATUS_ILIM_VCC_MOD
#define STATUS_VCC_CLPS
#define STATUS_VCC_DET
#define STATUS_VBUS_OVP
#define STATUS_ILIM_VBUS_MOD
#define STATUS_VBUS_CLPS
#define STATUS_VBUS_DET

/* Interrupt set/status definitions */

/* INT 0 */
#define INT0_INT7_STATUS
#define INT0_INT6_STATUS
#define INT0_INT5_STATUS
#define INT0_INT4_STATUS
#define INT0_INT3_STATUS
#define INT0_INT2_STATUS
#define INT0_INT1_STATUS
#define INT0_INT0_STATUS
#define INT0_ALL

/* INT 1 */
#define VBUS_RBUV_DET
#define VBUS_RBUV_RES
#define VBUS_TH_DET
#define VBUS_TH_RES
#define VBUS_IIN_MOD
#define VBUS_OV_DET
#define VBUS_OV_RES
#define VBUS_CLPS_DET
#define VBUS_CLPS
#define VBUS_DET
#define VBUS_RES
#define INT1_ALL

/* INT 2 */
#define VCC_RBUV_DET
#define VCC_RBUV_RES
#define VCC_TH_DET
#define VCC_TH_RES
#define VCC_IIN_MOD
#define VCC_OVP_DET
#define VCC_OVP_RES
#define VCC_CLPS_DET
#define VCC_CLPS_RES
#define VCC_DET
#define VCC_RES
#define INT2_ALL
/* INT 3 */
#define TH_DET
#define TH_RMV
#define TMP_OUT_DET
#define TMP_OUT_RES
#define VBAT_TH_DET
#define VBAT_TH_RES
#define IBAT_SHORT_DET
#define IBAT_SHORT_RES
#define VBAT_OV_DET
#define VBAT_OV_RES
#define BAT_ASSIST_DET
#define BAT_ASSIST_RES
#define INT3_ALL

/* INT 4 */
#define VSYS_TH_DET
#define VSYS_TH_RES
#define VSYS_OV_DET
#define VSYS_OV_RES
#define VSYS_SHT_DET
#define VSYS_SHT_RES
#define VSYS_UV_DET
#define VSYS_UV_RES
#define INT4_ALL

/* INT 5*/
#define OTP_LOAD_DONE
#define PWR_ON
#define EXTIADP_TRNS
#define EXTIADP_TH_DET
#define EXIADP_TH_RES
#define BAT_MNT_DET
#define BAT_MNT_RES
#define TSD_DET
#define TSD_RES
#define CHGWDT_EXP
#define THERMWDT_EXP
#define TMP_TRNS
#define CHG_TRNS
#define INT5_ALL

/* INT 6*/
#define VBUS_UCD_PORT_DET
#define VBUS_UCD_UCHG_DET
#define VBUS_UCD_URID_RMV
#define VBUS_UCD_OTG_DET
#define VBUS_UCD_URID_MOD
#define VCC_UCD_PORT_DET
#define VCC_UCD_UCHG_DET
#define VCC_UCD_URID_RMV
#define VCC_UCD_OTG_DET
#define VCC_UCD_URID_MOD
#define INT6_ALL

/* INT 7 */
#define PROCHOT_DET
#define PROCHOT_RES
#define VACP_DET
#define VACP_RES
#define VACP_TH_DET
#define VACP_TH_RES
#define IACP_TH_DET
#define IACP_THE_RES
#define THERM_TH_DET
#define THERM_TH_RES
#define IBATM_TH_DET
#define IBATM_TH_RES
#define IBATP_TH_DET
#define IBATP_TH_RES
#define INT7_ALL

/* SYSTEM_CTRL_SET*/
#define MONRST
#define ALMRST
#define CHGRST
#define OTPLD
#define ALLRST

/* F_BATTEMP */
#define ROOM
#define HOT1
#define HOT2
#define HOT3
#define COLD1
#define COLD2
#define TEMP_DIS
#define BATT_OPEN

#endif