summaryrefslogtreecommitdiff
path: root/drivers/power/regulator
Commit message (Collapse)AuthorAgeFilesLines
* power: regulator: lp87565: get_enable should return integerKeerthy2017-07-191-1/+1
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: lp873x: get_enable should return integerKeerthy2017-07-191-2/+2
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: s5m8767: get_enable should return integerKeerthy2017-07-191-2/+2
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: sandbox: fixed: get_enable should return integerKeerthy2017-07-191-2/+2
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: rk8xx: get_enable should return integerKeerthy2017-07-191-3/+3
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: tps65090: get_enable should return integerKeerthy2017-07-191-1/+1
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: pfuze100: get_enable should return integerKeerthy2017-07-191-1/+1
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: palmas: get_enable should return integerKeerthy2017-07-191-2/+2
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: max77686: get_enable should return integerKeerthy2017-07-191-2/+2
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: act8846: get_enable should return integerKeerthy2017-07-191-1/+1
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: fixed: get_enable should return integerKeerthy2017-07-191-1/+1
| | | | | | | | get_enable should be able to return error values. Hence change the return type to integer. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* regulator: Change get_enable return type to integer from boolKeerthy2017-07-191-1/+1
| | | | | | | Change get_enable return type to int so errors can be returned. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: rk8xx: Allow input current/charger shutdown configurationWadim Egorov2017-07-111-0/+34
| | | | | | | | | | The RK818 PMIC contains a charger. Add very basic charger functionality to be able to regulate the USB input current and charger shutdown limits. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* power: regulator: rk8xx: Build get_ldo_reg only for SPLWadim Egorov2017-07-111-19/+21
| | | | | | | | | | | | | Enabling CONFIG_SPL_POWER_SUPPORT will cause a compiler warning: ‘get_ldo_reg’ defined but not used [-Wunused-function] Let's wrap get_ldo_reg(), rk808_ldo and rk818_ldo with ENABLE_DRIVER which is only set for non SPL builds. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* Merge git://www.denx.de/git/u-boot-imxTom Rini2017-06-271-3/+11
|\ | | | | | | | | | | | | | | | | Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: include/configs/imx6qdl_icore_rqs.h include/configs/imx6ul_geam.h include/configs/imx6ul_isiot.h
| * regulator: pfuze100: unsigned compared against 0Peng Fan2017-05-311-3/+3
| | | | | | | | | | | | | | | | Fix unsigned compared against 0. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * regulator: pfuze100: add SPDX LicensePeng Fan2017-05-311-0/+8
| | | | | | | | | | | | | | | | Add SPDX license Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
* | Merge git://git.denx.de/u-boot-dmTom Rini2017-06-101-3/+5
|\ \
| * | power: regulator: Add more debugging and fix a missing newlineSimon Glass2017-06-091-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | This file does not report a few possible errors and one message is missing a newline. Fix these. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
* | | power: regulator: lp87565: add regulator supportKeerthy2017-06-093-0/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | The driver provides regulator set/get voltage enable/disable functions for lp87565 family of PMICs. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* | | power: regulator: palmas: Add smps12 dual regulator for tps65917Keerthy2017-06-091-1/+5
|/ / | | | | | | | | | | | | Add smps12 dual regulator for tps65917 Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | regulator: pwm: Fix handling of missing init voltageMark Kettenis2017-06-071-4/+4
| | | | | | | | | | | | | | | | | | | | Since priv->init_voltage is an unsigned integer it can never be negative. So the current code fails to detect a missing 'regulator-init-microvolt' property and instead misconfigures the PWM device. Fix this by making the relevant members of 'struct pwm_regulator_info' signed integers. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
* | power: rk808: fix ldo register offsetHeiko Stübner2017-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Till now get_ldo_reg did a return &rk808_ldo[num - 1]; to return the ldo register offset but didn't take into account that its calling functions already created the ldo as ldo = dev->driver_data - 1. This resulted in the setting for ldo8 writing to the register of ldo7 and so on. So fix this and get the correct ldo register data. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Simon Glass <sjg@chromium.org>
* | dm: regulator: Update fixed regulator to support livetree.Simon Glass2017-06-011-8/+9
| | | | | | | | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: regulator: Convert regulator uclass to support livetreeSimon Glass2017-06-011-23/+16
|/ | | | | | Update the regulator uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* drivers/power/regulator/max77686.c: Fix comparisons of unsigned expressionsTom Rini2017-05-291-8/+8
| | | | | | | | | | | | | | Inside of max77686_buck_volt2hex/max77686_buck_hex2volt/max77686_ldo_volt2hex we check that the value we calculate is >= 0 however we declare 'hex' as unsigned int making these always true. Mark these as 'int' instead. We also move hex_max to int as they are constants that are 0x3f/0xff. Given that the above functions are marked as returning an int, make the variables we assign their return value to also be int to be able to catch the error condition now. Reported by clang-3.8. Cc: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* power: rk808: rename to rk8xxJacob Chen2017-05-103-40/+40
| | | | | | | | | Since this driver can be used for rk8xx series pmic, let's rename rk808 to rk8xx, to make it clear. Configs parts are done by sed -i "s/RK808/RK8XX/g" `grep RK808 -lr ./` Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
* power: regulator: rk808: add rk818 supportJacob Chen2017-05-101-4/+51
| | | | | | | | | Add support for the rk818 regulator. The regulator module consists of 4 DCDCs, 9 LDOs, 1 switch and 1 BOOST converter which is used to power OTG and HDMI5V. Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: rk808: replace vsel_bits with vsel_maskJacob Chen2017-05-101-17/+22
| | | | | | | Using mask is more flexible than bits. Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: pmic: append rk818 regs to rk808Jacob Chen2017-05-101-9/+9
| | | | | | | | | | Both RK808 and RK818 chips are using a similar register map, so we can reuse them. I have also add reg prefix to exist registers, to keep them same style. Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: regulator: pwm: support pwm polarity settingKever Yang2017-05-101-2/+14
| | | | | | | | | | | | | The latest kernel PWM drivers enable the polarity settings. When system run from U-Boot to kerenl, if there are differences in polarity set or duty cycle, the PMW will re-init: close -> set polarity and duty cycle -> enable the PWM. The power supply controled by pwm regulator may have voltage shaking, which lead to the system not stable. 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>
* Merge git://git.denx.de/u-boot-dmTom Rini2017-02-084-6/+6
|\
| * dm: core: Replace of_offset with accessorSimon Glass2017-02-084-6/+6
| | | | | | | | | | | | | | | | | | 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-081-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>
* regulator: fixed: Add support to handle enable-active-high DT propertyVignesh R2016-12-271-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: regulator: Add limits checking while setting currentKeerthy2016-11-251-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-251-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-251-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>
* Merge git://git.denx.de/u-boot-dmTom Rini2016-10-125-0/+974
|\
| * power: regulator: lp873x: Add regulator supportKeerthy2016-10-113-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: regulator: palmas: Add regulator supportKeerthy2016-10-113-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: regulator: Add support for gpio regulatorsKeerthy2016-10-113-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-101-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: regulator: add pwm regulatorKever Yang2016-10-013-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>
* regulator: fixed: obey startup delayJohn Keeping2016-09-061-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: regulator: act8846: fix reading valuesJohn Keeping2016-08-121-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>
* dm: Convert users from dm_scan_fdt_node() to dm_scan_fdt_dev()Simon Glass2016-07-271-1/+1
| | | | | | | This new function is more convenient for callers, and handles pre-relocation situations automatically. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Use uclass_first_device_err() where it is usefulSimon Glass2016-03-141-1/+1
| | | | | | Use this new function in places where it simplifies the code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: power: Allow regulators to not implement all operationsSimon Glass2016-01-211-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-211-1/+1
| | | | | | | | 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>