Commit graph

1824 commits

Author SHA1 Message Date
Mark Brown 4c35c8676f Merge remote-tracking branch 'regulator/topic/linear' into regulator-next 2013-10-24 11:11:37 +01:00
Mark Brown a6117615a2 Merge remote-tracking branch 'regulator/topic/gpio' into regulator-next 2013-10-24 11:11:36 +01:00
Mark Brown 706664c290 Merge remote-tracking branch 'regulator/topic/fixed' into regulator-next 2013-10-24 11:11:36 +01:00
Mark Brown b735e47f6e Merge remote-tracking branch 'regulator/topic/devm' into regulator-next 2013-10-24 11:11:35 +01:00
Mark Brown 3242a86170 Merge remote-tracking branch 'regulator/topic/da9210' into regulator-next 2013-10-24 11:11:34 +01:00
Mark Brown 513b485a2d Merge remote-tracking branch 'regulator/topic/da9063' into regulator-next 2013-10-24 11:11:34 +01:00
Mark Brown 2a86e8e753 Merge remote-tracking branch 'regulator/topic/da9052' into regulator-next 2013-10-24 11:11:33 +01:00
Mark Brown 81e439f476 Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2013-10-24 11:11:33 +01:00
Mark Brown cea64d8c08 Merge remote-tracking branch 'regulator/topic/as3722' into regulator-next 2013-10-24 11:11:33 +01:00
Mark Brown f2399df731 Merge remote-tracking branch 'regulator/topic/anatop' into regulator-next 2013-10-24 11:11:32 +01:00
Mark Brown 420118d483 Merge remote-tracking branch 'regulator/topic/alias' into regulator-next 2013-10-24 11:11:32 +01:00
Axel Lin d706b1e493 regulator: da9052: Revert se apply_[reg|bit] with regmap based voltage_sel operations
This reverts commit 68f7506017.

Michael reported that with this patch we loose the fix_io code path from
da9052_reg_update. Thus revert it.

Reported-by: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-24 10:10:35 +01:00
Charles Keepax a06ccd9c37 regulator: core: Add ability to create a lookup alias for supply
These patches add the ability to create an alternative device on which
a lookup for a certain supply should be conducted.

A common use-case for this would be devices that are logically
represented as a collection of drivers within Linux but are are
presented as a single device from device tree. It this case it is
necessary for each sub device to locate their supply data on the main
device.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-18 00:56:05 +01:00
Jingoo Han 609d5f6ddc regulator: fixed: Fix checkpatch issue
Fix the following checkpatch warnings.

  WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-15 13:21:44 +01:00
Jingoo Han 34f7568510 regulator: anatop: Fix checkpatch issue
Fix the following checkpatch warning.

  WARNING: quoted string split across lines

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-15 13:18:49 +01:00
Axel Lin 8828bae464 regulator: Add REGULATOR_LINEAR_RANGE macro
Add REGULATOR_LINEAR_RANGE macro and convert regulator drivers to use it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-11 12:49:16 +01:00
Axel Lin e277e65680 regulator: Remove max_uV from struct regulator_linear_range
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>
2013-10-11 12:49:12 +01:00
Mark Brown 813de3c649 Merge remote-tracking branch 'regulator/topic/as3722' into regulator-linear 2013-10-11 12:48:57 +01:00
Nishanth Menon 9a633a2bce regulator: ti-abb: Fix operator precedence typo
commit 40b1936e (regulator: Introduce TI Adaptive Body Bias(ABB) on-chip
LDO driver) missed a pair of brackets which cause the wrong vset data to be
picked up from efuse, resulting in bad VBB voltage values.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-10-11 12:28:49 +01:00
Sachin Kamat 6653efb75d regulator: gpio: Remove redundant break
'break' after goto has no effect. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-04 11:50:10 +01:00
Axel Lin 5e96570480 regulator: as3722: Fix off-by-one n_voltages setting for SDx
AS3722_SDx_VSEL_MAX means the maximum selecter, the n_voltages should be
AS3722_SDx_VSEL_MAX + 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-03 16:49:34 +01:00
Axel Lin 43f6fc9542 regulator: as3722: Fix equation to calculate max_uV in regulator_lin_range macro
Fix off-by-one in the equation to calculate max_uV and also adjust the _min_uV
setting accordingly.

For LDOs:
The voltage select bits set the LDO output voltage 0.825V...3.3V, 25mV steps
  ....00h : LDO off
  01h-24h : V_LDO4 = 0.8V + ldo4_vsel * 25mV
                   = 0.825V + (ldo4_vsel - 1h) * 25mV
  25h-3Fh : do not use
  40h-7Fh : V_LDO4 = 1.725V + (ldo4_vsel - 40h) * 25mV

For SD2345:
The voltage select bits set the DC/DC output voltage level and power the DC/DC
converter down.
  ....00h : DC/DC powered down
  01h-40h : V_SD2 = 0.6V + sd2_vsel * 12.5mV
                  = 0.6125V + (sd2_vsel - 1h) * 12.5mV
  41h-70h : V_SD2 = 1.4V + (sd2_vsel - 40h) * 25mV
                  = 1.425V + (sd2_vsel - 41h) * 25mV
  71h-7Fh : V_SD2 = 2.6V + (sd2_vsel - 70h) * 50mV
                  = 2.65V + (sd2_vsel - 71h) * 50mV

