linux/include/linux/mfd/rohm-bd71815.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright 2021 ROHM Semiconductors.
 *
 * Author: Matti Vaittinen <[email protected]>
 *
 * Copyright 2014 Embest Technology Co. Ltd. Inc.
 *
 * Author: [email protected]
 */

#ifndef _MFD_BD71815_H
#define _MFD_BD71815_H

#include <linux/regmap.h>

enum {};

#define BD71815_SUPPLY_STATE_ENABLED

enum {};

/* BD71815_REG_BUCK1_MODE bits */
#define BD71815_BUCK_RAMPRATE_MASK
#define BD71815_BUCK_RAMPRATE_10P00MV
#define BD71815_BUCK_RAMPRATE_5P00MV
#define BD71815_BUCK_RAMPRATE_2P50MV
#define BD71815_BUCK_RAMPRATE_1P25MV

#define BD71815_BUCK_PWM_FIXED
#define BD71815_BUCK_SNVS_ON
#define BD71815_BUCK_RUN_ON
#define BD71815_BUCK_LPSR_ON
#define BD71815_BUCK_SUSP_ON

/* BD71815_REG_BUCK1_VOLT_H bits */
#define BD71815_BUCK_DVSSEL
#define BD71815_BUCK_STBY_DVS
#define BD71815_VOLT_MASK
#define BD71815_BUCK1_H_DEFAULT
#define BD71815_BUCK1_L_DEFAULT

/* BD71815_REG_BUCK2_VOLT_H bits */
#define BD71815_BUCK2_H_DEFAULT
#define BD71815_BUCK2_L_DEFAULT

/* WLED output */
/* current register mask */
#define LED_DIMM_MASK
/* LED enable bits at LED_CTRL reg */
#define LED_CHGDONE_EN
#define LED_RUN_ON
#define LED_LPSR_ON
#define LED_SUSP_ON

/* BD71815_REG_LDO1_CTRL bits */
#define LDO1_EN
#define LDO2_EN
#define LDO3_EN
#define DVREF_EN
#define VOSNVS_SW_EN

/* LDO_MODE1_register */
#define LDO1_SNVS_ON
#define LDO1_RUN_ON
#define LDO1_LPSR_ON
#define LDO1_SUSP_ON
/* set => register control, unset => GPIO control */
#define LDO4_MODE_MASK
#define LDO4_MODE_I2C
#define LDO4_MODE_GPIO
/* set => register control, unset => start when DCIN connected */
#define LDO3_MODE_MASK
#define LDO3_MODE_I2C
#define LDO3_MODE_DCIN

/* LDO_MODE2 register */
#define LDO3_SNVS_ON
#define LDO3_RUN_ON
#define LDO3_LPSR_ON
#define LDO3_SUSP_ON
#define LDO2_SNVS_ON
#define LDO2_RUN_ON
#define LDO2_LPSR_ON
#define LDO2_SUSP_ON


/* LDO_MODE3 register */
#define LDO5_SNVS_ON
#define LDO5_RUN_ON
#define LDO5_LPSR_ON
#define LDO5_SUSP_ON
#define LDO4_SNVS_ON
#define LDO4_RUN_ON
#define LDO4_LPSR_ON
#define LDO4_SUSP_ON

/* LDO_MODE4 register */
#define DVREF_SNVS_ON
#define DVREF_RUN_ON
#define DVREF_LPSR_ON
#define DVREF_SUSP_ON
#define LDO_LPSR_SNVS_ON
#define LDO_LPSR_RUN_ON
#define LDO_LPSR_LPSR_ON
#define LDO_LPSR_SUSP_ON

/* BD71815_REG_OUT32K bits */
#define OUT32K_EN
#define OUT32K_MODE
#define OUT32K_MODE_CMOS
#define OUT32K_MODE_OPEN_DRAIN

/* BD71815_REG_BAT_STAT bits */
#define BAT_DET
#define BAT_DET_OFFSET
#define BAT_DET_DONE
#define VBAT_OV
#define DBAT_DET

/* BD71815_REG_VBUS_STAT bits */
#define VBUS_DET

#define BD71815_REG_RTC_START
#define BD71815_REG_RTC_ALM_START

/* BD71815_REG_ALM0_MASK bits */
#define A0_ONESEC

/* BD71815_REG_INT_EN_00 bits */
#define ALMALE

/* BD71815_REG_INT_STAT_03 bits */
#define DCIN_MON_DET
#define DCIN_MON_RES
#define POWERON_LONG
#define POWERON_MID
#define POWERON_SHORT
#define POWERON_PRESS

/* BD71805_REG_INT_STAT_08 bits */
#define VBAT_MON_DET
#define VBAT_MON_RES

/* BD71805_REG_INT_STAT_11 bits */
#define INT_STAT_11_VF_DET
#define INT_STAT_11_VF_RES
#define INT_STAT_11_VF125_DET
#define INT_STAT_11_VF125_RES
#define INT_STAT_11_OVTMP_DET
#define INT_STAT_11_OVTMP_RES
#define INT_STAT_11_LOTMP_DET
#define INT_STAT_11_LOTMP_RES

#define VBAT_MON_DET
#define VBAT_MON_RES

