diff options
Diffstat (limited to 'drivers/power')
20 files changed, 49 insertions, 15 deletions
diff --git a/drivers/power/acpi_pmc/pmc_emul.c b/drivers/power/acpi_pmc/pmc_emul.c index 15cc7acaf3..dfff335e54 100644 --- a/drivers/power/acpi_pmc/pmc_emul.c +++ b/drivers/power/acpi_pmc/pmc_emul.c @@ -42,7 +42,7 @@ struct pmc_emul_priv { u8 regs[MEMMAP_SIZE]; }; -static int sandbox_pmc_emul_read_config(struct udevice *emul, uint offset, +static int sandbox_pmc_emul_read_config(const struct udevice *emul, uint offset, ulong *valuep, enum pci_size_t size) { struct pmc_emul_platdata *plat = dev_get_platdata(emul); diff --git a/drivers/power/domain/bcm6328-power-domain.c b/drivers/power/domain/bcm6328-power-domain.c index a90b2c83df..a6426bee27 100644 --- a/drivers/power/domain/bcm6328-power-domain.c +++ b/drivers/power/domain/bcm6328-power-domain.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <asm/io.h> @@ -62,7 +63,7 @@ static const struct udevice_id bcm6328_power_domain_ids[] = { }; struct power_domain_ops bcm6328_power_domain_ops = { - .free = bcm6328_power_domain_free, + .rfree = bcm6328_power_domain_free, .off = bcm6328_power_domain_off, .on = bcm6328_power_domain_on, .request = bcm6328_power_domain_request, diff --git a/drivers/power/domain/imx8-power-domain-legacy.c b/drivers/power/domain/imx8-power-domain-legacy.c index d51dbaa6c0..6f01a60b34 100644 --- a/drivers/power/domain/imx8-power-domain-legacy.c +++ b/drivers/power/domain/imx8-power-domain-legacy.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <asm/io.h> #include <asm/arch/power-domain.h> @@ -296,7 +297,7 @@ static const struct udevice_id imx8_power_domain_ids[] = { struct power_domain_ops imx8_power_domain_ops = { .request = imx8_power_domain_request, - .free = imx8_power_domain_free, + .rfree = imx8_power_domain_free, .on = imx8_power_domain_on, .off = imx8_power_domain_off, .of_xlate = imx8_power_domain_of_xlate, diff --git a/drivers/power/domain/imx8-power-domain.c b/drivers/power/domain/imx8-power-domain.c index aa768365b4..571146e19d 100644 --- a/drivers/power/domain/imx8-power-domain.c +++ b/drivers/power/domain/imx8-power-domain.c @@ -6,6 +6,7 @@ #define DEBUG #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <asm/arch/power-domain.h> #include <asm/arch/sci/sci.h> @@ -73,7 +74,7 @@ static const struct udevice_id imx8_power_domain_ids[] = { struct power_domain_ops imx8_power_domain_ops_v2 = { .request = imx8_power_domain_request, - .free = imx8_power_domain_free, + .rfree = imx8_power_domain_free, .on = imx8_power_domain_on, .off = imx8_power_domain_off, }; diff --git a/drivers/power/domain/imx8m-power-domain.c b/drivers/power/domain/imx8m-power-domain.c index 40ece9ee3f..5b6467cda7 100644 --- a/drivers/power/domain/imx8m-power-domain.c +++ b/drivers/power/domain/imx8m-power-domain.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <asm/io.h> #include <asm/arch/power-domain.h> @@ -121,7 +122,7 @@ static const struct udevice_id imx8m_power_domain_ids[] = { struct power_domain_ops imx8m_power_domain_ops = { .request = imx8m_power_domain_request, - .free = imx8m_power_domain_free, + .rfree = imx8m_power_domain_free, .on = imx8m_power_domain_on, .off = imx8m_power_domain_off, .of_xlate = imx8m_power_domain_of_xlate, diff --git a/drivers/power/domain/meson-ee-pwrc.c b/drivers/power/domain/meson-ee-pwrc.c index 21d4c9d4dd..7082c80bfa 100644 --- a/drivers/power/domain/meson-ee-pwrc.c +++ b/drivers/power/domain/meson-ee-pwrc.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <regmap.h> #include <syscon.h> @@ -13,6 +14,7 @@ #include <clk.h> #include <dt-bindings/power/meson-g12a-power.h> #include <dt-bindings/power/meson-sm1-power.h> +#include <linux/err.h> /* AO Offsets */ @@ -352,7 +354,7 @@ static int meson_ee_pwrc_of_xlate(struct power_domain *power_domain, } struct power_domain_ops meson_ee_pwrc_ops = { - .free = meson_ee_pwrc_free, + .rfree = meson_ee_pwrc_free, .off = meson_ee_pwrc_off, .on = meson_ee_pwrc_on, .request = meson_ee_pwrc_request, diff --git a/drivers/power/domain/meson-gx-pwrc-vpu.c b/drivers/power/domain/meson-gx-pwrc-vpu.c index f44e33bacb..12cdfcdd1f 100644 --- a/drivers/power/domain/meson-gx-pwrc-vpu.c +++ b/drivers/power/domain/meson-gx-pwrc-vpu.c @@ -8,11 +8,13 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <regmap.h> #include <syscon.h> #include <reset.h> #include <clk.h> +#include <linux/err.h> enum { VPU_PWRC_COMPATIBLE_GX = 0, @@ -269,7 +271,7 @@ static int meson_pwrc_vpu_of_xlate(struct power_domain *power_domain, } struct power_domain_ops meson_gx_pwrc_vpu_ops = { - .free = meson_pwrc_vpu_free, + .rfree = meson_pwrc_vpu_free, .off = meson_pwrc_vpu_off, .on = meson_pwrc_vpu_on, .request = meson_pwrc_vpu_request, diff --git a/drivers/power/domain/mtk-power-domain.c b/drivers/power/domain/mtk-power-domain.c index 0bf8a16447..3ff7ca1bef 100644 --- a/drivers/power/domain/mtk-power-domain.c +++ b/drivers/power/domain/mtk-power-domain.c @@ -7,11 +7,13 @@ #include <clk.h> #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <regmap.h> #include <syscon.h> #include <asm/io.h> #include <asm/processor.h> +#include <linux/err.h> #include <linux/iopoll.h> #include <dt-bindings/power/mt7623-power.h> @@ -396,7 +398,7 @@ static const struct udevice_id mtk_power_domain_ids[] = { }; struct power_domain_ops mtk_power_domain_ops = { - .free = scpsys_power_free, + .rfree = scpsys_power_free, .off = scpsys_power_off, .on = scpsys_power_on, .request = scpsys_power_request, diff --git a/drivers/power/domain/power-domain-uclass.c b/drivers/power/domain/power-domain-uclass.c index 80df5aff50..d9c623b56e 100644 --- a/drivers/power/domain/power-domain-uclass.c +++ b/drivers/power/domain/power-domain-uclass.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain.h> #include <power-domain-uclass.h> #include <dm/device-internal.h> @@ -87,7 +88,7 @@ int power_domain_free(struct power_domain *power_domain) debug("%s(power_domain=%p)\n", __func__, power_domain); - return ops->free(power_domain); + return ops->rfree(power_domain); } int power_domain_on(struct power_domain *power_domain) diff --git a/drivers/power/domain/sandbox-power-domain-test.c b/drivers/power/domain/sandbox-power-domain-test.c index 148b6b1707..2191a94146 100644 --- a/drivers/power/domain/sandbox-power-domain-test.c +++ b/drivers/power/domain/sandbox-power-domain-test.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain.h> #include <asm/io.h> #include <asm/power-domain.h> diff --git a/drivers/power/domain/sandbox-power-domain.c b/drivers/power/domain/sandbox-power-domain.c index 74db2eba7e..3a834a9f1e 100644 --- a/drivers/power/domain/sandbox-power-domain.c +++ b/drivers/power/domain/sandbox-power-domain.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <power-domain-uclass.h> #include <asm/io.h> #include <asm/power-domain.h> @@ -75,7 +76,7 @@ static const struct udevice_id sandbox_power_domain_ids[] = { struct power_domain_ops sandbox_power_domain_ops = { .request = sandbox_power_domain_request, - .free = sandbox_power_domain_free, + .rfree = sandbox_power_domain_free, .on = sandbox_power_domain_on, .off = sandbox_power_domain_off, }; diff --git a/drivers/power/domain/tegra186-power-domain.c b/drivers/power/domain/tegra186-power-domain.c index f344558227..e87244197f 100644 --- a/drivers/power/domain/tegra186-power-domain.c +++ b/drivers/power/domain/tegra186-power-domain.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <malloc.h> #include <misc.h> #include <power-domain-uclass.h> #include <asm/arch-tegra/bpmp_abi.h> @@ -71,7 +72,7 @@ static int tegra186_power_domain_off(struct power_domain *power_domain) struct power_domain_ops tegra186_power_domain_ops = { .request = tegra186_power_domain_request, - .free = tegra186_power_domain_free, + .rfree = tegra186_power_domain_free, .on = tegra186_power_domain_on, .off = tegra186_power_domain_off, }; diff --git a/drivers/power/domain/ti-sci-power-domain.c b/drivers/power/domain/ti-sci-power-domain.c index 4c4351d2d9..a5866703ae 100644 --- a/drivers/power/domain/ti-sci-power-domain.c +++ b/drivers/power/domain/ti-sci-power-domain.c @@ -11,7 +11,10 @@ #include <common.h> #include <dm.h> #include <errno.h> +#include <malloc.h> #include <power-domain-uclass.h> +#include <dm/device_compat.h> +#include <linux/err.h> #include <linux/soc/ti/ti_sci_protocol.h> #include <dt-bindings/soc/ti,sci_pm_domain.h> @@ -120,7 +123,7 @@ static const struct udevice_id ti_sci_power_domain_of_match[] = { static struct power_domain_ops ti_sci_power_domain_ops = { .request = ti_sci_power_domain_request, - .free = ti_sci_power_domain_free, + .rfree = ti_sci_power_domain_free, .on = ti_sci_power_domain_on, .off = ti_sci_power_domain_off, .of_xlate = ti_sci_power_domain_of_xlate, diff --git a/drivers/power/pmic/fan53555.c b/drivers/power/pmic/fan53555.c index 11304d2146..a5f855ce2a 100644 --- a/drivers/power/pmic/fan53555.c +++ b/drivers/power/pmic/fan53555.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> #include <dm/device-internal.h> +#include <dm/device_compat.h> #include <dm/lists.h> #include <i2c.h> #include <power/fan53555.h> diff --git a/drivers/power/pmic/i2c_pmic_emul.c b/drivers/power/pmic/i2c_pmic_emul.c index 80efc0265d..86d7b89b1f 100644 --- a/drivers/power/pmic/i2c_pmic_emul.c +++ b/drivers/power/pmic/i2c_pmic_emul.c @@ -8,6 +8,7 @@ #include <errno.h> #include <dm.h> #include <i2c.h> +#include <malloc.h> #include <power/pmic.h> #include <power/sandbox_pmic.h> @@ -105,12 +106,21 @@ static int sandbox_i2c_pmic_ofdata_to_platdata(struct udevice *emul) { struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul); struct udevice *pmic_dev = i2c_emul_get_device(emul); - struct uc_pmic_priv *priv = dev_get_uclass_priv(pmic_dev); - const u8 *reg_defaults; debug("%s:%d Setting PMIC default registers\n", __func__, __LINE__); plat->reg_count = pmic_reg_count(pmic_dev); - plat->trans_len = priv->trans_len; + + return 0; +} + +static int sandbox_i2c_pmic_probe(struct udevice *emul) +{ + struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul); + struct udevice *pmic_dev = i2c_emul_get_device(emul); + struct uc_pmic_priv *upriv = dev_get_uclass_priv(pmic_dev); + const u8 *reg_defaults; + + plat->trans_len = upriv->trans_len; plat->buf_size = plat->reg_count * plat->trans_len; plat->reg = calloc(1, plat->buf_size); @@ -149,6 +159,7 @@ U_BOOT_DRIVER(sandbox_i2c_pmic_emul) = { .id = UCLASS_I2C_EMUL, .of_match = sandbox_i2c_pmic_ids, .ofdata_to_platdata = sandbox_i2c_pmic_ofdata_to_platdata, + .probe = sandbox_i2c_pmic_probe, .platdata_auto_alloc_size = sizeof(struct sandbox_i2c_pmic_plat_data), .ops = &sandbox_i2c_pmic_emul_ops, }; diff --git a/drivers/power/pmic/stpmic1.c b/drivers/power/pmic/stpmic1.c index 2297af4157..2c85410b1b 100644 --- a/drivers/power/pmic/stpmic1.c +++ b/drivers/power/pmic/stpmic1.c @@ -11,6 +11,7 @@ #include <sysreset.h> #include <time.h> #include <dm/device.h> +#include <dm/device_compat.h> #include <dm/lists.h> #include <power/pmic.h> #include <power/stpmic1.h> diff --git a/drivers/power/regulator/pbias_regulator.c b/drivers/power/regulator/pbias_regulator.c index 88dc9f273a..60255eeab0 100644 --- a/drivers/power/regulator/pbias_regulator.c +++ b/drivers/power/regulator/pbias_regulator.c @@ -7,6 +7,7 @@ #include <common.h> #include <errno.h> #include <dm.h> +#include <linux/err.h> #include <power/pmic.h> #include <power/regulator.h> #include <regmap.h> diff --git a/drivers/power/regulator/pwm_regulator.c b/drivers/power/regulator/pwm_regulator.c index cd05c9b603..4030144dd3 100644 --- a/drivers/power/regulator/pwm_regulator.c +++ b/drivers/power/regulator/pwm_regulator.c @@ -11,6 +11,7 @@ #include <dm.h> #include <errno.h> #include <pwm.h> +#include <dm/device_compat.h> #include <power/regulator.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/drivers/power/regulator/stm32-vrefbuf.c b/drivers/power/regulator/stm32-vrefbuf.c index 645528e84e..08a10f05b4 100644 --- a/drivers/power/regulator/stm32-vrefbuf.c +++ b/drivers/power/regulator/stm32-vrefbuf.c @@ -10,6 +10,7 @@ #include <clk.h> #include <dm.h> #include <asm/io.h> +#include <dm/device_compat.h> #include <linux/iopoll.h> #include <linux/kernel.h> #include <power/regulator.h> diff --git a/drivers/power/regulator/tps62360_regulator.c b/drivers/power/regulator/tps62360_regulator.c index 2c076c0db5..ce54495490 100644 --- a/drivers/power/regulator/tps62360_regulator.c +++ b/drivers/power/regulator/tps62360_regulator.c @@ -7,6 +7,7 @@ #include <common.h> #include <dm.h> #include <i2c.h> +#include <dm/device_compat.h> #include <power/regulator.h> #define TPS62360_REG_SET0 0 |