# SPDX-License-Identifier: GPL-2.0-only
#
# PMIC drivers configuration
#

menu "PMIC Drivers"
	depends on AW_BSP

comment "Base Functions"

config AW_MFD_AXP2101
	tristate
	select MFD_CORE
	select REGMAP_IRQ
	select HAS_IOMEM

config AW_MFD_AXP2101_I2C
	tristate "X-POWERS AXP2101 PMICs with I2C"
	depends on AW_TWI
	select AW_MFD_AXP2101
	select REGMAP_I2C
	select I2C
	help
	  If you say Y here you get support for the X-Powers AXP2101 power
	  management ICs (PMICs) controlled with I2C.
	  This driver include only the core APIs. You have to select individual
	  components like regulators or the PEK (Power Enable Key) under the
	  corresponding menus.

config AW_MFD_SOC_PMU
	tristate
	select MFD_CORE
	select HAS_IOMEM

config AW_MFD_PMU_SOC_MMIO
	tristate
	select AW_MFD_SOC_PMU
	select REGMAP_MMIO

config AW_MFD_PMU_EXT
	tristate
	select MFD_CORE
	select REGMAP
	select REGMAP_IRQ

config AW_MFD_PMU_EXT_I2C
	tristate "PMU_EXT PMICs with I2C"
	depends on AW_TWI
	select AW_MFD_PMU_EXT
	select REGMAP_I2C
	select I2C
	help
	  If you say yes here you get support for the TCS4838 series of
	  PM chips with I2C interface.

config AW_MFD_BMU_EXT
	tristate
	select MFD_CORE
	select REGMAP
	select REGMAP_IRQ

config AW_REGULATOR_BMU_EXT
	tristate

config AW_MFD_BMU_EXT_I2C
	tristate "BMU_EXT PMICs with I2C"
	depends on AW_TWI
	select AW_MFD_BMU_EXT
	select AW_REGULATOR_BMU_EXT
	select REGMAP_I2C
	select I2C
	help
	  If you say yes here you get support for the TCS4838 series of
	  PM chips with I2C interface.

config AW_PMIC_VOLATILE_ENABLED
	bool "Select AW PMICs Volatile Enable"

config AW_POWER_DEBUG
	tristate "Allwinner Power DEBUG support"
	depends on AW_BSP
	help
	  Allwinner Power DEBUG.

	  This option is of interest only to developers who need to
	  develop on AllWinner SoC.

	  If unsure, say y.

comment "Regulator Drivers"

if AW_MFD_AXP2101

config AW_REGULATOR_AXP2101
	tristate "X-POWERS AXP2101 PMIC Regulators"
	depends on AW_MFD_AXP2101
	select REGULATOR
	select REGULATOR_VIRTUAL_CONSUMER
	help
	  This driver provides support for the voltage regulators on the
	  AXP2101 PMIC.
endif

if AW_MFD_PMU_EXT

config AW_REGULATOR_PMU_EXT
	tristate "PMU_EXT Power regulator"
	depends on AW_MFD_PMU_EXT
	select REGULATOR
	help
	  This driver provides support for the voltage regulators on the
	  PMU_EXT PMIC.

endif

config AW_REGULATOR_SOC_PMU
	tristate "SOC PMICs Power regulator"
	select AW_MFD_PMU_SOC_MMIO
	select REGULATOR
	help
	  This driver provides support for the voltage regulators on the
	  SOC PMICs.

config AW_REGULATOR_PWM
	tristate "SUNXI PWM voltage regulator"
	depends on PWM
	help
	  This driver supports PWM controlled voltage regulators. PWM
	  duty cycle can increase or decrease the voltage.

config AW_REGULATOR_VIRTUAL_CONSUMER
	tristate "SUNXI VIRTUAL_CONSUMER"
	help
	  This driver supports virtual consumer get the regualtor.

comment "Regulator Functions"

config AW_AXP1530_WORKAROUND_DVM
	bool "AXP1530 SW DVM"
	depends on AW_REGULATOR_PMU_EXT || AW_REGULATOR_AXP2101
	default n
	help
	  Say Y here if you want to enable axp1530 DVM function

comment "Powerkey Drivers"

if AW_MFD_AXP2101

config AW_INPUT_AXP2101_PEK
	tristate "X-POWERS AXP2101 Power Button Driver"
	depends on !UML
	depends on AW_MFD_AXP2101
	select INPUT
	help
	  Say Y here if you want to enable power key reporting via the
	  AXP20X PMIC.

	  To compile this driver as a module, choose M here. The module will
	  be called axp2101-pek.

endif

comment "Power Supply Drivers"

config AW_POWER_SUPPLY_CTRL
	tristate "Allwinner Power Supply Ctrl"
	depends on AW_BSP
	help
	  Allwinner Power Supply Ctrl.

	  This option is of interest only to developers who need to
	  develop on AllWinner SoC.

	  If unsure, say N.

config AW_USB_POWER_CTRL
	tristate "Allwinner Usb Power Ctrl support"
	select EXTCON
	select POWER_SUPPLY
	select AW_POWER_NOTIFIER
	select AW_POWER_SUPPLY_CTRL
	select AW_POWER_DEBUG
	help
	  Allwinner Usb Power Ctrl

	  This option is of interest only to developers who need to
	  develop on AllWinner SoC.

if AW_MFD_AXP2101

config AW_AXP803_POWER
	tristate "AXP803 Power Supply Driver"
	select POWER_SUPPLY
	select AW_POWER_TEMP_CTRL
	help
	  This driver provides support for the power supply features of
	  AXP803 PMIC.

