Commit graph

302 commits

Author SHA1 Message Date
Mark Brown 78ae902552 Merge remote-tracking branches 'regulator/topic/pv88090', 'regulator/topic/qcom-smd', 'regulator/topic/tps6105x', 'regulator/topic/tps65086' and 'regulator/topic/tps65218' into regulator-next 2016-01-12 18:26:10 +00:00
Nikita Kiryanov c0ea88b890 regulator: tps65218: add support for LS3 current regulator
Add support for TPS65218 LS3 current regulator, which is capable of 4
current input limit modes: 100, 200, 500, and 1000 uA.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-25 12:25:26 +00:00
Bjorn Andersson 3ff3f518a1 regulator: Make bulk API support optional supplies
Make it possible to use the bulk API with optional supplies, by allowing
the consumer to marking supplies as optional in the regulator_bulk_data.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-17 18:54:07 +00:00
Sascha Hauer 5abe4f223e regulator: introduce min_dropout_uV
Many voltage Regulators need a input voltage that is higher than the
output voltage. Allow to specify a minimum dropout voltage which will
be used later to find the best input voltage for regulators.

[Changed uv to uV for consistency and legibility -- broonie]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-16 17:57:33 +01:00
Mark Brown aaa9b649d0 Merge remote-tracking branches 'regulator/topic/qcom-smd', 'regulator/topic/qcom-spmi', 'regulator/topic/rk808', 'regulator/topic/stub' and 'regulator/topic/tol' into regulator-next 2015-08-30 14:40:11 +01:00
Mark Brown 3e683126f4 Merge remote-tracking branches 'regulator/topic/mt6311', 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next 2015-08-30 14:39:48 +01:00
Viresh Kumar 30f93ca832 regulator: core: Define regulator_set_voltage_triplet()
Voltage tolerance isn't necessarily same on both sides of the target
voltage and regulator_set_voltage_tol() wouldn't be suitable in such
cases.

Add another routine regulator_set_voltage_triplet(), which accepts
target, min and max voltages as arguments.

This first tries to set the voltage between the target voltage and the
upper limit, then fall back on the full range. The idea behind this is
to set regulator's voltage as close to the target voltage, as possible.

Based on regulator_set_voltage_tol().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-17 12:54:01 -07:00
Stephen Boyd 3a003baeec regulator: Add over current protection (OCP) support
Some regulators can automatically shut down when they detect an
over current event. Add an op (set_over_current_protection) and a
DT property + constraint to support this capability.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24 18:28:46 +01:00
Henry Chen 8766018b6e regulator: mt6311: Add support for mt6311 regulator
Add regulator support for mt6311.
It has 2 regulaotrs - Buck and LDO, provide the related buck/ldo voltage
data to the driver, and creates the regulator_desc table. Supported
operations for Buck are enabled/disabled and voltage change, only
enabled/disabled for LDO.

Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24 12:30:49 +01:00
James Ban 7bd3935432 regulator: da9211: support da9215
This is a patch for supporting da9215 buck converter.

Signed-off-by: James Ban <james.ban.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-13 19:11:24 +01:00
Suzuki K. Poulose 5127e31a6c regulator: Add missing dummy definition for regulator_list_voltage
Fixes a build break when CONFIG_REGULATOR is not selected.

e.g, on linux-next - 07102015:

drivers/clk/tegra/clk-dfll.c: In function ‘find_lut_index_for_rate’:
drivers/clk/tegra/clk-dfll.c:691:3: error: implicit declaration of function ‘regulator_list_voltage’ [-Werror=implicit-function-declaration]
    if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv)
    ^
   CC      drivers/clocksource/mmio.o
   CC      fs/proc/softirqs.o
cc1: some warnings being treated as errors
make[3]: *** [drivers/clk/tegra/clk-dfll.o] Error 1
make[2]: *** [drivers/clk/tegra] Error 2
make[1]: *** [drivers/clk] Error 2
make[1]: *** Waiting for unfinished jobs....

