linux/include/linux/mfd/lp873x.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Functions to access LP873X power management chip.
 *
 * Copyright (C) 2016 Texas Instruments Incorporated - https://www.ti.com/
 */

#ifndef __LINUX_MFD_LP873X_H
#define __LINUX_MFD_LP873X_H

#include <linux/i2c.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>

/* LP873x chip id list */
#define LP873X

/* All register addresses */
#define LP873X_REG_DEV_REV
#define LP873X_REG_OTP_REV
#define LP873X_REG_BUCK0_CTRL_1
#define LP873X_REG_BUCK0_CTRL_2
#define LP873X_REG_BUCK1_CTRL_1
#define LP873X_REG_BUCK1_CTRL_2
#define LP873X_REG_BUCK0_VOUT
#define LP873X_REG_BUCK1_VOUT
#define LP873X_REG_LDO0_CTRL
#define LP873X_REG_LDO1_CTRL
#define LP873X_REG_LDO0_VOUT
#define LP873X_REG_LDO1_VOUT
#define LP873X_REG_BUCK0_DELAY
#define LP873X_REG_BUCK1_DELAY
#define LP873X_REG_LDO0_DELAY
#define LP873X_REG_LDO1_DELAY
#define LP873X_REG_GPO_DELAY
#define LP873X_REG_GPO2_DELAY
#define LP873X_REG_GPO_CTRL
#define LP873X_REG_CONFIG
#define LP873X_REG_PLL_CTRL
#define LP873X_REG_PGOOD_CTRL1
#define LP873X_REG_PGOOD_CTRL2
#define LP873X_REG_PG_FAULT
#define LP873X_REG_RESET
#define LP873X_REG_INT_TOP_1
#define LP873X_REG_INT_TOP_2
#define LP873X_REG_INT_BUCK
#define LP873X_REG_INT_LDO
#define LP873X_REG_TOP_STAT
#define LP873X_REG_BUCK_STAT
#define LP873X_REG_LDO_STAT
#define LP873X_REG_TOP_MASK_1
#define LP873X_REG_TOP_MASK_2
#define LP873X_REG_BUCK_MASK
#define LP873X_REG_LDO_MASK
#define LP873X_REG_SEL_I_LOAD
#define LP873X_REG_I_LOAD_2
#define LP873X_REG_I_LOAD_1

#define LP873X_REG_MAX

/* Register field definitions */
#define LP873X_DEV_REV_DEV_ID
#define LP873X_DEV_REV_ALL_LAYER
#define LP873X_DEV_REV_METAL_LAYER

#define LP873X_OTP_REV_OTP_ID

#define LP873X_BUCK0_CTRL_1_BUCK0_FPWM
#define LP873X_BUCK0_CTRL_1_BUCK0_RDIS_EN
#define LP873X_BUCK0_CTRL_1_BUCK0_EN_PIN_CTRL
#define LP873X_BUCK0_CTRL_1_BUCK0_EN

#define LP873X_BUCK0_CTRL_2_BUCK0_ILIM
#define LP873X_BUCK0_CTRL_2_BUCK0_SLEW_RATE

#define LP873X_BUCK1_CTRL_1_BUCK1_FPWM
#define LP873X_BUCK1_CTRL_1_BUCK1_RDIS_EN
#define LP873X_BUCK1_CTRL_1_BUCK1_EN_PIN_CTRL
#define LP873X_BUCK1_CTRL_1_BUCK1_EN

#define LP873X_BUCK1_CTRL_2_BUCK1_ILIM
#define LP873X_BUCK1_CTRL_2_BUCK1_SLEW_RATE

#define LP873X_BUCK0_VOUT_BUCK0_VSET

#define LP873X_BUCK1_VOUT_BUCK1_VSET

#define LP873X_LDO0_CTRL_LDO0_RDIS_EN
#define LP873X_LDO0_CTRL_LDO0_EN_PIN_CTRL
#define LP873X_LDO0_CTRL_LDO0_EN

