summaryrefslogtreecommitdiff
path: root/drivers/power
Commit message (Collapse)AuthorAgeLines
* sunxi: power: axp809.c: Fix aldo1-2 being disabled for mvolt != 0Rask Ingemann Lambertsen2017-03-09-1/+1
| | | | | | | | | | | | | | | | | | | | | The execution flow is currently like this for aldo_num == 1 or 2: int axp_set_aldo(int aldo_num, unsigned int mvolt) { ... if (mvolt == 0) return pmic_bus_clrbits(AXP809_OUTPUT_CTRL1, AXP809_OUTPUT_CTRL1_ALDO1_EN << (aldo_num - 1)); ... return pmic_bus_clrbits(AXP809_OUTPUT_CTRL1, AXP809_OUTPUT_CTRL1_ALDO1_EN << (aldo_num - 1)); } I.e. aldo1 and aldo2 will always be disabled. This patch fixes it by setting (rather than clearing) the enable bit when mvolt != 0. Signed-off-by: Rask Ingemann Lambertsen <rask@formelder.dk> Fixes: 795857df413a ("sunxi: power: add AXP809 support")
* power: pmic: add the max8997 controller for DMJaehoon Chung2017-02-09-1/+78
| | | | | | | | | Add the max8997 controller for Driver model. Exynos4210 is using max8997 pmic controller. (pmic_max8997.c should be deprecated.) Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-dmTom Rini2017-02-08-20/+20
|\
| * dm: core: Replace of_offset with accessorSimon Glass2017-02-08-20/+20
| | | | | | | | | | | | | | | | | | At present devices use a simple integer offset to record the device tree node associated with the device. In preparation for supporting a live device tree, which uses a node pointer instead, refactor existing code to access this field through an inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
* | regulator: palmas: Fix smps6 - smps9 indicesKeerthy2017-02-08-1/+1
|/ | | | | | | | | The array indices used currently are dispalaced by 1 for SMPS6 through SMPS10 in the respective places of voltage and ctrl arrays hence fix the same as to assign the right voltage and ctrl registers. Signed-off-by: Keerthy <j-keerthy@ti.com>
* Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini2017-01-19-0/+40
|\
| * pmic: pmic_mc34vr500: Add a driver for the mc34vr500 pmicHou Zhiqiang2017-01-18-0/+40
| | | | | | | | | | | | | | | | | | This patch adds a simple pmic driver for the mc34vr500 pmic which is used in conjunction with the fsl T1 and LS1 series SoC. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: York Sun <york.sun@nxp.com>
* | power_i2c.c: Fix unused variable warningTom Rini2017-01-11-1/+0
| | | | | | | | | | | | | | | | The variable ret was added but never set as we did not make calls to other functions that we needed to check the return value on. Fixes: 505cf4750ae5 ("power: change from meaningless value to error number") Signed-off-by: Tom Rini <trini@konsulko.com>
* | power: change from meaningless value to error numberJaehoon Chung2017-01-11-67/+64
|/ | | | | | | | '-1' is absolutely meaningless value. This patch changed from meaningless value to error number. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* regulator: fixed: Add support to handle enable-active-high DT propertyVignesh R2016-12-27-1/+6
| | | | | | | | | Add support to handle enable-active-high DT property. This property is used to drive the gpio controlling fixed regulator as active high when claiming gpio line. Signed-off-by: Vignesh R <vigneshr@ti.com> Acked-by: Simon Glass <sjg@chromium.org>
* power: pmic: add the max8998 controller for DMJaehoon Chung2016-12-22-0/+69
| | | | | | | | | Add the max8998 controller for Driver model. Samsung S5P series are using max8998 pmic controller. In future, it should be supported the regulator framework. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* ARM: OMAP4+: Add support for getting pbias info from boardLokesh Vutla2016-12-04-1/+20
| | | | | | | | | | | | | Palmas driver assumes it is always TPS659xx regulator on all DRA7xx based boards to enable mmc regulator. This is not true always like in case of DRA71x-evm. So get this information based on the board. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Delete omap4_vmmc_pbias_config from omap_hsmmc.c] Signed-off-by: Tom Rini <trini@konsulko.com>
* ARM: DRA7x/AM57xx: Get rid of CONFIG_AM57XXNishanth Menon2016-12-03-1/+1
| | | | | | | | | | | CONFIG_AM57XX is just an unnecessary macro that is redundant given So, remove the same instead of spreading through out the u-boot source code and getting in the way to maintain common code for DRA7x family. Acked-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* power: regulator: Add limits checking while setting currentKeerthy2016-11-25-0/+7
| | | | | | | | | | Currently the specific set ops functions are directly called without any check for min/max current limits for a regulator. Check for them and proceed. Signed-off-by: Keerthy <j-keerthy@ti.com> Fixed checking of current limits: Signed-off-by: Simon Glass <sjg@chromium.org>
* power: regulator: Add limits checking while setting voltageKeerthy2016-11-25-0/+7
| | | | | | | | | | | Currently the specific set ops functions are directly called without any check for voltage limits for a regulator. Check for them and proceed. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Fixed checking of voltate limits: Signed-off-by: Simon Glass <sjg@chromium.org>
* power: regulator: Introduce regulator_set_value_force functionKeerthy2016-11-25-0/+14
| | | | | | | | | In case we want to force a particular value on a regulator irrespective of the min/max constraints for testing purposes one can call regulator_set_value_force function. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: twl6030: fix code refactoringNicolae Rosia2016-10-24-2/+2
| | | | | | | | | 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>
* libfdt: Sync fdt_for_each_subnode() with upstreamSimon Glass2016-10-13-1/+1
| | | | | | | | | | | 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
* Merge git://git.denx.de/u-boot-dmTom Rini2016-10-12-0/+1180
|\
| * power: regulator: lp873x: Add regulator supportKeerthy2016-10-11-0/+366
| | | | | | | | | | | | | | | | 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>
| * power: pmic: lp873x: Add the base pmic supportKeerthy2016-10-11-0/+94
| | | | | | | | | | | | | | 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>
| * power: regulator: palmas: Add regulator supportKeerthy2016-10-11-0/+462
| | | | | | | | | | | | | | | | | | 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>
| * power: pmic: Palmas: Add the base pmic supportKeerthy2016-10-11-0/+112
| | | | | | | | | | | | | | | | | | | | 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>
| * power: regulator: Add support for gpio regulatorsKeerthy2016-10-11-0/+146
| | | | | | | | | | | | | | | | | | 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>
* | regulator: fixed: honour optionality of enable gpioMarcel Ziswiler2016-10-10-6/+15
|/ | | | | | | | | | | 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>
* power: pmic: add Ricoh RN5T567 PMIC supportStefan Agner2016-10-07-0/+73
| | | | | | | | 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>
* power: regulator: add pwm regulatorKever Yang2016-10-01-0/+170
| | | | | | | | 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>
* treewide: replace #include <asm/errno.h> with <linux/errno.h>Masahiro Yamada2016-09-23-2/+2
| | | | | | | | | | | 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>
* drivers: squash lines for immediate returnMasahiro Yamada2016-09-23-7/+1
| | | | | | Remove unneeded variables and assignments. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* sunxi: axp2xx: disable ldoio0/1 at bootHans de Goede2016-09-17-0/+28
| | | | | | | | | | 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>
* regulator: fixed: obey startup delayJohn Keeping2016-09-06-0/+10
| | | | | | | | | | 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>
* power domain: add Tegra186 driverStephen Warren2016-08-15-0/+100
| | | | | | | | | | 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>
* Merge git://git.denx.de/u-boot-dmTom Rini2016-08-12-4/+4
|\
| * power: pmic: act8846: add missing newline to debug statementsJohn Keeping2016-08-12-2/+2
| | | | | | | | | | Signed-off-by: John Keeping <john@metanate.com> Acked-by: Simon Glass <sjg@chromium.org>
| * power: regulator: act8846: fix reading valuesJohn Keeping2016-08-12-2/+2
| | | | | | | | | | | | | | | | | | 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>
* | kconfig: use bool instead of boolean for type definition attributesMasahiro Yamada2016-08-12-7/+7
|/ | | | | | | | | | 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>
* 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>