linux/include/linux/mfd/axp20x.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Functions and registers to access AXP20X power management chip.
 *
 * Copyright (C) 2013, Carlo Caione <[email protected]>
 */

#ifndef __LINUX_MFD_AXP20X_H
#define __LINUX_MFD_AXP20X_H

#include <linux/regmap.h>

enum axp20x_variants {};

#define AXP192_DATACACHE(m)
#define AXP20X_DATACACHE(m)

/* Power supply */
#define AXP152_PWR_OP_MODE
#define AXP152_LDO3456_DC1234_CTRL
#define AXP152_ALDO_OP_MODE
#define AXP152_LDO0_CTRL
#define AXP152_DCDC2_V_OUT
#define AXP152_DCDC2_V_RAMP
#define AXP152_DCDC1_V_OUT
#define AXP152_DCDC3_V_OUT
#define AXP152_ALDO12_V_OUT
#define AXP152_DLDO1_V_OUT
#define AXP152_DLDO2_V_OUT
#define AXP152_DCDC4_V_OUT
#define AXP152_V_OFF
#define AXP152_OFF_CTRL
#define AXP152_PEK_KEY
#define AXP152_DCDC_FREQ
#define AXP152_DCDC_MODE

#define AXP192_USB_OTG_STATUS
#define AXP192_PWR_OUT_CTRL
#define AXP192_DCDC2_V_OUT
#define AXP192_DCDC1_V_OUT
#define AXP192_DCDC3_V_OUT
#define AXP192_LDO2_3_V_OUT

#define AXP20X_PWR_INPUT_STATUS
#define AXP20X_PWR_OP_MODE
#define AXP20X_USB_OTG_STATUS
#define AXP20X_PWR_OUT_CTRL
#define AXP20X_DCDC2_V_OUT
#define AXP20X_DCDC2_LDO3_V_RAMP
#define AXP20X_DCDC3_V_OUT
#define AXP20X_LDO24_V_OUT
#define AXP20X_LDO3_V_OUT
#define AXP20X_VBUS_IPSOUT_MGMT
#define AXP20X_V_OFF
#define AXP20X_OFF_CTRL
#define AXP20X_CHRG_CTRL1
#define AXP20X_CHRG_CTRL2
#define AXP20X_CHRG_BAK_CTRL
#define AXP20X_PEK_KEY
#define AXP20X_DCDC_FREQ
#define AXP20X_V_LTF_CHRG
#define AXP20X_V_HTF_CHRG
#define AXP20X_APS_WARN_L1
#define AXP20X_APS_WARN_L2
#define AXP20X_V_LTF_DISCHRG
#define AXP20X_V_HTF_DISCHRG

#define AXP22X_PWR_OUT_CTRL1
#define AXP22X_PWR_OUT_CTRL2
#define AXP22X_PWR_OUT_CTRL3
#define AXP22X_DLDO1_V_OUT
#define AXP22X_DLDO2_V_OUT
#define AXP22X_DLDO3_V_OUT
#define AXP22X_DLDO4_V_OUT
#define AXP22X_ELDO1_V_OUT
#define AXP22X_ELDO2_V_OUT
#define AXP22X_ELDO3_V_OUT
#define AXP22X_DC5LDO_V_OUT
#define AXP22X_DCDC1_V_OUT
#define AXP22X_DCDC2_V_OUT
#define AXP22X_DCDC3_V_OUT
#define AXP22X_DCDC4_V_OUT
#define AXP22X_DCDC5_V_OUT
#define AXP22X_DCDC23_V_RAMP_CTRL
#define AXP22X_ALDO1_V_OUT
#define AXP22X_ALDO2_V_OUT
#define AXP22X_ALDO3_V_OUT
#define AXP22X_CHRG_CTRL3

#define AXP313A_ON_INDICATE
#define AXP313A_OUTPUT_CONTROL
#define AXP313A_DCDC1_CONTROL
#define AXP313A_DCDC2_CONTROL
#define AXP313A_DCDC3_CONTROL
#define AXP313A_ALDO1_CONTROL
#define AXP313A_DLDO1_CONTROL
#define AXP313A_SHUTDOWN_CTRL
#define AXP313A_IRQ_EN
#define AXP313A_IRQ_STATE