config AW_AXP2202_POWER
	tristate "AXP2202 Power Supply Driver"
	select AW_POWER_TEMP_CTRL
	select AW_USB_POWER_CTRL
	select AW_POWER_DEBUG
	help
	  This driver provides support for the power supply features of
	  AXP2202 PMIC.

config AW_AXP2202_GPIO_POWER
	tristate "AXP2202 Power Virtual ACIN"
	depends on AW_AXP2202_POWER
	help
	  This driver provides support for ACIN function in
	  AXP2202 PMIC.

config AW_AXP22X_POWER
	tristate "AXP22X Power Supply Driver"
	select AW_POWER_TEMP_CTRL
	select POWER_SUPPLY
	help
	  This driver provides support for the power supply features of
	  AXP221/AXP223 PMIC.

config AW_AXP515_POWER
	tristate "AXP515 Power Supply Driver"
	select AW_POWER_TEMP_CTRL
	select AW_USB_POWER_CTRL
	select AW_POWER_DEBUG
	help
	  This driver provides support for the power supply features of
	  AXP515 PMIC.

config AW_AXP515_ACIN_POWER
	tristate "AXP515 Power Virtual ACIN"
	depends on AW_AXP515_POWER
	select POWER_SUPPLY
	help
	  This driver provides support for ACIN function in
	  AXP515 PMIC.

config AW_AXP2101_POWER
	tristate "AXP2101 Power Supply Driver"
	select AW_POWER_TEMP_CTRL
	select POWER_SUPPLY
	help
	  This driver provides support for the power supply features of
	  AXP2101 PMIC.

config AW_AXP517_POWER
	tristate "AXP517 Power Supply Driver"
	select AW_POWER_TEMP_CTRL
	select AW_USB_POWER_CTRL
	select AW_POWER_DEBUG
	help
	  This driver provides support for the power supply features of
	  AXP517 PMIC.

endif

if AW_MFD_BMU_EXT

config AW_ETA6973_POWER
	tristate "ETA6973 Power Supply Driver"
	select POWER_SUPPLY
	help
	  This driver provides support for the power supply features of
	  ETA6973 PMIC.

config AW_AXP519_POWER
	tristate "AXP519 Power Supply Driver"
	select POWER_SUPPLY
	help
	  This driver provides support for the power supply features of
	  AXP519 PMIC.

config AW_AXP2601_POWER
	tristate "AXP2601 Power Supply Driver"
	select AW_POWER_TEMP_CTRL
	select POWER_SUPPLY
	help
	  This driver provides support for the power supply features of
	  AXP2601 PMIC.

config AW_AXP2602_POWER
	tristate "AXP2602 Power Supply Driver"
	select AW_POWER_TEMP_CTRL
	select POWER_SUPPLY
	help
	  This driver provides support for the power supply features of
	  AXP2602 PMIC.

endif

config AW_MULTI_CHARGE_POWER
	tristate "sunxi multi charge Power Supply Driver"
	depends on AW_AXP517_POWER || AW_AXP515_POWER
	select AW_POWER_DEBUG
	help
	  This driver provides support for sunxi multi charge such as:
	  acin & double type-c.

comment "Power Notifier Drivers"

config AW_POWER_NOTIFIER
	tristate "Allwinner Power Notifier support"
	depends on AW_BSP
	help
	  Allwinner Power Notifier.

	  This option is of interest only to developers who need to
	  develop on AllWinner SoC.

	  If unsure, say N.

comment "Power Temp Ctrl Drivers"

config AW_POWER_TEMP_CTRL
	tristate "Allwinner Power Temp Ctrl support"
	depends on AW_BSP
	help
	  Allwinner Power Temp Ctrl.

	  This option is of interest only to developers who need to
	  develop on AllWinner SoC.

if AW_MFD_AXP2101

config AW_AXP8191_TEMP_CTRL
	tristate "AXP8191 Temp Ctrl Drivers"
	depends on AW_BSP
	help
	  This driver provides support for the temp ctrl features of
	  AXP8191 PMIC.

endif

comment "TYPE-C Ctrl Drivers"

config AW_TYPEC_HUSB311
	tristate "Hynetek HUSB311 Type-C chip driver"
	select I2C
	select TYPEC_TCPM
	select TYPEC_TCPCI
	select USB_SUNXI_TYPEC
	select AW_POWER_NOTIFIER
	help
	  Hynetek HUSB311 Type-C chip driver that works with
	  Type-C Port Controller Manager to provide USB PD and USB
	  Type-C functionalities.

	  If unsure, say N.

config AW_TYPEC_AXP517
	tristate "Allwinner AXP517 Type-C chip driver"
	depends on AW_MFD_AXP2101
	select TYPEC_TCPM
	select USB_SUNXI_TYPEC
	select AW_POWER_NOTIFIER
	help
	  Allwinner AXP517 Type-C chip driver that works with
	  Type-C Port Controller Manager to provide USB PD and USB
	  Type-C functionalities.

	  If unsure, say N.

config AW_TYPEC_CC_LOGIC
	tristate "Allwinner PMIC USB Type-C Port Manager Driver Support"
	depends on AW_MFD_AXP2101
	select AW_POWER_DEBUG
	help
	  Allwinner Type-C Port Manager Driver Based on PMIC.
	  This Driver Can Conform to the Requirements of USB Type-C Functional Test Specification,
	  And Test Platform is Teledyne LeCroy - Voyager M310e.

endmenu