Note, the third entry in as3722_sd2345_ranges is wrong in current code.
Fix it based on the datasheet.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-03 16:49:21 +01:00
Jingoo Han 5e0855759c regulator: tps6524x: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:11:30 +01:00
Jingoo Han 11c0da7bb4 regulator: da9210: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:11:30 +01:00
Mark Brown 21a122b5f4 Merge remote-tracking branch 'regulator/topic/tps6524x' into regulator-devm 2013-09-30 18:11:26 +01:00
Mark Brown f004eaf4d1 Merge remote-tracking branch 'regulator/topic/da9210' into regulator-devm 2013-09-30 18:11:18 +01:00
Jingoo Han abf92a3d2e regulator: vexpress: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:11:03 +01:00
Jingoo Han 00ce070e51 regulator: twl: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:11:03 +01:00
Jingoo Han 6a2b5a931f regulator: tps6105x: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:11:00 +01:00
Jingoo Han 5e0165e5a9 regulator: pcf50633: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:11:00 +01:00
Jingoo Han 15dc006af8 regulator: pcap: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:11:00 +01:00
Jingoo Han 58765e24be regulator: max8925: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:59 +01:00
Jingoo Han 0b7bb09054 regulator: lp8788-ldo: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:59 +01:00
Jingoo Han 3343fa1748 regulator: lp8788-buck: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:59 +01:00
Jingoo Han ed602534df regulator: lp872x: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:59 +01:00
Jingoo Han e97bba912e regulator: da9063: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:52 +01:00
Jingoo Han a4a6b9de5c regulator: ab8500-ext: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:52 +01:00
Jingoo Han fda5842cc6 regulator: ab3100: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:52 +01:00
Mark Brown f3d17a7e4d Merge remote-tracking branch 'regulator/fix/wm8350' into regulator-linus 2013-09-30 12:04:33 +01:00
Mark Brown 60c32f3ec8 Merge remote-tracking branch 'regulator/fix/wm831x' into regulator-linus 2013-09-30 12:04:33 +01:00
Mark Brown 0f5da28f93 Merge remote-tracking branch 'regulator/fix/ti-abb' into regulator-linus 2013-09-30 12:04:32 +01:00
Mark Brown 780a0ff76e Merge remote-tracking branch 'regulator/fix/palmas' into regulator-linus 2013-09-30 12:04:31 +01:00
Mark Brown e7b87825e8 Merge remote-tracking branch 'regulator/fix/da9063' into regulator-linus 2013-09-30 12:04:29 +01:00
Thierry Reding 5df529d440 regulator: core: Reduce busy-wait looping
Keep busy-wait looping to a minimum while waiting for a regulator to
ramp-up to the target voltage. This follows the guidelines set forth
in Documentation/timers/timers-howto.txt and assumes that regulators
are never enabled in atomic context.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 11:43:12 +01:00
Nishanth Menon bf00ca35ce regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode
As documented in Application Note SWPA117 v2.1(NDA), LDO override has a
requirement that when switching from Bias active + override active
mode(FBB/RBB) to Bypass(nominal) mode, LDO reset must be performed
*after* LDO transitions to Bypass(nominal) mode.

The same rule in reverse applies when switching from a ABB bypass mode
to ABB enabled - LDO override *must* be performed prior to transition to
required ABB mode, if we do not do that, the same glitch takes place.

Currently while transitioning to ABB bypass, we reset the LDO overide
prior to the transition which causes a few milliseconds where ABB LDO
voltage could go all the way to 800mV(based on SoC process node),
during this period, the delta voltage between VDD rail and VBB rail
could cause the system to improperly function.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-09-27 15:02:04 +01:00
Guennadi Liakhovetski 937433c250 regulator: da9210: add Device Tree support
This patch adds basic Device Tree support to the da9210 regulator driver -
with no special properties, since also driver's platform data only contains
standard regulator initialisation parameters.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-26 11:17:57 +01:00
Axel Lin f3ef11b485 regulator: wm831x-ldo: Fix max_uV for gp_ldo and aldo linear range settings
Fix the linear range settings in commit 5ff26a14c3
"regulator: wm831x-ldo: Convert to use linear ranges".

For wm831x_gp_ldo:
We have below equations for list voltage before converting to linear ranges:

sel <= 0xe:
        volt = 0.9-1.6V in 50mV steps
sel <= 0x1f:
        volt = 1.7-3.3V in 100mV steps

max_uV for the first linear range should be 1600000 rather than 1650000. Fix it.

For wm831x_aldo:
We have below equations for list voltage before converting to linear ranges:

sel <= 0xc:
        volt = 1-1.6V in 50mV steps
sel <= 0x1f
        volt = 1.7-3.5V in 100mV steps

max_uV for the first linear range should be 1600000 rather than 1650000. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-23 12:04:54 +01:00
Mark Brown 043c998f95 regulator: core: Fix return code for invalid parameters
We should be returning an error, a repeated call will never succeed.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-23 12:04:13 +01:00
Laxman Dewangan bc407334e9 regulator: as3722: add regulator driver for AMS AS3722
The AMS AS3722 is a compact system PMU suitable for mobile phones,
tablets etc. It has 4 DCDC step down regulators, 3 DCDC step down
controller, 11 LDOs.

Add a driver to support accessing the DCDC/LDOs found on the AMS
AS3722 PMIC using regulators.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Florian Lobmaier <florian.lobmaier@ams.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-20 18:08:00 +01:00
Laxman Dewangan f8c1700dd7 regulator: core: set current constraints while setting machine constraints
Machine constraints is configured during regulator register. If current
constraints are provided through machine constraints then it is observed
that sometime the current configured on rail is out of range what machine
constraint has.

Set the current constraints when setting machine constraints to make
sure that rail's current is within the range of given machine constraints.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-20 10:50:29 +01:00