#define AXP717_ON_INDICATE
#define AXP717_PMU_STATUS_2
#define AXP717_BC_DETECT
#define AXP717_PMU_FAULT
#define AXP717_MODULE_EN_CONTROL_1
#define AXP717_MIN_SYS_V_CONTROL
#define AXP717_INPUT_VOL_LIMIT_CTRL
#define AXP717_INPUT_CUR_LIMIT_CTRL
#define AXP717_MODULE_EN_CONTROL_2
#define AXP717_BOOST_CONTROL
#define AXP717_VSYS_V_POWEROFF
#define AXP717_IRQ0_EN
#define AXP717_IRQ1_EN
#define AXP717_IRQ2_EN
#define AXP717_IRQ3_EN
#define AXP717_IRQ4_EN
#define AXP717_IRQ0_STATE
#define AXP717_IRQ1_STATE
#define AXP717_IRQ2_STATE
#define AXP717_IRQ3_STATE
#define AXP717_IRQ4_STATE
#define AXP717_ICC_CHG_SET
#define AXP717_ITERM_CHG_SET
#define AXP717_CV_CHG_SET
#define AXP717_DCDC_OUTPUT_CONTROL
#define AXP717_DCDC1_CONTROL
#define AXP717_DCDC2_CONTROL
#define AXP717_DCDC3_CONTROL
#define AXP717_DCDC4_CONTROL
#define AXP717_LDO0_OUTPUT_CONTROL
#define AXP717_LDO1_OUTPUT_CONTROL
#define AXP717_ALDO1_CONTROL
#define AXP717_ALDO2_CONTROL
#define AXP717_ALDO3_CONTROL
#define AXP717_ALDO4_CONTROL
#define AXP717_BLDO1_CONTROL
#define AXP717_BLDO2_CONTROL
#define AXP717_BLDO3_CONTROL
#define AXP717_BLDO4_CONTROL
#define AXP717_CLDO1_CONTROL
#define AXP717_CLDO2_CONTROL
#define AXP717_CLDO3_CONTROL
#define AXP717_CLDO4_CONTROL
#define AXP717_CPUSLDO_CONTROL
#define AXP717_BATT_PERCENT_DATA
#define AXP717_ADC_CH_EN_CONTROL
#define AXP717_BATT_V_H
#define AXP717_BATT_V_L
#define AXP717_VBUS_V_H
#define AXP717_VBUS_V_L
#define AXP717_VSYS_V_H
#define AXP717_VSYS_V_L
#define AXP717_BATT_CHRG_I_H
#define AXP717_BATT_CHRG_I_L
#define AXP717_ADC_DATA_SEL
#define AXP717_ADC_DATA_H
#define AXP717_ADC_DATA_L

#define AXP806_STARTUP_SRC
#define AXP806_CHIP_ID
#define AXP806_PWR_OUT_CTRL1
#define AXP806_PWR_OUT_CTRL2
#define AXP806_DCDCA_V_CTRL
#define AXP806_DCDCB_V_CTRL
#define AXP806_DCDCC_V_CTRL
#define AXP806_DCDCD_V_CTRL
#define AXP806_DCDCE_V_CTRL
#define AXP806_ALDO1_V_CTRL
#define AXP806_ALDO2_V_CTRL
#define AXP806_ALDO3_V_CTRL
#define AXP806_DCDC_MODE_CTRL1
#define AXP806_DCDC_MODE_CTRL2
#define AXP806_DCDC_FREQ_CTRL
#define AXP806_BLDO1_V_CTRL
#define AXP806_BLDO2_V_CTRL
#define AXP806_BLDO3_V_CTRL
#define AXP806_BLDO4_V_CTRL
#define AXP806_CLDO1_V_CTRL
#define AXP806_CLDO2_V_CTRL
#define AXP806_CLDO3_V_CTRL
#define AXP806_VREF_TEMP_WARN_L
#define AXP806_BUS_ADDR_EXT
#define AXP806_REG_ADDR_EXT

