diff options
Diffstat (limited to 'arch/arm/mach-stm32mp/pwr_regulator.c')
-rw-r--r-- | arch/arm/mach-stm32mp/pwr_regulator.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/arm/mach-stm32mp/pwr_regulator.c b/arch/arm/mach-stm32mp/pwr_regulator.c index 4559ef599d..b52e1e85d5 100644 --- a/arch/arm/mach-stm32mp/pwr_regulator.c +++ b/arch/arm/mach-stm32mp/pwr_regulator.c @@ -6,8 +6,8 @@ #include <common.h> #include <dm.h> #include <errno.h> -#include <regmap.h> #include <syscon.h> +#include <asm/io.h> #include <dm/device_compat.h> #include <linux/err.h> #include <power/pmic.h> @@ -28,7 +28,7 @@ struct stm32mp_pwr_reg_info { }; struct stm32mp_pwr_priv { - struct regmap *regmap; + fdt_addr_t base; }; static int stm32mp_pwr_write(struct udevice *dev, uint reg, @@ -40,7 +40,9 @@ static int stm32mp_pwr_write(struct udevice *dev, uint reg, if (len != 4) return -EINVAL; - return regmap_write(priv->regmap, STM32MP_PWR_CR3, val); + writel(val, priv->base + STM32MP_PWR_CR3); + + return 0; } static int stm32mp_pwr_read(struct udevice *dev, uint reg, uint8_t *buff, @@ -51,21 +53,18 @@ static int stm32mp_pwr_read(struct udevice *dev, uint reg, uint8_t *buff, if (len != 4) return -EINVAL; - return regmap_read(priv->regmap, STM32MP_PWR_CR3, (u32 *)buff); + *(u32 *)buff = readl(priv->base + STM32MP_PWR_CR3); + + return 0; } static int stm32mp_pwr_ofdata_to_platdata(struct udevice *dev) { struct stm32mp_pwr_priv *priv = dev_get_priv(dev); - struct regmap *regmap; - regmap = syscon_get_regmap_by_driver_data(STM32MP_SYSCON_PWR); - if (IS_ERR(regmap)) { - pr_err("%s: unable to find regmap (%ld)\n", __func__, - PTR_ERR(regmap)); - return PTR_ERR(regmap); - } - priv->regmap = regmap; + priv->base = dev_read_addr(dev); + if (priv->base == FDT_ADDR_T_NONE) + return -EINVAL; return 0; } |