aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2015-06-23Merge remote-tracking branch 'init/init-v4.1-rc6'Stephen Rothwell
Conflicts: arch/arm/mach-hisi/headsmp.S arch/arm/mach-keystone/platsmp.c
2015-06-23Merge remote-tracking branch 'regulator/for-next'Stephen Rothwell
2015-06-23Merge remote-tracking branch 'mfd/for-mfd-next'Stephen Rothwell
Conflicts: MAINTAINERS
2015-06-22Merge remote-tracking branches 'regulator/topic/of', 'regulator/topic/pwm', ↵Mark Brown
'regulator/topic/qcom' and 'regulator/topic/soft-start' into regulator-next
2015-06-22Merge remote-tracking branches 'regulator/topic/lp8755', ↵Mark Brown
'regulator/topic/max14577', 'regulator/topic/max77693', 'regulator/topic/max77843' and 'regulator/topic/max8973' into regulator-next
2015-06-22Merge remote-tracking branches 'regulator/topic/da9063', ↵Mark Brown
'regulator/topic/doc', 'regulator/topic/fan53555', 'regulator/topic/gpio' and 'regulator/topic/ilim' into regulator-next
2015-06-22Merge remote-tracking branches 'regulator/topic/88pm8607', ↵Mark Brown
'regulator/topic/arizona', 'regulator/topic/cleanup' and 'regulator/topic/da9062' into regulator-next
2015-06-22Merge remote-tracking branch 'regulator/topic/core' into regulator-nextMark Brown
2015-06-22Merge remote-tracking branches 'regulator/fix/doc', 'regulator/fix/max77686' ↵Mark Brown
and 'regulator/fix/wm831x' into regulator-linus
2015-06-22Merge remote-tracking branch 'regulator/fix/core' into regulator-linusMark Brown
2015-06-19regulator: qcom_spmi: Fix calculating number of voltagesAxel Lin
n /= range->step_uV + 1; is equivalent to n /= (range->step_uV + 1); which is wrong. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-17regulator: qcom_spmi: Add missing braces for aligned codeStephen Boyd
drivers/regulator/qcom_spmi-regulator.c:751:3-50: code aligned with following code on line 753 drivers/regulator/qcom_spmi-regulator.c:584:3-41: code aligned with following code on line 587 These lines where missing braces causing the break to always be executed even when it shouldn't be. Fix it. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Andy Gross <agross@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16drivers/regulator: include <module.h> for modular max77802 codePaul Gortmaker
This file is built off of a tristate Kconfig option and also contains modular function calls so it should explicitly include module.h to avoid compile breakage during header shuffles done in the future. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2015-06-16regulator: fix simple_return.cocci warningsJulia Lawall
Simplify a trivial if-return sequence and combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Mark Brown <broonie@kernel.org> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16regulator: Add QCOM SPMI regulator driverStephen Boyd
Add an SPMI regulator driver for Qualcomm's PM8841, PM8941, and PM8916 PMICs. This driver is based largely on code from codeaurora.org[1]. [1] https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/regulator/qpnp-regulator.c?h=msm-3.10 Cc: David Collins <collinsd@codeaurora.org> Cc: <devicetree@vger.kernel.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12regulator: Add input current limit supportStephen Boyd
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-12regulator: Add soft start supportStephen Boyd
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-12regulator: Add pull down supportStephen Boyd
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-12regulator: Add system_load constraintStephen Boyd
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-10regulator: max8973: Fix up ramp_delay for MAX8973_RAMP_25mV_PER_US caseAxel Lin
Fix trivial typo. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-10regulator: core: replace sprintf with scnprintfStefan Wahren
In order to avoid potential overflows in print_constraints we better replace sprintf() with scnprintf(). Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-10Merge branch 'fix/core' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-core
2015-06-10regulator: core: fix constraints output bufferStefan Wahren
The buffer for condtraints debug isn't big enough to hold the output in all cases. So fix this issue by increasing the buffer. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2015-06-09regulator: core: Don't corrupt display when printing uV offsetsMark Brown
We weren't taking into account the already used buffer when telling sprintf() where to print to. Reported-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-09regulator: max8973: add support for MAX77621Laxman Dewangan
Maxim MAX77621 device is high-efficiency, three-phase, DC-DC step-down switching regulator delivers peak output currents up to 16A. This device is extension of MAX8973 and compatible with the register definition. The MAX77621 has the SHUTDOWN pin which is EN pin on the MAX8973. On MAX77621, the SHUTDOWN pin (active low) reset device register to its POR/OTP value. The voltage output is enabled when SHUTDONW pin is HIGH and EN bit on VOUT register is HIGH. For MAX8973, VOUT is enabled when EN bit or EN pin is high. Add support of the MAX77621 device on max8973 regulator driver with following changes: - Make sure SHUTDOWN pin is set HIGH through GPIO calls if GPIO from AP connected to SHUTDOWN pin provided. - Enable/disable the rail through register access only. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-09regulator: max8973: configure ramp delay through callbackLaxman Dewangan
Regulator core framework support the configuration of ramp delay reading from platform specific regulator data via the regulator callback ops. Instead of reading regulator init data on driver and setting ramp delay, use the callback to achieve this. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08regulator: pwm-regulator: Diffientiate between dev (device) and rdev ↵Lee Jones
(regulator_dev) Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08regulator: pwm-regulator: Remove superfluous is_enabled checkLee Jones
The core framework already takes care of this. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08regulator: pwm-regulator: Remove unnecessary descriptor attribute from ddataLee Jones
The Regulator Device keeps a full copy of it's own, which can be easily accessed. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-05Merge remote-tracking branches 'asoc/topic/adau1977', 'asoc/topic/adav80x', ↵Mark Brown
'asoc/topic/arizona' and 'asoc/topic/atmel' into asoc-next
2015-06-03regulator: core: Don't spew backtraces on duplicate sysfsStephen Boyd
We don't consider a failure to add the sysfs node as a problem, so use sysfs_create_link_nowarn() so that we don't print a backtrace when duplicated files exist. Also, downgrade the printk message to a debug statement so that we're quiet here. This allows multiple drivers to request a CPU's regulator so that CPUfreq and AVSish drivers can coexist. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02regulator: arizona-ldo1: Do not control DVFS clocking from regulatorRichard Fitzgerald
Using the driver for the internal regulator to also enable/disable the codec internal clock frequency controller is an unexpected side-effect for a regulator, and also means that the core clocks won't be changed as expected if an external regulator is used to power the codec. The DVFS is now handled by the codec driver so can be removed from the LDO1 driver. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02regulator: da9063: Fix up irq leakAxel Lin
Current code does not set regulators->irq_ldo_lim and regulators->irq_uvov, so it actually calls free_irq(0, regulators) twice in remove() but does not free the irq actually used. Convert to use devm_request_threaded_irq instead and then we don't need to take care the clean up irq so remove irq_ldo_lim and irq_uvov from struct da9063_regulators. Note, regulators->irq_uvov is not used at all in current code. There is a slightly change in this patch, it will return error in probe() if devm_request_threaded_irq fails. If the irq is optional, it should be fine to allow platform_get_irq_byname fails. But current code does not allow platform_get_irq_byname fails. So I think the reason to allow request irq failure is just because the irq leak. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02regulator: lp8755: Convert to devm_request_threaded_irqAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02regulator: da9062: Remove unused variable build warningS Twiss
Remove the unused variable build warning for reg_matches that appears during the compilation of the DA9062 regulator driver. da9062-regulator.c: In function da9062_regulator_probe: da9062-regulator.c:727:29: warning: unused variable reg_matches Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02regulator: wm831x: Pass the IRQF_ONESHOT flagFabio Estevam
Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. So pass the IRQF_ONESHOT flag in this case. The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-27mfd: da9052: Fix broken regulator probeJohan Hovold
Fix broken probe of da9052 regulators, which since commit b3f6c73db732 ("mfd: da9052-core: Fix platform-device id collision") use a non-deterministic platform-device id to retrieve static regulator information. Fortunately, adequate error handling was in place so probe would simply fail with an error message. Update the mfd-cell ids to be zero-based and use those to identify the cells when probing the regulator devices. Fixes: b3f6c73db732 ("mfd: da9052-core: Fix platform-device id collision") Cc: stable <stable@vger.kernel.org> # v3.19 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-05-26regulator: fan53555: fill set_voltage_time_set callbackHeiko Stuebner
Setting the set_voltage_time_sel callback to the standard function regulator_set_voltage_time_sel enables the regulator to actually honor ramp-delays when during regulator_set_voltage calls. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-25regulator: da9062: Fix modaliasAxel Lin
Remove extra space between platform prefix and driver name in MODULE_ALIAS. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22regulator: max8973: add mechanism to enable/disable through GPIOLaxman Dewangan
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-22regulator: max8973: add DT parsing of platform specific parameterLaxman Dewangan
There are some platform specific parameter required to configure the device like enable external control, DVS gpio etc. Add DT parsing of such properties to make platform specific data. Update DT binding doc accordingly. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-21regulator: max8973: get rid of extra variable for gpio validityLaxman Dewangan
To find that dvs-gpio is valid or not, gpio API gpio_is_valid() can be directly used instead of intermediate variable. Removing the extra variable and using the gpio_is_valid(). Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-21regulator: max8973: make default/unset dvs gpio as invalid gpioLaxman Dewangan
If platform data has dvs-gpio value 0 as default/unset then make this as invalid gpio so that function gpio_is_valid() can return false on this case. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-21regulator: da9062: DA9062 regulator driverS Twiss
Add BUCK and LDO regulator driver support for DA9062 Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-20regulator: max77686: fix gpio_enabled shift wrapping bugJoe Perches
The code should handle more than 32 bits here because "id" can be a value up to MAX77686_REGULATORS (currently 34). Convert the gpio_enabled type to DECLARE_BITMAP and use test_bit/set_bit. Fixes: 3307e9025d29 ("regulator: max77686: Add GPIO control") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-05-13regulator: axp20x: Add support for AXP22X regulatorsBoris BREZILLON
Add AXP22X regulator definitions and variant id associations. This introduces a new "switch" type output for one of the regulators. It is a switchable secondary output of one regulator, with the same voltage level as the primary output. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> [wens@csie.org: Moved variant choosing to multi family support patch] [wens@csie.org: Add dc-dc work frequency range] [wens@csie.org: Add "switch" type output regulator DC1SW] Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-05-13regulator: axp20x: Prepare support for multiple AXP chip familiesBoris BREZILLON
Rework the AXP20X_ macros and probe function to support the several chip families, so that each family can define it's own set of regulators. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> [wens@csie.org: Support different DC-DC work frequency ranges] Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-05-13regulator: of: Skip disabled regulator nodesStephen Boyd
If a regulator is listed in devicetree, but the node is marked as "disabled" we should skip parsing the regulator init data and deny consumers from interacting with the regulator. This simplifies devicetree maintenance where we can have one dtsi file with all regulators supported by a PMIC and then select what regulators are used depending on the board configuration. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-11regulator: arizona-ldo1: Add additional supported voltageCharles Keepax
This patch adds support for the 1.175V mode on the LDO1 regulator on the wm5110. This is need as part of the low power sleep mode operation. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06regulator: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>