/* BD71815_REG_PWRCTRL bits */
#define RESTARTEN

/* BD71815_REG_GPO bits */
#define READY_FORCE_LOW
#define BD71815_GPIO_DRIVE_MASK
#define BD71815_GPIO_OPEN_DRAIN
#define BD71815_GPIO_CMOS

/* BD71815 interrupt masks */
enum {};
/* BD71815 interrupt irqs */
enum {};

#define BD71815_INT_BUCK1_OCP_MASK
#define BD71815_INT_BUCK2_OCP_MASK
#define BD71815_INT_BUCK3_OCP_MASK
#define BD71815_INT_BUCK4_OCP_MASK
#define BD71815_INT_BUCK5_OCP_MASK
#define BD71815_INT_LED_OVP_MASK
#define BD71815_INT_LED_OCP_MASK
#define BD71815_INT_LED_SCP_MASK

#define BD71815_INT_DCIN_RMV_MASK
#define BD71815_INT_CLPS_OUT_MASK
#define BD71815_INT_CLPS_IN_MASK
#define BD71815_INT_DCIN_OVP_RES_MASK
#define BD71815_INT_DCIN_OVP_DET_MASK

#define BD71815_INT_DCIN_MON_RES_MASK
#define BD71815_INT_DCIN_MON_DET_MASK
#define BD71815_INT_WDOG_MASK

#define BD71815_INT_VSYS_UV_RES_MASK
#define BD71815_INT_VSYS_UV_DET_MASK
#define BD71815_INT_VSYS_LOW_RES_MASK
#define BD71815_INT_VSYS_LOW_DET_MASK
#define BD71815_INT_VSYS_MON_RES_MASK
#define BD71815_INT_VSYS_MON_DET_MASK

#define BD71815_INT_CHG_WDG_TEMP_MASK
#define BD71815_INT_CHG_WDG_TIME_MASK
#define BD71815_INT_CHG_RECHARGE_RES_MASK
#define BD71815_INT_CHG_RECHARGE_DET_MASK
#define BD71815_INT_CHG_RANGED_TEMP_TRANSITION_MASK
#define BD71815_INT_CHG_STATE_TRANSITION_MASK

#define BD71815_INT_BAT_TEMP_NORMAL_MASK
#define BD71815_INT_BAT_TEMP_ERANGE_MASK
#define BD71815_INT_BAT_REMOVED_MASK
#define BD71815_INT_BAT_DETECTED_MASK
#define BD71815_INT_THERM_REMOVED_MASK
#define BD71815_INT_THERM_DETECTED_MASK

#define BD71815_INT_BAT_DEAD_MASK
#define BD71815_INT_BAT_SHORTC_RES_MASK
#define BD71815_INT_BAT_SHORTC_DET_MASK
#define BD71815_INT_BAT_LOW_VOLT_RES_MASK
#define BD71815_INT_BAT_LOW_VOLT_DET_MASK
#define BD71815_INT_BAT_OVER_VOLT_RES_MASK
#define BD71815_INT_BAT_OVER_VOLT_DET_MASK

#define BD71815_INT_BAT_MON_RES_MASK
#define BD71815_INT_BAT_MON_DET_MASK

#define BD71815_INT_BAT_CC_MON1_MASK
#define BD71815_INT_BAT_CC_MON2_MASK
#define BD71815_INT_BAT_CC_MON3_MASK

#define BD71815_INT_BAT_OVER_CURR_1_RES_MASK
#define BD71815_INT_BAT_OVER_CURR_1_DET_MASK
#define BD71815_INT_BAT_OVER_CURR_2_RES_MASK
#define BD71815_INT_BAT_OVER_CURR_2_DET_MASK
#define BD71815_INT_BAT_OVER_CURR_3_RES_MASK
#define BD71815_INT_BAT_OVER_CURR_3_DET_MASK

#define BD71815_INT_TEMP_BAT_LOW_RES_MASK
#define BD71815_INT_TEMP_BAT_LOW_DET_MASK
#define BD71815_INT_TEMP_BAT_HI_RES_MASK
#define BD71815_INT_TEMP_BAT_HI_DET_MASK
#define BD71815_INT_TEMP_CHIP_OVER_125_RES_MASK
#define BD71815_INT_TEMP_CHIP_OVER_125_DET_MASK
#define BD71815_INT_TEMP_CHIP_OVER_VF_RES_MASK
#define BD71815_INT_TEMP_CHIP_OVER_VF_DET_MASK

#define BD71815_INT_RTC0_MASK
#define BD71815_INT_RTC1_MASK
#define BD71815_INT_RTC2_MASK

/* BD71815_REG_CC_CTRL bits */
#define CCNTRST
#define CCNTENB
#define CCCALIB

/* BD71815_REG_CC_CURCD */
#define CURDIR_Discharging

/* BD71815_REG_VM_SA_IBAT */
#define IBAT_SA_DIR_Discharging

/* BD71815_REG_REX_CTRL_1 bits */
#define REX_CLR

/* BD71815_REG_REX_CTRL_1 bits */
#define REX_PMU_STATE_MASK

/* BD71815_REG_LED_CTRL bits */
#define CHGDONE_LED_EN

#endif /* __LINUX_MFD_BD71815_H */