This should be pushed to 4.2 as we have the issue in 4.2-rc1, just that
nobody uses it without the REGULATOR(yet).

Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-10 19:45:47 +01:00
Mark Brown 733ada000f Merge remote-tracking branches 'regulator/topic/of', 'regulator/topic/pwm', 'regulator/topic/qcom' and 'regulator/topic/soft-start' into regulator-next 2015-06-22 11:19:56 +01:00
Mark Brown 0460a368ea Merge remote-tracking branches 'regulator/topic/lp8755', 'regulator/topic/max14577', 'regulator/topic/max77693', 'regulator/topic/max77843' and 'regulator/topic/max8973' into regulator-next 2015-06-22 11:19:55 +01:00
Stephen Boyd c751ad0dd6 regulator: Add docbook for soft start
The docbook for these members is missing. Add them.

Warning(include/linux/regulator/machine.h:147): No description
found for parameter 'soft_start'
Warning(include/linux/regulator/driver.h:197): No description
found for parameter 'set_soft_start'

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-15 09:10:32 +01:00
Stephen Boyd 36e4f839de regulator: Add input current limit support
Some regulators can limit their input current (typically annotated
as ilim). Add an op (set_input_current_limit) and a DT property +
constraint to support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:18:02 +01:00
Stephen Boyd 57f66b7886 regulator: Add soft start support
Some regulators support a "soft start" feature where the voltage
ramps up slowly when the regulator is enabled. Add an op
(set_soft_start) and a DT property + constraint to support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:16:57 +01:00
Stephen Boyd 23c779b9f9 regulator: Add pull down support
Some regulators need to be configured to pull down a resistor
when the regulator is disabled. Add an op (set_pull_down) and a
DT property + constraint to support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:09:43 +01:00
Stephen Boyd 22a10bca28 regulator: Add system_load constraint
Some regulators have a fixed load that isn't captured by
consumers that the kernel knows about. Add a constraint to
support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:05:11 +01:00
Laxman Dewangan 69eb0980ab regulator: max8973: add mechanism to enable/disable through GPIO
MAX8973 supports the voltage output enable/disable through its EN
pin. This EN pin can be connected through GPIO from host processor.
Add support to provide GPIO number from platform/DT and if it is
valid GPIO then enable external control default.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 13:47:33 +01:00
Mark Brown bea3672833 Merge remote-tracking branches 'regulator/topic/mode', 'regulator/topic/notifier', 'regulator/topic/palmas', 'regulator/topic/qcom' and 'regulator/topic/stw481x' into regulator-next 2015-04-10 19:16:03 +01:00
Mark Brown 3984c9da45 Merge remote-tracking branches 'regulator/topic/dbx500', 'regulator/topic/load-op', 'regulator/topic/max77693' and 'regulator/topic/max8660' into regulator-next 2015-04-10 19:16:02 +01:00
Mark Brown e5073849f9 Merge remote-tracking branches 'regulator/topic/act8865', 'regulator/topic/arizona-ldo1', 'regulator/topic/arizona-micsupp' and 'regulator/topic/da9211' into regulator-next 2015-04-10 19:16:00 +01:00
Mark Brown 5fc31b43d5 Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2015-04-10 19:15:59 +01:00
Bjorn Andersson 6261b06de5 regulator: Defer lookup of supply to regulator_get
Instead of resolving regulator supplies during registration move this to
the time of a consumer retrieving a handle. The benefit is that it's
possible for one driver to register regulators with internal
dependencies out of order.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-01 21:19:44 +01:00
Axel Lin cf39284d41 regulator: Fix documentation for regmap in the config
dev_get_regulator() does not exist, fix the typo.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-18 11:42:30 +00:00
Bjorn Andersson ae6e808f15 regulator: Drop temporary regulator_set_optimum_mode wrapper
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-09 18:33:04 +00:00
Bjorn Andersson e39ce48f53 regulator: Rename regulator_set_optimum_mode
Rename the regulator_set_optimum_mode() function regulator_set_load() to
better represent what's going on.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-09 18:32:25 +00:00
Zubair Lutfullah Kakakhel df3a950e4e regulator: act8865: Add act8600 support
This patch adds act8600 support to the act8865 driver.

VBUS and USB charger supported by this chip can be added later

