diff options
author | Tom Rini <trini@konsulko.com> | 2021-01-05 22:34:43 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-05 22:34:43 -0500 |
commit | b11f634b1c1be6ab419758c6596c673445e5ac70 (patch) | |
tree | 2329e1ff53c6c543e01d84b7901c53621ad8b7f9 /drivers/power | |
parent | 720620e6916ba40b9a173bb07706d2c73f3c23e7 (diff) | |
parent | 970349a96dac3ad46c33851b1a773bfe3f1d4b33 (diff) | |
download | u-boot-b11f634b1c1be6ab419758c6596c673445e5ac70.tar.gz |
Merge tag 'dm-pull-5jan21' of git://git.denx.de/u-boot-dm into nextWIP/05Jan2021-next
Driver model: make some udevice fields private
Driver model: Rename U_BOOT_DEVICE et al.
dtoc: Tidy up and add more tests
ns16550 code clean-up
x86 and sandbox minor fixes for of-platdata
dtoc prepration for adding build-time instantiation
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/acpi_pmc/acpi-pmc-uclass.c | 4 | ||||
-rw-r--r-- | drivers/power/domain/meson-ee-pwrc.c | 4 | ||||
-rw-r--r-- | drivers/power/domain/meson-gx-pwrc-vpu.c | 4 | ||||
-rw-r--r-- | drivers/power/pmic/rk8xx.c | 2 | ||||
-rw-r--r-- | drivers/power/regulator/da9063.c | 24 | ||||
-rw-r--r-- | drivers/power/regulator/pbias_regulator.c | 6 |
6 files changed, 24 insertions, 20 deletions
diff --git a/drivers/power/acpi_pmc/acpi-pmc-uclass.c b/drivers/power/acpi_pmc/acpi-pmc-uclass.c index 32a2836f0b..34446a34e6 100644 --- a/drivers/power/acpi_pmc/acpi-pmc-uclass.c +++ b/drivers/power/acpi_pmc/acpi-pmc-uclass.c @@ -8,6 +8,7 @@ #include <common.h> #include <dm.h> #include <log.h> +#include <spl.h> #include <acpi/acpi_s3.h> #ifdef CONFIG_X86 #include <asm/intel_pinctrl.h> @@ -60,7 +61,8 @@ int pmc_gpe_init(struct udevice *dev) * are different and if they aren't, use the reset values. */ if (dw[0] == dw[1] || dw[1] == dw[2]) { - log_info("PMC: Using default GPE route"); + if (spl_phase() > PHASE_TPL) + log_info("PMC: Using default GPE route"); gpio_cfg = readl(upriv->gpe_cfg); for (i = 0; i < upriv->gpe0_count; i++) dw[i] = gpio_cfg >> gpe0_shift(upriv, i); diff --git a/drivers/power/domain/meson-ee-pwrc.c b/drivers/power/domain/meson-ee-pwrc.c index 2e7ab67128..ef8274ce96 100644 --- a/drivers/power/domain/meson-ee-pwrc.c +++ b/drivers/power/domain/meson-ee-pwrc.c @@ -397,11 +397,11 @@ static int meson_ee_pwrc_probe(struct udevice *dev) if (!priv->data) return -EINVAL; - priv->regmap_hhi = syscon_node_to_regmap(dev_get_parent(dev)->node); + priv->regmap_hhi = syscon_node_to_regmap(dev_ofnode(dev_get_parent(dev))); if (IS_ERR(priv->regmap_hhi)) return PTR_ERR(priv->regmap_hhi); - ret = ofnode_read_u32(dev->node, "amlogic,ao-sysctrl", + ret = ofnode_read_u32(dev_ofnode(dev), "amlogic,ao-sysctrl", &ao_phandle); if (ret) return ret; diff --git a/drivers/power/domain/meson-gx-pwrc-vpu.c b/drivers/power/domain/meson-gx-pwrc-vpu.c index 40947c66f3..eb94af2cf8 100644 --- a/drivers/power/domain/meson-gx-pwrc-vpu.c +++ b/drivers/power/domain/meson-gx-pwrc-vpu.c @@ -300,11 +300,11 @@ static int meson_gx_pwrc_vpu_probe(struct udevice *dev) ofnode hhi_node; int ret; - priv->regmap_ao = syscon_node_to_regmap(dev_get_parent(dev)->node); + priv->regmap_ao = syscon_node_to_regmap(dev_ofnode(dev_get_parent(dev))); if (IS_ERR(priv->regmap_ao)) return PTR_ERR(priv->regmap_ao); - ret = ofnode_read_u32(dev->node, "amlogic,hhi-sysctrl", + ret = ofnode_read_u32(dev_ofnode(dev), "amlogic,hhi-sysctrl", &hhi_phandle); if (ret) return ret; diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c index 2f547a314d..5f442fea68 100644 --- a/drivers/power/pmic/rk8xx.c +++ b/drivers/power/pmic/rk8xx.c @@ -195,4 +195,4 @@ U_BOOT_DRIVER(rockchip_rk805) = { .ops = &rk8xx_ops, }; -U_BOOT_DRIVER_ALIAS(rockchip_rk805, rockchip_rk808) +DM_DRIVER_ALIAS(rockchip_rk805, rockchip_rk808) diff --git a/drivers/power/regulator/da9063.c b/drivers/power/regulator/da9063.c index 32be59e49e..8df1abcf78 100644 --- a/drivers/power/regulator/da9063.c +++ b/drivers/power/regulator/da9063.c @@ -135,7 +135,7 @@ static const struct da9063_reg_info da9063_buck_info[] = { static int da9063_get_enable(struct udevice *dev) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; int ret; @@ -148,7 +148,7 @@ static int da9063_get_enable(struct udevice *dev) static int da9063_set_enable(struct udevice *dev, bool enable) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; return pmic_clrsetbits(dev->parent, info->en_reg, @@ -157,7 +157,7 @@ static int da9063_set_enable(struct udevice *dev, bool enable) static int da9063_get_voltage(struct udevice *dev) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; int ret; @@ -170,7 +170,7 @@ static int da9063_get_voltage(struct udevice *dev) static int da9063_set_voltage(struct udevice *dev, int uV) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; uint sel; @@ -198,7 +198,7 @@ static const struct dm_regulator_mode static int ldo_get_mode(struct udevice *dev) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; int val; @@ -214,7 +214,7 @@ static int ldo_get_mode(struct udevice *dev) static int ldo_set_mode(struct udevice *dev, int mode_id) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; const struct dm_regulator_mode *mode; @@ -230,7 +230,7 @@ static int ldo_set_mode(struct udevice *dev, int mode_id) static int buck_get_mode(struct udevice *dev) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; int i; int val; @@ -261,7 +261,7 @@ static int buck_get_mode(struct udevice *dev) static int buck_set_mode(struct udevice *dev, int mode_id) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; const struct dm_regulator_mode *mode; @@ -277,7 +277,7 @@ static int buck_set_mode(struct udevice *dev, int mode_id) static int buck_get_current_limit(struct udevice *dev) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; int val; @@ -293,7 +293,7 @@ static int buck_get_current_limit(struct udevice *dev) static int buck_set_current_limit(struct udevice *dev, int uA) { - const struct da9063_priv *priv = dev->priv; + const struct da9063_priv *priv = dev_get_priv(dev); const struct da9063_reg_info *info = priv->reg_info; int val; @@ -310,7 +310,7 @@ static int buck_set_current_limit(struct udevice *dev, int uA) static int da9063_ldo_probe(struct udevice *dev) { struct dm_regulator_uclass_plat *uc_pdata; - struct da9063_priv *priv = dev->priv; + struct da9063_priv *priv = dev_get_priv(dev); /* LDOs are named numerically in DT so can directly index */ if (dev->driver_data < 1 || @@ -329,7 +329,7 @@ static int da9063_ldo_probe(struct udevice *dev) static int da9063_buck_probe(struct udevice *dev) { struct dm_regulator_uclass_plat *uc_pdata; - struct da9063_priv *priv = dev->priv; + struct da9063_priv *priv = dev_get_priv(dev); int i; /* Bucks have names rather than numbers so need to match with DT */ diff --git a/drivers/power/regulator/pbias_regulator.c b/drivers/power/regulator/pbias_regulator.c index c3df156749..5bf186e4d4 100644 --- a/drivers/power/regulator/pbias_regulator.c +++ b/drivers/power/regulator/pbias_regulator.c @@ -16,6 +16,7 @@ #include <syscon.h> #include <linux/bitops.h> #include <linux/ioport.h> +#include <dm/device-internal.h> #include <dm/read.h> #ifdef CONFIG_MMC_OMAP36XX_PINS #include <asm/arch/sys_proto.h> @@ -102,7 +103,8 @@ static int pbias_bind(struct udevice *dev) { int children; - children = pmic_bind_children(dev, dev->node, pmic_children_info); + children = pmic_bind_children(dev, dev_ofnode(dev), + pmic_children_info); if (!children) debug("%s: %s - no child found\n", __func__, dev->name); @@ -208,7 +210,7 @@ static int pbias_regulator_probe(struct udevice *dev) } uc_pdata->type = REGULATOR_TYPE_OTHER; - dev->priv = (void *)*p; + dev_set_priv(dev, (void *)*p); return 0; } |