summaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)Author
2017-09-01power: as3722: fix as3722_ldo_enable for ldo index bigger than 7Marcel Ziswiler
Fix as3722_ldo_enable() functions for LDOs with an index > 7. Turns out there are actually two separate AS3722_LDO_CONTROL registers AS3722_LDO_CONTROL0 and AS3722_LDO_CONTROL1. Actually make use of both. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2016-10-24power: twl6030: fix code refactoringNicolae Rosia
Commit a85362fb3e1fc7833723accddbbae431091d06b8 refactored the code but the register read ended up in the wrong if branch. Currently, the else branch checks a variable which is always 0. Signed-off-by: Nicolae Rosia <nicolae_rosia@mentor.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-13libfdt: Sync fdt_for_each_subnode() with upstreamSimon Glass
The signature for this macro has changed. Bring in the upstream version and adjust U-Boot's usages to suit. Signed-off-by: Simon Glass <sjg@chromium.org> Update to drivers/power/pmic/palmas.c: Signed-off-by: Keerthy <j-keerthy@ti.com> Change-Id: I6cc9021339bfe686f9df21d61a1095ca2b3776e8
2016-10-12Merge git://git.denx.de/u-boot-dmTom Rini
2016-10-11power: regulator: lp873x: Add regulator supportKeerthy
The driver provides regulator set/get voltage enable/disable functions for lp873x family of PMICs. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-11power: pmic: lp873x: Add the base pmic supportKeerthy
Add support to bind the regulators/child nodes with the pmic. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-11power: regulator: palmas: Add regulator supportKeerthy
The driver provides regulator set/get voltage enable/disable functions for palmas family of PMICs. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-11power: pmic: Palmas: Add the base pmic supportKeerthy
Add support to bind the regulators/child nodes with the pmic. Also adds the pmic i2c based read/write funtions to access pmic registers. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-11power: regulator: Add support for gpio regulatorsKeerthy
Add support for gpio regulators. As of now this driver caters to gpio regulators with one gpio. Supports setting voltage values to gpio regulators and retrieving the values. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-10regulator: fixed: honour optionality of enable gpioMarcel Ziswiler
According to the binding documentation the fixed regulator enable GPIO is optional. However so far registration thereof failed if no enable GPIO was specified. Fix this by making it entirely optional whether an enable GPIO is used. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-10-07power: pmic: add Ricoh RN5T567 PMIC supportStefan Agner
Add device model enabled PMIC driver for Ricoh RN5T567 PMIC used on Colibri iMX7. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-01power: regulator: add pwm regulatorKever Yang
add driver support for pwm regulator. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-09-23treewide: replace #include <asm/errno.h> with <linux/errno.h>Masahiro Yamada
Now, arch/${ARCH}/include/asm/errno.h and include/linux/errno.h have the same content. (both just wrap <asm-generic/errno.h>) Replace all include directives for <asm/errno.h> with <linux/errno.h>. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Fixup include/clk.] Signed-off-by: Tom Rini <trini@konsulko.com>
2016-09-23drivers: squash lines for immediate returnMasahiro Yamada
Remove unneeded variables and assignments. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-09-17sunxi: axp2xx: disable ldoio0/1 at bootHans de Goede
When cold-booting the ldoio0/1 regulators are always off / the gpios are always at tristate. But when re-booting from android these are sometimes on. Disable them at axp_init time (iow as early as possible) to remove this difference between a cold boot and a reboot. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-09-06regulator: fixed: obey startup delayJohn Keeping
When enabling a fixed regulator, it may take some time to rise to the correct voltage. If we do not delay here then subsequent operations will fail. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-08-15power domain: add Tegra186 driverStephen Warren
In Tegra186, SoC power domains are manipulated using IPC requests to the BPMP (Boot and Power Management Processor). This change implements a driver that does that. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-08-12Merge git://git.denx.de/u-boot-dmTom Rini
2016-08-12power: pmic: act8846: add missing newline to debug statementsJohn Keeping
Signed-off-by: John Keeping <john@metanate.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-08-12power: regulator: act8846: fix reading valuesJohn Keeping
The voltage and control registers need to be looked up from the value in driver_data. Adjust the get_value and get_enable functions to match the corresponding set_* functions. Signed-off-by: John Keeping <john@metanate.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-08-12kconfig: use bool instead of boolean for type definition attributesMasahiro Yamada
Linux stopped the use of keyword 'boolean' in Kconfig. Refer to commit 6341e62b212a2541efb0160c470e90bd226d5496 ("kconfig: use bool instead of boolean for type definition attributes") in Linux Kernel. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-07-27Add a power domain framework/uclassStephen Warren
Many SoCs allow power to be applied to or removed from portions of the SoC (power domains). This may be used to save power. This API provides the means to control such power management hardware. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-07-27dm: Use dm_scan_fdt_dev() directly where possibleSimon Glass
Quite a few places have a bind() method which just calls dm_scan_fdt_dev(). We may as well call dm_scan_fdt_dev() directly. Update the code to do this. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-27dm: Convert users from dm_scan_fdt_node() to dm_scan_fdt_dev()Simon Glass
This new function is more convenient for callers, and handles pre-relocation situations automatically. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-25sunxi: power: add AXP809 supportChen-Yu Tsai
The A80 uses the AXP809 as its primary PMIC. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-05-25sunxi: Implement poweroff support for axp818 pmicChen-Yu Tsai
Adds poweroff support for axp818 pmic. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-05-25sunxi: power: axp818: Add support for switch SWChen-Yu Tsai
The AXP818 has a switchable output, SW. This is commonly used for controlling power to the LCD backlight. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-05-25power: axp818: Fix typo for fldo2 Kconfig descriptionChen-Yu Tsai
Description said eldo2 instead of fldo2, a copy-paste error. Fixes: 38491d9c6515 ("power: axp818: Add support for FLDOs") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-05-25power: axp221: Remove switch case to simplify axp_set_eldoChen-Yu Tsai
The ELDO enable bits and registers are contiguous for axp221. Instead of a switch case testing against the index, just use the index to shift the bit or register offset. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-04-18drivers/power/pmic/pm8916.c: Make usid be uint32_tTom Rini
If get_dev_addr fails it will return FDT_ADDR_T_NONE and: >>> "priv->usid == 4294967295U" is always false regardless of the values of its operands. This occurs as the logical operand of if. Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Reported-by: Coverity (CID: 143914) Signed-off-by: Tom Rini <trini@konsulko.com>
2016-04-01pmic: Add support for Qualcomm PM8916 PMICMateusz Kulikowski
This PMIC is connected on SPMI bus so needs SPMI support enabled. Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01sunxi: Add support for Allwinner A64 SoCsSiarhei Siamashka
The Allwinner A64 SoC is used in the Pine64. This patch adds all bits necessary to compile U-Boot for it running in AArch64 mode. Unfortunately SPL is not ready yet due to legal problems, so we need to boot using the binary boot0 for now. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> [agraf: remove SPL code, move to AArch64] Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-03-31power: axp818: Add support for FLDOsChen-Yu Tsai
The FLDOs on AXP818 PMIC normally provide power to CPUS and USB HSIC PHY on the A83T/H8. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-03-31power: axp818: Fix DCDC5 default voltageChen-Yu Tsai
DCDC5 is designed to supply VCC-DRAM, which is normally 1.5V for DDR3, 1.35V for DDR3L, and 1.2V for LPDDR3. Also remove CONFIG_AXP_DCDC5_VOLT from h8_homlet_v2_defconfig. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-03-15power: twl6030: Power off supportPaul Kocialkowski
This adds support for powering off (the omap SoC) from the twl6030. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2016-03-15power: twl6030: Remove ifdef around the codePaul Kocialkowski
The TWL6030 power driver is only built when CONFIG_TWL6030_POWER is selected, thus there is no reason to wrap the code with ifdef. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2016-03-15power: twl6030: Clear VUSB_IN_PMID bit on USB device setupPaul Kocialkowski
When booting from USB, the bootrom sets the VUSB_IN_PMID bit of the MISC2 register of the TWL6030. However, U-Boot sets the VUSB_IN_VSYS bit to enable VBUS input. As both bits are contradictory, enabling both disables the input, according to the TWL6030 TRM. Thus, we need to clear the VUSB_IN_PMID bit in case of an USB boot (which could just as well be a memory boot after USB timed out). Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2016-03-15power: twl6030: Configure VUSB voltage on USB device setupPaul Kocialkowski
This explicitly sets VUSB voltage to 3.3V when enabling USB. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2016-03-15power: twl6030: Device-index-specific MMC power initializationPaul Kocialkowski
Not every device has multiple MMC slots available, so it makes sense to enable only the required LDOs for the available slots. Generic code in omap_hsmmc will enable both VMMC and VAUX1, in doubt. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2016-03-15power: twl6030: Enable VAUX1 for eMMC power, depending on BOOT2 valuePaul Kocialkowski
This enables the VAUX1 supply, used for eMMC power in standard configurations. Its voltage is determined by the value of the BOOT2 pin of the TWL6030. Note that the TWL6030 might already have enabled this regulator at startup (depending on the value of the BOOT3 pin of the TWL6030), according to the TWL6030 datasheet. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2016-03-15power: twl6030: Some more explicit registers and values definitionsPaul Kocialkowski
This makes the twl6030 mmc and usb-related power registers and values definitions more explicit and clear and adds prefixes to them. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2016-03-14dm: Use uclass_first_device_err() where it is usefulSimon Glass
Use this new function in places where it simplifies the code. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-24pmic: tps65218: add useful functions and definesNikita Kiryanov
Add the following functions: tps65218_reg_read() for accessing redisters tps65218_toggle_fseal() for toggling the fseal bit tps65218_lock_fsea() for locking the fseal bit to 1 Add the following defines: All status register bits Cc: Tom Rini <trini@konsulko.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-02-23sunxi: power: add support for sy8106a driverJelle van der Waa
SY8106A is a PMIC which is used on the Allwinner H3 Orange Pi Pc and Plus board. The VOUT1_SEL register is implemented to set the default V-CPU voltage to 1200 mV. This driver is required to ensure the SY8106A V-CPU voltage is set to 1200 mV after a software reset. On cold boot the default SY8106A output voltage is selected to be 1200 mV by a pair of resistors on the Orange Pi PC and Plus. Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl> Tested-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-01-26sunxi: power: axp818: Enable support for ALDOsChen-Yu Tsai
Previously, AXP818 ALDO support was partially added to Kconfig, but never enabled in the board file, nor properly set or configured in Kconfig. The boards continue to work because the AXP818 is designed to pair with the A83T/H8, and the default voltages match the reference design's requirements. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-01-26power: axp818: Add support for DLDO and ELDO regulatorsChen-Yu Tsai
AXP818 provides an array of LDOs to provide power to various peripherals. None of these regulators are critical. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-01-26power: axp: merge separate DLDO functions into 1Chen-Yu Tsai
Instead of one function for each DLDO regulator, make 1 function that takes an extra "index". Since the control bits for the DLDO regulators are contiguous, this makes the function very simple. This removes a lot of duplicate code. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-01-26sunxi: Implement poweroff support for axp221 pmicHans de Goede
Adds poweroff support for axp221 pmic. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-01-26sunxi: Implement poweroff support for axp209 pmicMichael van Slingerland
Adds poweroff support for axp209 pmic. Signed-off-by: Michael van Slingerland <michael@deviousops.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-01-26sunxi: Implement poweroff support for axp152 pmicHans de Goede
Adds poweroff support for axp152 pmic. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>