Tested on MIPS Creator CI20

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-06 19:43:28 +00:00
Charles Keepax 046db763aa regulator: core: Add devres versions of notifier registration
Add devm_regulator_register_notifier, this adds the resource against the
device for the consumer supply we are registering the notifier for. There
seem to be few use-cases where this wouldn't be the users intention and
this ensures the notifiers will always be removed at the correct time.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-05 16:42:14 +00:00
Geert Uytterhoeven 5c9e719691 regulator: core: Fix space before TAB
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-24 17:20:00 +09:00
Bjorn Andersson 8f4490e096 regulator: core: Introduce set_load op
Expose the requested load directly to the regulator implementation for
hardware that does not support the normal enum based set_mode().

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-23 23:16:00 +09:00
Mark Brown ffe167b0f2 Merge remote-tracking branches 'regulator/topic/max8649', 'regulator/topic/mode', 'regulator/topic/mt6397', 'regulator/topic/pfuze100' and 'regulator/topic/qcom-rpm' into regulator-next 2015-02-08 11:16:27 +08:00
Mark Brown 30c5c53042 Merge remote-tracking branches 'regulator/topic/axp20x', 'regulator/topic/da9211' and 'regulator/topic/fan53555' into regulator-next 2015-02-08 11:16:23 +08:00
Mark Brown fca8e13f50 Merge remote-tracking branch 'regulator/topic/dt-cb' into regulator-next 2015-02-08 11:16:22 +08:00
Krzysztof Kozlowski 509102760d regulator: Fix build breakage on !REGULATOR
Add missing stubs for regulator_suspend_prepare() and
regulator_suspend_finish() to fix exynos_defconfig build without
REGULATOR:

arch/arm/mach-exynos/built-in.o: In function `exynos_suspend_finish':
arch/arm/mach-exynos/suspend.c:537: undefined reference to `regulator_suspend_finish'
arch/arm/mach-exynos/built-in.o: In function `exynos_suspend_prepare':
arch/arm/mach-exynos/suspend.c:520: undefined reference to `regulator_suspend_prepare'
make: *** [vmlinux] Error 1

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reported-by: Joerg Roedel <joro@8bytes.org>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-04 11:22:21 +00:00
James Ban 8c7dd8bce0 regulator: da9211: Add gpio control for enable/disable of buck
This is a patch for adding gpio control about enable/disable of buck.

Signed-off-by: James Ban <james.ban.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-28 17:38:14 +00:00
James Ban 076c3b8e03 regulator: da9211: fix unmatched of_node
This is a patch for fixing unmatched of_node.

Signed-off-by: James Ban <james.ban.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-16 11:47:59 +00:00
Robin Gong e5a7a72cd5 regulator: pfuze100-regulator: add pfuze3000 support
Add pfuze3000 chip support.

Signed-off-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-09 12:22:18 +00:00
Krzysztof Kozlowski bfa21a0dfe regulator: Allow parsing custom properties when using simplified DT parsing
When drivers use simplified DT parsing method (they provide
'regulator_desc.of_match') they still may want to parse custom
properties for some of the regulators. For example some of the
regulators support GPIO enable control.

Add a driver-supplied callback for such case. This way the regulator
core parses common bindings offloading a lot of code from drivers and
still custom properties may be used.

