summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/helpers.c
Commit message (Collapse)AuthorAgeFilesLines
* regulators: helpers: Fix handling of bypass_val_on in get_bypass_regmapCharles Keepax2016-11-101-1/+5
| | | | | | | | | | | | | | The handling of bypass_val_on that was added in regulator_get_bypass_regmap is done unconditionally however several drivers don't define a value for bypass_val_on. This results in those drivers reporting bypass being enabled when it is not. In regulator_set_bypass_regmap we use bypass_mask if bypass_val_on is zero. This patch adds similar handling in regulator_get_bypass_regmap. Fixes: commit dd1a571daee7 ("regulator: helpers: Ensure bypass register field matches ON value") Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: helpers: Ensure bypass register field matches ON valueJon Hunter2016-04-221-1/+1
| | | | | | | | | | | | | When checking bypass state for a regulator, we check to see if any bits in the bypass mask are set. For most cases this is fine because there is typically, only a single bit used to determine if the regulator is in bypass. However, for some regulators, such as LDO6 on AS3722, the bypass state is indicate by a value rather than a single bit. Therefore, when checking the bypass state, check that the bypass field matches the ON value. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: helper: Add helper to configure active-discharge using regmapLaxman Dewangan2016-03-021-0/+23
| | | | | | | | | | Add helper function to set the state of active-discharge of regulator using regmap. The HW regulator driver can directly use this by providing the necessary information in the regulator descriptor. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: Fix the function name in documentationKrzysztof Kozlowski2015-04-191-1/+1
| | | | | | | | The function name in kernel-doc for regulator_map_voltage_linear_range() was wrong. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: helpers: Modify helpers enabling multi-bit controlCarlo Caione2014-03-061-16/+32
| | | | | | | | | | | | | | | | | | This patch extends the regulator helpers to account for device that use multiple bits for control when using regmap enable/disable/bypass ops. The actual regulator helpers wrongly assume that the regulator control is always performed using single bits, using in the regulator_desc struct only two parameters *_reg and *_mask defining register and mask for control. This patch extends this struct and introduces the helpers to take into account devices where control is performed using multiple bits and specific multi-bit values are used for enabling/disabling/bypassing the regulator. Signed-off-by: Carlo Caione <carlo@caione.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: Remove max_uV from struct regulator_linear_rangeAxel Lin2013-10-111-1/+5
| | | | | | | | | linear ranges means each range has linear voltage settings. So we can calculate max_uV for each linear range in regulator core rather than set the max_uV field in drivers. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: core: Move list_voltage_{linear,linear_range,table} to helpers.cAxel Lin2013-08-091-0/+86
| | | | | | | | Move regulator_list_voltage_{linear,linear_range,table} helper functions to helpers.c. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: core: Move helpers for drivers out into a separate fileMark Brown2013-08-071-0/+361
Reduce the size of core.c a bit. Signed-off-by: Mark Brown <broonie@linaro.org>
OpenPOWER on IntegriCloud