summaryrefslogtreecommitdiff
path: root/drivers/power
Commit message (Collapse)AuthorAgeLines
* Add a power domain framework/uclassStephen Warren2016-07-27-0/+300
| | | | | | | | | 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>
* dm: Use dm_scan_fdt_dev() directly where possibleSimon Glass2016-07-27-7/+1
| | | | | | | 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>
* dm: Convert users from dm_scan_fdt_node() to dm_scan_fdt_dev()Simon Glass2016-07-27-3/+2
| | | | | | | This new function is more convenient for callers, and handles pre-relocation situations automatically. Signed-off-by: Simon Glass <sjg@chromium.org>
* sunxi: power: add AXP809 supportChen-Yu Tsai2016-05-25-26/+285
| | | | | | | | 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>
* sunxi: Implement poweroff support for axp818 pmicChen-Yu Tsai2016-05-25-0/+12
| | | | | | | | 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>
* sunxi: power: axp818: Add support for switch SWChen-Yu Tsai2016-05-25-0/+17
| | | | | | | | | 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>
* power: axp818: Fix typo for fldo2 Kconfig descriptionChen-Yu Tsai2016-05-25-1/+1
| | | | | | | | | 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>
* power: axp221: Remove switch case to simplify axp_set_eldoChen-Yu Tsai2016-05-25-20/+7
| | | | | | | | | | 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>
* drivers/power/pmic/pm8916.c: Make usid be uint32_tTom Rini2016-04-18-1/+1
| | | | | | | | | 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>
* pmic: Add support for Qualcomm PM8916 PMICMateusz Kulikowski2016-04-01-0/+113
| | | | | | | | 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>
* sunxi: Add support for Allwinner A64 SoCsSiarhei Siamashka2016-04-01-1/+1
| | | | | | | | | | | | | | | 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>
* power: axp818: Add support for FLDOsChen-Yu Tsai2016-03-31-0/+61
| | | | | | | | | 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>
* power: axp818: Fix DCDC5 default voltageChen-Yu Tsai2016-03-31-2/+1
| | | | | | | | | | | 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>
* power: twl6030: Power off supportPaul Kocialkowski2016-03-15-0/+8
| | | | | | This adds support for powering off (the omap SoC) from the twl6030. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* power: twl6030: Remove ifdef around the codePaul Kocialkowski2016-03-15-2/+0
| | | | | | | 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>
* power: twl6030: Clear VUSB_IN_PMID bit on USB device setupPaul Kocialkowski2016-03-15-0/+1
| | | | | | | | | | | | 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>
* power: twl6030: Configure VUSB voltage on USB device setupPaul Kocialkowski2016-03-15-0/+4
| | | | | | This explicitly sets VUSB voltage to 3.3V when enabling USB. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* power: twl6030: Device-index-specific MMC power initializationPaul Kocialkowski2016-03-15-24/+26
| | | | | | | | 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>
* power: twl6030: Enable VAUX1 for eMMC power, depending on BOOT2 valuePaul Kocialkowski2016-03-15-0/+19
| | | | | | | | | | | 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>
* power: twl6030: Some more explicit registers and values definitionsPaul Kocialkowski2016-03-15-11/+15
| | | | | | | 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>
* dm: Use uclass_first_device_err() where it is usefulSimon Glass2016-03-14-1/+1
| | | | | | Use this new function in places where it simplifies the code. Signed-off-by: Simon Glass <sjg@chromium.org>
* pmic: tps65218: add useful functions and definesNikita Kiryanov2016-02-24-0/+56
| | | | | | | | | | | | | | | | 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>
* sunxi: power: add support for sy8106a driverJelle van der Waa2016-02-23-0/+46
| | | | | | | | | | | | | | | | 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>
* sunxi: power: axp818: Enable support for ALDOsChen-Yu Tsai2016-01-26-3/+47
| | | | | | | | | | | | 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>
* power: axp818: Add support for DLDO and ELDO regulatorsChen-Yu Tsai2016-01-26-6/+50
| | | | | | | | | 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>
* power: axp: merge separate DLDO functions into 1Chen-Yu Tsai2016-01-26-68/+20
| | | | | | | | | | | 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>
* sunxi: Implement poweroff support for axp221 pmicHans de Goede2016-01-26-0/+13
| | | | | | | Adds poweroff support for axp221 pmic. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: Implement poweroff support for axp209 pmicMichael van Slingerland2016-01-26-0/+13
| | | | | | | | 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>
* sunxi: Implement poweroff support for axp152 pmicHans de Goede2016-01-26-0/+13
| | | | | | | Adds poweroff support for axp152 pmic. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* dm: power: Allow regulators to not implement all operationsSimon Glass2016-01-21-0/+2
| | | | | | | | Some regulators will not implement any operations (e.g. fixed regulators). This is not an error, so allow the autoset process to continue when one of these regulators is found. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: power: Tidy up debugging output and return valuesSimon Glass2016-01-21-8/+19
| | | | | | | | The currect PMIC debugging is a little confusing. Adjust it so that it is clear whether the operation succeeded or failed. Also, avoid creating a new error return value when a perfectly good one is already available. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: power: Allow regulators to be omitted from SPLSimon Glass2016-01-21-2/+34
| | | | | | | | For some boards the pmic interface is useful but the regulator interface (which comes with it) is too large. Allow them to be separated such that SPL can decide which it needs. Signed-off-by: Simon Glass <sjg@chromium.org>
* power: Add support for RK808 regulatorsSimon Glass2016-01-21-0/+311
| | | | | | | Add regulator support for the RK808 PMIC. It integrated 4 BUCKs and 8 LDOs all of which are supported by this driver. Signed-off-by: Simon Glass <sjg@chromium.org>
* power: Add base support for the RK808 PMICSimon Glass2016-01-21-0/+106
| | | | | | | | | | This Rockchip PMIC provides features suitable for battery-powered applications. It is commonly used with Rockchip SoCs. Add a driver which provides register access. The regulator driver will use this. Signed-off-by: Simon Glass <sjg@chromium.org>
* power: regulator: max77686: Don't use switch() on boolsTom Rini2016-01-19-20/+8
| | | | | | | | | | | With gcc-5.3 we get a warning for using switch() on a bool type. Rewrite these sections as if/else and update the one section that was using 1/0 instead of true/false. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
* sunxi: power: axp818: add support for axp818 drivervishnupatekar2015-12-10-11/+162
| | | | | | | | | | | | | | | AXP818 is rsb based PMIC and used on Allwinner A83T H8 Homlet dev board. It's registers are different and calculating reg config is different than that of earlier axp power ICs. DCDC1, DCDC2, DCDC3 and DCDC5 is implemented at the moment. all other voltages can be added subsequently. AXP datasheet is uploaded to wiki: http://linux-sunxi.org/File:AXP818_datasheet_Revision1.0.pdf Signed-off-by: Vishnu Patekar <vishnupatekar0510@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* sunxi: Add basic H3 supportJens Kuske2015-11-22-2/+3
| | | | | | | | Add initial sun8i H3 support, only uart + mmc are supported for now. Signed-off-by: Jens Kuske <jenskuske@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Move console definitions into a new console.h fileSimon Glass2015-11-19-0/+1
| | | | | | | | The console includes a global variable and several functions that are only used by a small subset of U-Boot files. Before adding more functions, move the definitions into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: regulator: add function device_get_supply_regulator()Przemyslaw Marczak2015-11-02-0/+7
| | | | | | | | | | | | Some devices are supplied by configurable regulator's output. But there was no function for getting it. This commit adds function, that allows for getting the supply device by it's phandle. The returned regulator device can be used with regulator uclass's API. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* dm: pmic: add s2mps11 PMIC I/O driverPrzemyslaw Marczak2015-11-02-0/+77
| | | | | | | | | | | | | | | | | | This driver allows I/O operations on the Samsung S2MPS11 PMIC, which provides lots of LDO/BUCK outputs. To enable it, update defconfig with: - CONFIG_PMIC_S2MPS11 and additional, if were not defined: - CONFIG_CMD_PMIC - CONFIG_ERRNO_STR The binding info: doc/device-tree-bindings/pmic/s2mps11.txt Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* sunxi: power: Change axp209 LDO3 and LDO4 default to disabledHans de Goede2015-10-20-2/+2
| | | | | | | | | LDO3 and LDO4 are normally either unused, or used to power csi attached camera sensors, and as such do not need to be enabled at boot time. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: power: Add support for disabling axp209 regulatorsHans de Goede2015-10-20-4/+46
| | | | | | | Add support for disabling the regulators found on the axp209 pmic. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: power: Drop protection against multiple calls from axp221 axp_init()Hans de Goede2015-10-20-6/+0
| | | | | | | | | The only thing axp221.c's axp_init() does which needs protection against multiple calls is calling pmic_bus_init, and pmic_bus_init() itself is already protected against being called multiple times. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: power: Use pmic_bus functions for axp152 / axp209 driverHans de Goede2015-10-20-38/+26
| | | | | | | | | Use the generic pmic_bus helpers for the axp152 / axp209 drivers, rather then having them define their own register read / write functions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: power: Change A23/A33 aldo1 default voltage to 3.0VHans de Goede2015-10-20-1/+2
| | | | | | | | | | | On A23 / A33 boards aldo1 is used for VCC-IO and should be 3.0V, make this the default. Note that this does not cause any functional changes since all sun8i board defconfig-s already contained: CONFIG_AXP_ALDO1_VOLT=3000 . Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: power: Change A23/A33 VDD-SYS default from 1.2V to 1.1VHans de Goede2015-10-20-2/+3
| | | | | | | | | | | | Change the axp223 dcdc2 / VDD-SYS default from 1.2V to 1.1V, 1.1V is the value recommended by Allwinner and is what most fex files specify. This has been tested on a number of A23/A33 tablets including on an A23 Ippo-q8h-v1.2 PCB tablet which has a fex file which specifies 1.2V (which is where our original 1.2V default comes from). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: power: Unify axp pmic function namesHans de Goede2015-10-20-55/+31
| | | | | | | | | Stop prefixing the axp functions for setting voltages, etc. with the model number, there ever is only one pmic driver built into u-boot, this allows simplifying the callers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: power: Make all voltages configurable through KconfigHans de Goede2015-10-20-44/+130
| | | | | | | | | | | | On boards with axp221/223 pmic-s we already allow configuring most voltages. Make the Kconfig options for these also apply to boards with axp152 / axp209 pmic-s and extend them to configure all voltages. The Kconfig defaults are chosen so that this commit does not introduce any functional changes. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: Kconfig-ify CONFIG_AXP152_POWER and _AXP209_POWERHans de Goede2015-10-20-3/+29
| | | | | | | | | | | | | Kconfig-ify CONFIG_AXP152_POWER and _AXP209_POWER settings, removing them from CONFIG_SYS_EXTRA_OPTIONS. Note that sun5i boards can have either an AXP209 or an AXP152 pmic, the Kconfig default is AXP209, boards with an AXP152 must explicitly select this. Likewise boards without a pmic must explicitly select SUNXI_NO_PMIC in their defconfig. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* Merge git://git.denx.de/u-boot-rockchipTom Rini2015-09-03-0/+265
|\