The callback, called for each parsed regulator, may modify the
'regulator_config' initially passed to regulator_register().

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-08 20:15:45 +00:00
Flora Fu 0425e2420c regulator: mt6397: Add support for MT6397 regulator
Add MT6397 regulator driver.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-24 12:41:05 +00:00
Mark Brown 176488fbc1 Merge remote-tracking branches 'regulator/topic/sky81452' and 'regulator/topic/stub' into regulator-next 2014-12-05 11:14:43 +00:00
Mark Brown 92d07a8ff6 Merge remote-tracking branches 'regulator/topic/max77686', 'regulator/topic/max77693', 'regulator/topic/max77802', 'regulator/topic/power-off' and 'regulator/topic/rk808' into regulator-next 2014-12-05 11:14:37 +00:00
Mark Brown af012d6278 Merge remote-tracking branches 'regulator/topic/anatop', 'regulator/topic/disable', 'regulator/topic/dummy' and 'regulator/topic/gpio' into regulator-next 2014-12-05 11:14:35 +00:00
Mark Brown cf2394f70c Linux 3.18-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUX/DqAAoJEHm+PkMAQRiGLtQH/iAt3fRHlYDXjaJian/KG1Cb
 wVP0I+HWZmvVmmd0PzyaxCZLgRNwdmmYHEH4QLy2JwZ3jZfFHlxhy+hDWCgz+67t
 bIzkLs0Pf1T4kJ2+r8qW2kBEz9PWJHGTQw7NTqZ++Ts3rPptBA6Fg4mEJ6fQigXy
 qRIY68DpipUkXV9BWBWijnTmrvP5tt7JtPzBr4DC8frMjvWct8+XwYhc2k2tEv2j
 LwLYb1OW6PUpPv2BQBfWjqqH77vYNQVhJwuwGcDe2YZdI0UFkDheL24+RbbPcZ4f
 OnrLjJSSgzv6lBWkAaXZK7/WJ/JZbXxEqHzWZQ3xXoQov97bm7lEYJqqi5gDasQ=
 =6Qpa
 -----END PGP SIGNATURE-----

Merge tag 'v3.18-rc4' into regulator-max77802

Linux 3.18-rc4
2014-11-26 20:37:57 +00:00
Javier Martinez Canillas 75d6b2faf7 regulator: of: Pass the regulator description in the match table
Drivers can use the of_regulator_match() function to parse the regulator
init_data from DT. A match table is used to specify the name of the node
containing the regulators, the device node and to return the init_data
to the caller.

But also the static regulator descriptor is needed to correctly extract
some DT properties like the regulator initial and suspend modes. Use the
match table to pass that information.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-26 18:58:14 +00:00
Javier Martinez Canillas 072e78b12b regulator: of: Add regulator desc param to of_get_regulator_init_data()
The of_get_regulator_init_data() function is used to extract the regulator
init_data but information on how to extract certain data is defined in the
static regulator descriptor (e.g: how to map the hardware operating modes).

Add a const struct regulator_desc * parameter to the function signature so
the parsing logic could use the information in the struct regulator_desc.

of_get_regulator_init_data() relies on of_get_regulation_constraints() to
actually extract the init_data so it has to pass the struct regulator_desc
but that is modified on a later patch.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-26 18:58:14 +00:00
Javier Martinez Canillas 87e1e0f29f regulator: Add mode mapping function to struct regulator_desc
The "regulator-initial-mode" and "regulator-mode" DT properties allows
to configure the regulator operating modes at startup or when a system
enters into a susend state.

But these properties use as valid values the operating modes supported
by each device while the core deals with the standard operating modes.
So a mapping function is needed to translate from the hardware specific
modes to the standard ones.

This mapping is a non-varying configuration for each regulator, so add
a function pointer to struct regulator_desc that will allow drivers to
define their callback to do the modes translation.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-26 18:58:14 +00:00
Richard Fitzgerald a1c8a5512b regulator: core: Add PRE_DISABLE notification
Add a PRE_DISABLE notification so that consumers can use a
notifier to run any steps required to prepare for the
regulator being switched off. Since the regulator disable
can fail an abort notification is also added.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-24 15:26:02 +00:00
Mark Brown 70b946f9ac regulator: Return an error from stubbed regulator_get_exclusive()
The user hasn't got a regulator and shouldn't be mislead into thinking
they have one; really we should probably remove this stub entirely (and
may well before the next merge window).

Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-24 22:19:12 +01:00
Markus Pargmann 76f439df50 regulator: Add ena_gpio_initialized to regulator_config
Most drivers do not set the ena_gpio field of struct regulator_config
before passing it to the regulator core. This is fine as long as the
gpio identifier that is passed is a positive integer. But the gpio
identifier 0 is also valid. So we are not able to decide wether we got a
real gpio identifier or not based on a 0 in ena_gpio.

To be able to decide if it is a valid gpio that got passed, this patch
adds a ena_gpio_initialized field that should be set if was initialized
with a correct value, either a gpio >= 0 or a negative error number. The
core then checks if ena_gpio or ena_gpio_initialized before handling it
as a gpio. This way we maintain backwards compatibility and fix the
behaviour for gpio number 0.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:23:45 +01:00