#define AXP803_POLYPHASE_CTRL
#define AXP803_FLDO1_V_OUT
#define AXP803_FLDO2_V_OUT
#define AXP803_DCDC1_V_OUT
#define AXP803_DCDC2_V_OUT
#define AXP803_DCDC3_V_OUT
#define AXP803_DCDC4_V_OUT
#define AXP803_DCDC5_V_OUT
#define AXP803_DCDC6_V_OUT
#define AXP803_DCDC_FREQ_CTRL

/* Other DCDC regulator control registers are the same as AXP803 */
#define AXP813_DCDC7_V_OUT

#define AXP15060_STARTUP_SRC
#define AXP15060_PWR_OUT_CTRL1
#define AXP15060_PWR_OUT_CTRL2
#define AXP15060_PWR_OUT_CTRL3
#define AXP15060_DCDC1_V_CTRL
#define AXP15060_DCDC2_V_CTRL
#define AXP15060_DCDC3_V_CTRL
#define AXP15060_DCDC4_V_CTRL
#define AXP15060_DCDC5_V_CTRL
#define AXP15060_DCDC6_V_CTRL
#define AXP15060_ALDO1_V_CTRL
#define AXP15060_DCDC_MODE_CTRL1
#define AXP15060_DCDC_MODE_CTRL2
#define AXP15060_OUTPUT_MONITOR_DISCHARGE
#define AXP15060_IRQ_PWROK_VOFF
#define AXP15060_ALDO2_V_CTRL
#define AXP15060_ALDO3_V_CTRL
#define AXP15060_ALDO4_V_CTRL
#define AXP15060_ALDO5_V_CTRL
#define AXP15060_BLDO1_V_CTRL
#define AXP15060_BLDO2_V_CTRL
#define AXP15060_BLDO3_V_CTRL
#define AXP15060_BLDO4_V_CTRL
#define AXP15060_BLDO5_V_CTRL
#define AXP15060_CLDO1_V_CTRL
#define AXP15060_CLDO2_V_CTRL
#define AXP15060_CLDO3_V_CTRL
#define AXP15060_CLDO4_V_CTRL
#define AXP15060_CPUSLDO_V_CTRL
#define AXP15060_PWR_WAKEUP_CTRL
#define AXP15060_PWR_DISABLE_DOWN_SEQ
#define AXP15060_PEK_KEY

/* Interrupt */
#define AXP152_IRQ1_EN
#define AXP152_IRQ2_EN
#define AXP152_IRQ3_EN
#define AXP152_IRQ1_STATE
#define AXP152_IRQ2_STATE
#define AXP152_IRQ3_STATE

#define AXP192_IRQ1_EN
#define AXP192_IRQ2_EN
#define AXP192_IRQ3_EN
#define AXP192_IRQ4_EN
#define AXP192_IRQ1_STATE
#define AXP192_IRQ2_STATE
#define AXP192_IRQ3_STATE
#define AXP192_IRQ4_STATE
#define AXP192_IRQ5_EN
#define AXP192_IRQ5_STATE

#define AXP20X_IRQ1_EN
#define AXP20X_IRQ2_EN
#define AXP20X_IRQ3_EN
#define AXP20X_IRQ4_EN
#define AXP20X_IRQ5_EN
#define AXP20X_IRQ6_EN
#define AXP20X_IRQ1_STATE
#define AXP20X_IRQ2_STATE
#define AXP20X_IRQ3_STATE
#define AXP20X_IRQ4_STATE
#define AXP20X_IRQ5_STATE
#define AXP20X_IRQ6_STATE

#define AXP15060_IRQ1_EN
#define AXP15060_IRQ2_EN
#define AXP15060_IRQ1_STATE
#define AXP15060_IRQ2_STATE

