regulator: rk8xx: Add CONFIG_SPL_REGULATOR_RK8XX

Allows use of the regulator functions of the RK8XX PMIC in SPL, which is
necessary to support the functionality of the Rockchip IO-domain driver
on relevant platforms.

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Justin Klaassen
2025-05-23 16:53:39 +00:00
committed by Kever Yang
parent 83b1d04765
commit f8f865ec0b
2 changed files with 11 additions and 6 deletions

View File

@@ -264,6 +264,15 @@ config REGULATOR_RK8XX
by the PMIC device. This driver is controlled by a device tree node by the PMIC device. This driver is controlled by a device tree node
which includes voltage limits. which includes voltage limits.
config SPL_REGULATOR_RK8XX
bool "Enable driver for RK8XX regulators in SPL"
depends on SPL_DM_REGULATOR && SPL_PMIC_RK8XX
help
Enable support for the regulator functions of the RK8XX PMIC in SPL. The
driver implements get/set api for the various BUCKS and LDOs supported
by the PMIC device. This driver is controlled by a device tree node
which includes voltage limits.
config DM_REGULATOR_S2MPS11 config DM_REGULATOR_S2MPS11
bool "Enable driver for S2MPS11 regulator" bool "Enable driver for S2MPS11 regulator"
depends on DM_REGULATOR && PMIC_S2MPS11 depends on DM_REGULATOR && PMIC_S2MPS11

View File

@@ -16,10 +16,6 @@
#include <power/pmic.h> #include <power/pmic.h>
#include <power/regulator.h> #include <power/regulator.h>
#ifndef CONFIG_XPL_BUILD
#define ENABLE_DRIVER
#endif
/* Not used or exisit register and configure */ /* Not used or exisit register and configure */
#define NA 0xff #define NA 0xff
@@ -202,7 +198,7 @@ static const struct rk8xx_reg_info rk818_buck[] = {
{ 1800000, 100000, REG_BUCK4_ON_VSEL, REG_BUCK4_SLP_VSEL, REG_BUCK4_CONFIG, RK818_BUCK4_VSEL_MASK, 0x00, 0x1f }, { 1800000, 100000, REG_BUCK4_ON_VSEL, REG_BUCK4_SLP_VSEL, REG_BUCK4_CONFIG, RK818_BUCK4_VSEL_MASK, 0x00, 0x1f },
}; };
#ifdef ENABLE_DRIVER #if CONFIG_IS_ENABLED(REGULATOR_RK8XX)
static const struct rk8xx_reg_info rk806_nldo[] = { static const struct rk8xx_reg_info rk806_nldo[] = {
/* nldo 1 */ /* nldo 1 */
{ 500000, 12500, RK806_NLDO_ON_VSEL(1), RK806_NLDO_SLP_VSEL(1), NA, RK806_NLDO_VSEL_MASK, 0x00, 0xe7}, { 500000, 12500, RK806_NLDO_ON_VSEL(1), RK806_NLDO_SLP_VSEL(1), NA, RK806_NLDO_VSEL_MASK, 0x00, 0xe7},
@@ -454,7 +450,7 @@ static int _buck_set_enable(struct udevice *pmic, int buck, bool enable)
return ret; return ret;
} }
#ifdef ENABLE_DRIVER #if CONFIG_IS_ENABLED(REGULATOR_RK8XX)
static int _buck_set_suspend_value(struct udevice *pmic, int buck, int uvolt) static int _buck_set_suspend_value(struct udevice *pmic, int buck, int uvolt)
{ {
const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck, uvolt); const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck, uvolt);