#define LP873X_LDO1_CTRL_LDO1_RDIS_EN
#define LP873X_LDO1_CTRL_LDO1_EN_PIN_CTRL
#define LP873X_LDO1_CTRL_LDO1_EN

#define LP873X_LDO0_VOUT_LDO0_VSET

#define LP873X_LDO1_VOUT_LDO1_VSET

#define LP873X_BUCK0_DELAY_BUCK0_SD_DELAY
#define LP873X_BUCK0_DELAY_BUCK0_SU_DELAY

#define LP873X_BUCK1_DELAY_BUCK1_SD_DELAY
#define LP873X_BUCK1_DELAY_BUCK1_SU_DELAY

#define LP873X_LDO0_DELAY_LDO0_SD_DELAY
#define LP873X_LDO0_DELAY_LDO0_SU_DELAY

#define LP873X_LDO1_DELAY_LDO1_SD_DELAY
#define LP873X_LDO1_DELAY_LDO1_SU_DELAY

#define LP873X_GPO_DELAY_GPO_SD_DELAY
#define LP873X_GPO_DELAY_GPO_SU_DELAY

#define LP873X_GPO2_DELAY_GPO2_SD_DELAY
#define LP873X_GPO2_DELAY_GPO2_SU_DELAY

#define LP873X_GPO_CTRL_GPO2_OD
#define LP873X_GPO_CTRL_GPO2_EN_PIN_CTRL
#define LP873X_GPO_CTRL_GPO2_EN
#define LP873X_GPO_CTRL_GPO_OD
#define LP873X_GPO_CTRL_GPO_EN_PIN_CTRL
#define LP873X_GPO_CTRL_GPO_EN

#define LP873X_CONFIG_SU_DELAY_SEL
#define LP873X_CONFIG_SD_DELAY_SEL
#define LP873X_CONFIG_CLKIN_PIN_SEL
#define LP873X_CONFIG_CLKIN_PD
#define LP873X_CONFIG_EN_PD
#define LP873X_CONFIG_TDIE_WARN_LEVEL
#define LP873X_EN_SPREAD_SPEC

#define LP873X_PLL_CTRL_EN_PLL
#define LP873X_EXT_CLK_FREQ

#define LP873X_PGOOD_CTRL1_PGOOD_POL
#define LP873X_PGOOD_CTRL1_PGOOD_OD
#define LP873X_PGOOD_CTRL1_PGOOD_WINDOW_LDO
#define LP873X_PGOOD_CTRL1_PGOOD_WINDOWN_BUCK
#define LP873X_PGOOD_CTRL1_PGOOD_EN_PGOOD_LDO1
#define LP873X_PGOOD_CTRL1_PGOOD_EN_PGOOD_LDO0
#define LP873X_PGOOD_CTRL1_PGOOD_EN_PGOOD_BUCK1
#define LP873X_PGOOD_CTRL1_PGOOD_EN_PGOOD_BUCK0

#define LP873X_PGOOD_CTRL2_EN_PGOOD_TWARN
#define LP873X_PGOOD_CTRL2_EN_PG_FAULT_GATE
#define LP873X_PGOOD_CTRL2_PGOOD_MODE

#define LP873X_PG_FAULT_PG_FAULT_LDO1
#define LP873X_PG_FAULT_PG_FAULT_LDO0
#define LP873X_PG_FAULT_PG_FAULT_BUCK1
#define LP873X_PG_FAULT_PG_FAULT_BUCK0

#define LP873X_RESET_SW_RESET

#define LP873X_INT_TOP_1_PGOOD_INT
#define LP873X_INT_TOP_1_LDO_INT
#define LP873X_INT_TOP_1_BUCK_INT
#define LP873X_INT_TOP_1_SYNC_CLK_INT
#define LP873X_INT_TOP_1_TDIE_SD_INT
#define LP873X_INT_TOP_1_TDIE_WARN_INT
#define LP873X_INT_TOP_1_OVP_INT
#define LP873X_INT_TOP_1_I_MEAS_INT

#define LP873X_INT_TOP_2_RESET_REG_INT