/* ADC */
#define AXP192_GPIO2_V_ADC_H
#define AXP192_GPIO2_V_ADC_L
#define AXP192_GPIO3_V_ADC_H
#define AXP192_GPIO3_V_ADC_L

#define AXP20X_ACIN_V_ADC_H
#define AXP20X_ACIN_V_ADC_L
#define AXP20X_ACIN_I_ADC_H
#define AXP20X_ACIN_I_ADC_L
#define AXP20X_VBUS_V_ADC_H
#define AXP20X_VBUS_V_ADC_L
#define AXP20X_VBUS_I_ADC_H
#define AXP20X_VBUS_I_ADC_L
#define AXP20X_TEMP_ADC_H
#define AXP20X_TEMP_ADC_L
#define AXP20X_TS_IN_H
#define AXP20X_TS_IN_L
#define AXP20X_GPIO0_V_ADC_H
#define AXP20X_GPIO0_V_ADC_L
#define AXP20X_GPIO1_V_ADC_H
#define AXP20X_GPIO1_V_ADC_L
#define AXP20X_PWR_BATT_H
#define AXP20X_PWR_BATT_M
#define AXP20X_PWR_BATT_L
#define AXP20X_BATT_V_H
#define AXP20X_BATT_V_L
#define AXP20X_BATT_CHRG_I_H
#define AXP20X_BATT_CHRG_I_L
#define AXP20X_BATT_DISCHRG_I_H
#define AXP20X_BATT_DISCHRG_I_L
#define AXP20X_IPSOUT_V_HIGH_H
#define AXP20X_IPSOUT_V_HIGH_L

/* Power supply */
#define AXP192_GPIO30_IN_RANGE

#define AXP20X_DCDC_MODE
#define AXP20X_ADC_EN1
#define AXP20X_ADC_EN2
#define AXP20X_ADC_RATE
#define AXP20X_GPIO10_IN_RANGE
#define AXP20X_GPIO1_ADC_IRQ_RIS
#define AXP20X_GPIO1_ADC_IRQ_FAL
#define AXP20X_TIMER_CTRL
#define AXP20X_VBUS_MON
#define AXP20X_OVER_TMP

#define AXP22X_PWREN_CTRL1
#define AXP22X_PWREN_CTRL2

/* GPIO */
#define AXP152_GPIO0_CTRL
#define AXP152_GPIO1_CTRL
#define AXP152_GPIO2_CTRL
#define AXP152_GPIO3_CTRL
#define AXP152_LDOGPIO2_V_OUT
#define AXP152_GPIO_INPUT
#define AXP152_PWM0_FREQ_X
#define AXP152_PWM0_FREQ_Y
#define AXP152_PWM0_DUTY_CYCLE
#define AXP152_PWM1_FREQ_X
#define AXP152_PWM1_FREQ_Y
#define AXP152_PWM1_DUTY_CYCLE

#define AXP192_GPIO0_CTRL
#define AXP192_LDO_IO0_V_OUT
#define AXP192_GPIO1_CTRL
#define AXP192_GPIO2_CTRL
#define AXP192_GPIO2_0_STATE
#define AXP192_GPIO4_3_CTRL
#define AXP192_GPIO4_3_STATE
#define AXP192_GPIO2_0_PULL
#define AXP192_N_RSTO_CTRL

#define AXP20X_GPIO0_CTRL
#define AXP20X_LDO5_V_OUT
#define AXP20X_GPIO1_CTRL
#define AXP20X_GPIO2_CTRL
#define AXP20X_GPIO20_SS
#define AXP20X_GPIO3_CTRL

#define AXP22X_LDO_IO0_V_OUT
#define AXP22X_LDO_IO1_V_OUT
#define AXP22X_GPIO_STATE
#define AXP22X_GPIO_PULL_DOWN

#define AXP15060_CLDO4_GPIO2_MODESET

