diff options
Diffstat (limited to 'drivers/power/pmic')
-rw-r--r-- | drivers/power/pmic/Kconfig | 6 | ||||
-rw-r--r-- | drivers/power/pmic/Makefile | 2 | ||||
-rw-r--r-- | drivers/power/pmic/stpmic1.c | 62 |
3 files changed, 35 insertions, 35 deletions
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index 8cf60ebcf3..b0cd260354 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/power/pmic/Kconfig @@ -231,10 +231,10 @@ config DM_PMIC_TPS65910 DC-DC converter, 8 LDOs and a RTC. This driver binds the SMPS and LDO pmic children. -config PMIC_STPMU1 - bool "Enable support for STMicroelectronics STPMU1 PMIC" +config PMIC_STPMIC1 + bool "Enable support for STMicroelectronics STPMIC1 PMIC" depends on DM_PMIC && DM_I2C ---help--- - The STPMU1 PMIC provides 4 BUCKs, 6 LDOs, 1 VREF and 2 power switches. + The STPMIC1 PMIC provides 4 BUCKs, 6 LDOs, 1 VREF and 2 power switches. It is accessed via an I2C interface. The device is used with STM32MP1 SoCs. This driver implements register read/write operations. diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile index 147ac76366..ce250cb155 100644 --- a/drivers/power/pmic/Makefile +++ b/drivers/power/pmic/Makefile @@ -23,7 +23,7 @@ obj-$(CONFIG_DM_PMIC_TPS65910) += pmic_tps65910_dm.o obj-$(CONFIG_$(SPL_)PMIC_PALMAS) += palmas.o obj-$(CONFIG_$(SPL_)PMIC_LP873X) += lp873x.o obj-$(CONFIG_$(SPL_)PMIC_LP87565) += lp87565.o -obj-$(CONFIG_PMIC_STPMU1) += stpmic1.o +obj-$(CONFIG_PMIC_STPMIC1) += stpmic1.o obj-$(CONFIG_POWER_LTC3676) += pmic_ltc3676.o obj-$(CONFIG_POWER_MAX77696) += pmic_max77696.o diff --git a/drivers/power/pmic/stpmic1.c b/drivers/power/pmic/stpmic1.c index 157ce8bfb6..25450ebd42 100644 --- a/drivers/power/pmic/stpmic1.c +++ b/drivers/power/pmic/stpmic1.c @@ -10,26 +10,26 @@ #include <power/pmic.h> #include <power/stpmic1.h> -#define STMPU1_NUM_OF_REGS 0x100 - -#ifndef CONFIG_SPL_BUILD -static const struct pmic_child_info stpmu1_children_info[] = { - { .prefix = "ldo", .driver = "stpmu1_ldo" }, - { .prefix = "buck", .driver = "stpmu1_buck" }, - { .prefix = "vref_ddr", .driver = "stpmu1_vref_ddr" }, - { .prefix = "pwr_sw", .driver = "stpmu1_pwr_sw" }, - { .prefix = "boost", .driver = "stpmu1_boost" }, +#define STPMIC1_NUM_OF_REGS 0x100 + +#if CONFIG_IS_ENABLED(DM_REGULATOR) +static const struct pmic_child_info stpmic1_children_info[] = { + { .prefix = "ldo", .driver = "stpmic1_ldo" }, + { .prefix = "buck", .driver = "stpmic1_buck" }, + { .prefix = "vref_ddr", .driver = "stpmic1_vref_ddr" }, + { .prefix = "pwr_sw", .driver = "stpmic1_pwr_sw" }, + { .prefix = "boost", .driver = "stpmic1_boost" }, { }, }; -#endif /* CONFIG_SPL_BUILD */ +#endif /* DM_REGULATOR */ -static int stpmu1_reg_count(struct udevice *dev) +static int stpmic1_reg_count(struct udevice *dev) { - return STMPU1_NUM_OF_REGS; + return STPMIC1_NUM_OF_REGS; } -static int stpmu1_write(struct udevice *dev, uint reg, const uint8_t *buff, - int len) +static int stpmic1_write(struct udevice *dev, uint reg, const uint8_t *buff, + int len) { int ret; @@ -41,7 +41,7 @@ static int stpmu1_write(struct udevice *dev, uint reg, const uint8_t *buff, return ret; } -static int stpmu1_read(struct udevice *dev, uint reg, uint8_t *buff, int len) +static int stpmic1_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { int ret; @@ -53,43 +53,43 @@ static int stpmu1_read(struct udevice *dev, uint reg, uint8_t *buff, int len) return ret; } -static int stpmu1_bind(struct udevice *dev) +static int stpmic1_bind(struct udevice *dev) { -#ifndef CONFIG_SPL_BUILD +#if CONFIG_IS_ENABLED(DM_REGULATOR) ofnode regulators_node; int children; regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { - dev_dbg(dev, "regulators subnode not found!\n"); + dev_dbg(dev, "regulators subnode not found!"); return -ENXIO; } dev_dbg(dev, "found regulators subnode\n"); children = pmic_bind_children(dev, regulators_node, - stpmu1_children_info); + stpmic1_children_info); if (!children) dev_dbg(dev, "no child found\n"); -#endif /* CONFIG_SPL_BUILD */ +#endif /* DM_REGULATOR */ return 0; } -static struct dm_pmic_ops stpmu1_ops = { - .reg_count = stpmu1_reg_count, - .read = stpmu1_read, - .write = stpmu1_write, +static struct dm_pmic_ops stpmic1_ops = { + .reg_count = stpmic1_reg_count, + .read = stpmic1_read, + .write = stpmic1_write, }; -static const struct udevice_id stpmu1_ids[] = { - { .compatible = "st,stpmu1" }, +static const struct udevice_id stpmic1_ids[] = { + { .compatible = "st,stpmic1" }, { } }; -U_BOOT_DRIVER(pmic_stpmu1) = { - .name = "stpmu1_pmic", +U_BOOT_DRIVER(pmic_stpmic1) = { + .name = "stpmic1_pmic", .id = UCLASS_PMIC, - .of_match = stpmu1_ids, - .bind = stpmu1_bind, - .ops = &stpmu1_ops, + .of_match = stpmic1_ids, + .bind = stpmic1_bind, + .ops = &stpmic1_ops, }; |