#define LP873X_INT_BUCK_BUCK1_PG_INT
#define LP873X_INT_BUCK_BUCK1_SC_INT
#define LP873X_INT_BUCK_BUCK1_ILIM_INT
#define LP873X_INT_BUCK_BUCK0_PG_INT
#define LP873X_INT_BUCK_BUCK0_SC_INT
#define LP873X_INT_BUCK_BUCK0_ILIM_INT

#define LP873X_INT_LDO_LDO1_PG_INT
#define LP873X_INT_LDO_LDO1_SC_INT
#define LP873X_INT_LDO_LDO1_ILIM_INT
#define LP873X_INT_LDO_LDO0_PG_INT
#define LP873X_INT_LDO_LDO0_SC_INT
#define LP873X_INT_LDO_LDO0_ILIM_INT

#define LP873X_TOP_STAT_PGOOD_STAT
#define LP873X_TOP_STAT_SYNC_CLK_STAT
#define LP873X_TOP_STAT_TDIE_SD_STAT
#define LP873X_TOP_STAT_TDIE_WARN_STAT
#define LP873X_TOP_STAT_OVP_STAT

#define LP873X_BUCK_STAT_BUCK1_STAT
#define LP873X_BUCK_STAT_BUCK1_PG_STAT
#define LP873X_BUCK_STAT_BUCK1_ILIM_STAT
#define LP873X_BUCK_STAT_BUCK0_STAT
#define LP873X_BUCK_STAT_BUCK0_PG_STAT
#define LP873X_BUCK_STAT_BUCK0_ILIM_STAT

#define LP873X_LDO_STAT_LDO1_STAT
#define LP873X_LDO_STAT_LDO1_PG_STAT
#define LP873X_LDO_STAT_LDO1_ILIM_STAT
#define LP873X_LDO_STAT_LDO0_STAT
#define LP873X_LDO_STAT_LDO0_PG_STAT
#define LP873X_LDO_STAT_LDO0_ILIM_STAT

#define LP873X_TOP_MASK_1_PGOOD_INT_MASK
#define LP873X_TOP_MASK_1_SYNC_CLK_MASK
#define LP873X_TOP_MASK_1_TDIE_WARN_MASK
#define LP873X_TOP_MASK_1_I_MEAS_MASK

#define LP873X_TOP_MASK_2_RESET_REG_MASK

#define LP873X_BUCK_MASK_BUCK1_PGF_MASK
#define LP873X_BUCK_MASK_BUCK1_PGR_MASK
#define LP873X_BUCK_MASK_BUCK1_ILIM_MASK
#define LP873X_BUCK_MASK_BUCK0_PGF_MASK
#define LP873X_BUCK_MASK_BUCK0_PGR_MASK
#define LP873X_BUCK_MASK_BUCK0_ILIM_MASK

#define LP873X_LDO_MASK_LDO1_PGF_MASK
#define LP873X_LDO_MASK_LDO1_PGR_MASK
#define LP873X_LDO_MASK_LDO1_ILIM_MASK
#define LP873X_LDO_MASK_LDO0_PGF_MASK
#define LP873X_LDO_MASK_LDO0_PGR_MASK
#define LP873X_LDO_MASK_LDO0_ILIM_MASK

#define LP873X_SEL_I_LOAD_CURRENT_BUCK_SELECT

#define LP873X_I_LOAD_2_BUCK_LOAD_CURRENT

#define LP873X_I_LOAD_1_BUCK_LOAD_CURRENT

#define LP873X_MAX_REG_ID

/* Number of step-down converters available */
#define LP873X_NUM_BUCK
/* Number of LDO voltage regulators available */
#define LP873X_NUM_LDO
/* Number of total regulators available */
#define LP873X_NUM_REGULATOR

enum lp873x_regulator_id {};

/**
 * struct lp873x - state holder for the lp873x driver
 * @dev: struct device pointer for MFD device
 * @rev: revision of the lp873x
 * @lock: lock guarding the data structure
 * @regmap: register map of the lp873x PMIC
 *
 * Device data may be used to access the LP873X chip
 */
struct lp873x {};
#endif /* __LINUX_MFD_LP873X_H */