/* Battery */
#define AXP20X_CHRG_CC_31_24
#define AXP20X_CHRG_CC_23_16
#define AXP20X_CHRG_CC_15_8
#define AXP20X_CHRG_CC_7_0
#define AXP20X_DISCHRG_CC_31_24
#define AXP20X_DISCHRG_CC_23_16
#define AXP20X_DISCHRG_CC_15_8
#define AXP20X_DISCHRG_CC_7_0
#define AXP20X_CC_CTRL
#define AXP20X_FG_RES

/* OCV */
#define AXP20X_RDC_H
#define AXP20X_RDC_L
#define AXP20X_OCV(m)
#define AXP20X_OCV_MAX

/* AXP22X specific registers */
#define AXP22X_PMIC_TEMP_H
#define AXP22X_PMIC_TEMP_L
#define AXP22X_TS_ADC_H
#define AXP22X_TS_ADC_L
#define AXP22X_BATLOW_THRES1

/* AXP288/AXP803 specific registers */
#define AXP288_POWER_REASON
#define AXP288_BC_GLOBAL
#define AXP288_BC_VBUS_CNTL
#define AXP288_BC_USB_STAT
#define AXP288_BC_DET_STAT
#define AXP288_PMIC_ADC_H
#define AXP288_PMIC_ADC_L
#define AXP288_TS_ADC_H
#define AXP288_TS_ADC_L
#define AXP288_GP_ADC_H
#define AXP288_GP_ADC_L
#define AXP288_ADC_TS_PIN_CTRL
#define AXP288_RT_BATT_V_H
#define AXP288_RT_BATT_V_L

#define AXP813_ACIN_PATH_CTRL
#define AXP813_ADC_RATE

/* Fuel Gauge */
#define AXP288_FG_RDC1_REG
#define AXP288_FG_RDC0_REG
#define AXP288_FG_OCVH_REG
#define AXP288_FG_OCVL_REG
#define AXP288_FG_OCV_CURVE_REG
#define AXP288_FG_DES_CAP1_REG
#define AXP288_FG_DES_CAP0_REG
#define AXP288_FG_CC_MTR1_REG
#define AXP288_FG_CC_MTR0_REG
#define AXP288_FG_OCV_CAP_REG
#define AXP288_FG_CC_CAP_REG
#define AXP288_FG_LOW_CAP_REG
#define AXP288_FG_TUNE0
#define AXP288_FG_TUNE1
#define AXP288_FG_TUNE2
#define AXP288_FG_TUNE3
#define AXP288_FG_TUNE4
#define AXP288_FG_TUNE5

/* Regulators IDs */
enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

/* IRQs */
enum {};

enum axp192_irqs {};

enum {};

enum axp22x_irqs {};

enum axp288_irqs {};

enum axp313a_irqs {};

enum axp717_irqs {};

enum axp803_irqs {};

enum axp806_irqs {};

enum axp809_irqs {};

enum axp15060_irqs {};

struct axp20x_dev {};

/* generic helper function for reading 9-16 bit wide regs */
static inline int axp20x_read_variable_width(struct regmap *regmap,
	unsigned int reg, unsigned int width)
{}

/**
 * axp20x_match_device(): Setup axp20x variant related fields
 *
 * @axp20x: axp20x device to setup (.dev field must be set)
 * @dev: device associated with this axp20x device
 *
 * This lets the axp20x core configure the mfd cells and register maps
 * for later use.
 */
int axp20x_match_device(struct axp20x_dev *axp20x);

/**
 * axp20x_device_probe(): Probe a configured axp20x device
 *
 * @axp20x: axp20x device to probe (must be configured)
 *
 * This function lets the axp20x core register the axp20x mfd devices
 * and irqchip. The axp20x device passed in must be fully configured
 * with axp20x_match_device, its irq set, and regmap created.
 */
int axp20x_device_probe(struct axp20x_dev *axp20x);

/**
 * axp20x_device_remove(): Remove a axp20x device
 *
 * @axp20x: axp20x device to remove
 *
 * This tells the axp20x core to remove the associated mfd devices
 */
void axp20x_device_remove(struct axp20x_dev *axp20x);

#endif /* __LINUX_MFD_AXP20X_H */