History log of /linux-master/drivers/regulator/ab8500.c
Revision Date Author Comments
# 259b93b2 16-Mar-2023 Douglas Anderson <dianders@chromium.org>

regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14

Probing of regulators can be a slow operation and can contribute to
slower boot times. This is especially true if a regulator is turned on
at probe time (with regulator-boot-on or regulator-always-on) and the
regulator requires delays (off-on-time, ramp time, etc).

While the overall kernel is not ready to switch to async probe by
default, as per the discussion on the mailing lists [1] it is believed
that the regulator subsystem is in good shape and we can move
regulator drivers over wholesale. There is no way to just magically
opt in all regulators (regulators are just normal drivers like
platform_driver), so we set PROBE_PREFER_ASYNCHRONOUS for all
regulators found in 'drivers/regulator' individually.

Given the number of drivers touched and the impossibility to test this
ahead of time, it wouldn't be shocking at all if this caused a
regression for someone. If there is a regression caused by this patch,
it's likely to be one of the cases talked about in [1]. As a "quick
fix", drivers involved in the regression could be fixed by changing
them to PROBE_FORCE_SYNCHRONOUS. That being said, the correct fix
would be to directly fix the problem that caused the issue with async
probe.

The approach here follows a similar approach that was used for the mmc
subsystem several years ago [2]. In fact, I ran nearly the same python
script to auto-generate the changes. The only thing I changed was to
search for "i2c_driver", "spmi_driver", and "spi_driver" in addition
to "platform_driver".

[1] https://lore.kernel.org/r/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk
[2] https://lore.kernel.org/r/20200903232441.2694866-1-dianders@chromium.org/

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230316125351.1.I2a4677392a38db5758dee0788b2cea5872562a82@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3acb64c0 04-Dec-2020 Linus Walleij <linus.walleij@linaro.org>

regulator: ab8500: Decomission platform data header

The platform data header was only used to pass platform
data from board files. We now populate the regulators
exclusively from device tree, so the header contents can
be moved into the regulator drivers.

Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201205004057.1712753-2-linus.walleij@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# aeee55b7 25-Jun-2020 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Remove unused embedded struct expand_register

Used primarily for the AB8540 which lost support in early 2018.
It is now deemed safe to remove this legacy data structure.

Also fixes W=1 issue:

drivers/regulator/ab8500.c:88: warning: Function parameter or member 'expand_register' not described in 'ab8500_regulator_info'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200625163614.4001403-6-lee.jones@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 29ebe87c 10-Apr-2020 Jason Yan <yanaijie@huawei.com>

regulator: ab8500: remove some defined but not used variables

Fix the following gcc warning:

drivers/regulator/ab8500.c:195:27: warning: ‘ldo_vdmic_voltages’ defined
but not used [-Wunused-const-variable=]
static const unsigned int ldo_vdmic_voltages[] = {
^~~~~~~~~~~~~~~~~~
drivers/regulator/ab8500.c:169:27: warning: ‘fixed_3300000_voltage’
defined but not used [-Wunused-const-variable=]
static const unsigned int fixed_3300000_voltage[] = {
^~~~~~~~~~~~~~~~~~~~~
drivers/regulator/ab8500.c:142:27: warning: ‘ldo_sdio_voltages’ defined
but not used [-Wunused-const-variable=]
static const unsigned int ldo_sdio_voltages[] = {
^~~~~~~~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200410073343.39031-1-yanaijie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 99c4f70d 06-Nov-2019 Stephan Gerhold <stephan@gerhold.net>

regulator: ab8500: Remove AB8505 USB regulator

The USB regulator was removed for AB8500 in
commit 41a06aa738ad ("regulator: ab8500: Remove USB regulator").
It was then added for AB8505 in
commit 547f384f33db ("regulator: ab8500: add support for ab8505").

However, there was never an entry added for it in
ab8505_regulator_match. This causes all regulators after it
to be initialized with the wrong device tree data, eventually
leading to an out-of-bounds array read.

Given that it is not used anywhere in the kernel, it seems
likely that similar arguments against supporting it exist for
AB8505 (it is controlled by hardware).

Therefore, simply remove it like for AB8500 instead of adding
an entry in ab8505_regulator_match.

Fixes: 547f384f33db ("regulator: ab8500: add support for ab8505")
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20191106173125.14496-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0376148f 28-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 197

Based on 1 normalized pattern(s):

license terms gnu general public license v2

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 37 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Steve Winslow <swinslow@gmail.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170027.724130665@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7c6b8e3b 12-Apr-2019 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Remove *regulator from struct ab8500_regulator_info

Current code is using devm_regulator_register() so we don't need to save
*regulator for clean up, use a local variable instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6d66d995 12-Apr-2019 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Constify regulator_ops

These regulator_ops variables never need to be modified, make them const so
compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ec1ba3e5 22-Mar-2018 Linus Walleij <linus.walleij@linaro.org>

regulator: ab8500: Drop AB8540/9540 support

The AB8540 was an evolved version of the AB8500, but it was never
mass produced or put into products, only reference designs exist.
The upstream support was never completed and it is unlikely that
this will happen so drop the support for now to simplify
maintenance of the AB8500.

Cc: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6c794b26 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

regulator: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 03187c72 08-Jun-2014 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Remove ab8500_regulator_debug_init/exit()

CONFIG_REGULATOR_AB8500_DEBUG is always not defined.
ab8500_regulator_debug_init() is not called at all now,
ab8500_regulator_debug_exit() simply return 0, thus remove them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# a5c1a416 08-Jun-2014 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Remove ab8500_regulator_of_probe()

Now this is a DT-only driver because non-devicetree probe path is removed,
so merge ab8500_regulator_of_probe() into ab8500_regulator_probe().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# baafdc1d 06-Dec-2013 Jingoo Han <jg1.han@samsung.com>

regulator: ab8500: use devm_regulator_register()

Use devm_regulator_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 34c040ce 03-Dec-2013 Linus Walleij <linus.walleij@linaro.org>

regulator: ab8500: delete non-devicetree probe path

The Ux500 platform has been converted to do device-tree only
boots, no longer supports platform data passing, so this
probe path is unused. Delete it, simplifying the driver a
whole lot.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# ce6f5ea3 07-Jun-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Provide supply names for the AUX regulators

On some platforms the AUX[1|2|3] regulators are supplied voltage by
a separate regulator. For example on Snowball these are provided by
the EXT3. If we list them here, we can supply voltage to them by
simply listing them in as a consumer of EXT3 in the Snowball case.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonielinaro.org>


# 5a49b4a5 07-Jun-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500-ext: Register as a device in its own right

Some platforms don't support the AB8500 external regulators, so instead
of having a list of is_<platform>() calls prior to calling
ab8500_ext_regulator_init() from ab8500_regulator_probe(), we can only
register as a platform device on platforms which require them. It means
we also have more control over them when booting with Device Tree.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonielinaro.org>


# 5510ed9f 30-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

ARM: ux500: Correct anamic2 typo in DT files

Fix typo of VAMIC2 LDO regulator name in some DT-related files. This
patch replaces all occurrences with the right name.

Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 5d9de8b1 17-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Get rid of voltage_shift field from struct ab8500_regulator_info

The voltage_shift can be calculated from voltage_mask.
Let's remove voltage_shift fied from struct ab8500_regulator_info, this change
can prevent missing voltage_shift setting issue.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 9135d3bc 17-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Remove unused voltage_shift field from struct expand_register

The voltage_shift field of struct expand_register is not used now, remove it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# b4d12a79 16-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Fix set voltage for AB8540_LDO_AUX3

When setting voltage for AB8540_LDO_AUX3, current code only updates one of
info->voltage_reg and info->expand_register registers which is wrong.
To ensure we set to correct voltage, it always needs to clear or set
expand_register.voltage_mask bit of expand_register.

The function of the expand register bit is the following (from the user manual):
0: VAUX3 output voltage is determined by Vaux3Sel bit settings in register
VldoCVaux3Sel
1: VAUX3 output voltage is set to 3.05V regardless of Vaux3Sel settings in
register VldoCVaux3Sel (VldoCVaux3Sel is the register at 0x0421)

So when going to 3.05V, set the expand register bit.
When leaving 3.05V for another voltage, set the target voltage before clearing
the expand register bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 0b665062 09-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Don't update lp_mode_req flag in set_mode() error paths

Currently, set invalid mode setting for shared mode regulators may change
sm->lp_mode_req flag. This patch ensures we don't set lp_mode_req flag to wrong
status if set_mode() fails.

This patch includes some clean up, and these changes makes this patch looks like
code refactor. The clean up is mainly to avoid adding ugly code to handle
failure paths.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# f04adc5a 09-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Don't update info->update_val if write to register fails

This patch ensures info->update_val is consistent with current register value.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 241896ce 10-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Optimize ab8540_aux3_regulator_get_voltage_sel

We can save a register read operation in some case if read
expand_register first.
If info->expand_register.voltage_mask bit is set, no need to read
voltage_reg.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 375dc9c1 15-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Fix voltage_shift setting for AB8540_LDO_DMIC

The voltage_mask is 0xc0, thus we need to set voltage_shift = 6 to get correct
selector in get_voltage_sel and set_voltage_sel.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# e4fc9d6d 12-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Fix voltage_mask for AB8505_LDO_AUDIO

The voltage_mask and voltage_shift settings of AB8505_LDO_AUDIO are not matched.
It looks like a typo in the voltage_mask settings.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 42e8c811 10-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Unregister ab8500-ext regulators in probe() failure path

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 3480c0ca 10-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500-ext: Make the return type of ab8500_ext_regulator_exit() void

ab8500_ext_regulator_exit() never fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 438e695b 07-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info

The intention of this patch is to simplify the code.

Maintain the is_enabled flag is not trivial, it not only needs to set/clear the
flag in disable()/enable() but also needs to set the flag in is_enable() to get
initial status. The only benefit of keeping is_enabled flag is just save a
register read when set_mode(). Remove is_enabled flag makes the code simpler.

This patch also moves ab8500_regulator_is_enabled() close to
ab8500_regulator_[en|dis]able functions.
This is required to avoid a forward declaration because now we call
ab8500_regulator_is_enabled() in ab8500_regulator_set_mode().
This change also makes the code better in readability by moving similar
functions to one place.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# cd2a55d2 03-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Remove ab8500_regulator_set_voltage_time_sel

All users of ab8500_regulator_volt_mode_ops and ab8500_regulator_volt_ops
do not set info->desc.enable_time, thus set_voltage_time_sel() always returns 0.
Remove it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# aca45e9e 02-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Add missing volt_table setting for AB8540_LDO_TVOUT

This is required for regulator_list_voltage_table() to properly work.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d7816ab0 02-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Fix list_voltage for fixed voltage regulators

commit b080c78a4e447e9c212c207f725999d4e32c5f19
"regulator: ab8500: Update voltage handling for fixed voltage regulators"
removes min_uV settings and sets volt_table for all fixed voltages, thus
we can not use regulator_list_voltage_linear now. Use
regulator_list_voltage_table instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# da45edc7 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Shuffle init functions into a more logical order

The ab*_match[] arrays should be moved out of the way, instead of
bunched in the middle of the initialisation functions. This patch
moves all initialisation code which currently resides above these
arrays down to be grouped with the others. This makes the whole
thing slightly easier to read.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d3193103 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Use regulator_list_voltage_table() to look-up voltages

The regulator framework offers a generic regulator_list_voltage_table()
function which can directly look-up a regulator's voltage capabilities
using a table provided through the desc structure. This patch ensures
that information is available.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5fc9da6d 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Remove the need for a 'delay' property

The regulator framework now has provisions to read a regulator's
start-up time via the 'enable_time' attribute. So let's remove all
'enable_time'/'delay' duplication and just stick with 'enable_time'
from now on.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a4d68468 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Set enable enable_time in regulator_desc

Allow the regulator framework to directly access the time it takes
any given regulator to settle. This saves time and code because
without it we would have to implement a dedication function to read
the value from elsewhere.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 684d5ce4 02-Apr-2013 Zhenhua HUANG <zhenhua.huang@stericsson.com>

regulator: ab8500: Introduce aux5, aux6 regulators for AB8540

Introduce aux5, aux6 into ab8540 regulator framework.

Signed-off-by: Zhenhua HUANG <zhenhua.huang@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Maxime COQUELIN <maxime.coquelin@stericsson.com>
Reviewed-by: David PARIS <david.paris@stericsson.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 33aeb49e 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Use a struct to select the good regulator configuration

At the probe use a structure to select the good regulator array from
from ab9540, ab8505, ab8540 or ab8500 configuration.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 4c84b4dd 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Update vdmic, vamic[1|2] parameters for AB8540

Add voltage setting for vdmic; add LP mode setting for vamic1,2.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 3fe52289 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Add mode operation for v-amic

v-amic1 and v-amic2 regulators have dedicated mode registers
and share the same mode bit. This patch adds special handling
for those regulators.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d7607baf 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Add new operations for Vaux3

In former functions, only can set Vaux3 to 2.91V, because the
highest bit of Vaux3 register is put into another register. So
add new expanded functions for Vaux3's operation.

Signed-off-by: zhang xiaomei <xiaomei.zhang@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# bd44e2cb 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Also check for AB8505 based platforms

Ensure we initialise AB8505 external supply regulators.

Signed-off-by: Alexandre Torgue <alexandre.torgue@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Tested-by: Xiao Mei ZHANG <xiaomei.zhang@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 8a3b1b87 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Add voltage selection for AUDIO and ANA on AB8505

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# f7eae37f 02-Apr-2013 Rabin Vincent <rabin.vincent@stericsson.com>

regulator: ab8500: Don't register external regulators on AB8505

ExtSupply regulators are not included on AB8505 based platforms.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 0b946411 02-Apr-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Supply platform specific regulator id values

The regulator ID in the regulator info array should be the same
values as the position of the element within the array.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 62ab4111 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Use regulator_list_voltage_table()

Following a recent move to regulator_list_voltage_table() for
all previous abx500 related platforms this converts all recent
platform updates over too.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# b080c78a 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Update voltage handling for fixed voltage regulators

There are a few over-lapping methods for voltage selection operating
in the AB8500 regulator driver currently. This patch removes unused,
unnecessary variables from the regulator_info structures and provides
voltage tables for those regulators which have fixed voltages.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ae0a9a3e 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Add support for the ab8540

To obtain full AB8540 regulator support, the AB8500 regulator driver
first needs to know its register layout and their initialisation values
for each. That information is provided via a couple of large data
structures which we provide here.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 547f384f 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: add support for ab8505

To obtain full AB8505 regulator support, the AB8500 regulator driver
first needs to know its register layout and their initialisation values
for each. That information is provided via a couple of large data
structures which we provide here.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ed3c138e 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Correct TVOUT regulator enable time

Update TVOUT regulator to match specification.

Was 10ms - changed to 500us.

Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 8e6a8d7d 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Add support for the ab9540

To obtain full AB9540 regulator support, the AB8500 regulator driver
first needs to know its register layout and their initialisation values
for each. That information is provided via a couple of large data
structures which we provide here.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# b54969ac 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Prepare the driver for additional platforms

More platforms are to be supported by the AB8500 regulator driver,
so in this patch we prepare for their arrival. Instead of using
the AB8500 settings blindly, we provide an infrastructure where
adding a new platform is as easy as providing a couple of platform
specific data structures.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 742a7325 28-Mar-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Update info->update_val only when successfully update register

Don't update info->update_val if write to the register fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# da0b0c47 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Init debug from regulator driver

The purpose of this patch is to guarantee that ab8500-debug will
record the regulator registers before they are modified by the
ab8500 regulator driver.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 41a06aa7 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Remove USB regulator

The USB regulator is controlled by hardware. The software support
was only needed for early hardware (ED) which is no longer supported.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d1a82001 28-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500-ext: New driver to control external regulators

The ABx500 is capable of controlling three external regulator supplies.
Most commonly on and off are supported, but if an external regulator
chipset or power supply supports high-power and low-power mode settings,
we can control those too.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# cc40dc29 21-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Amend the update value for AB8500_LDO_INTCORE regulator

The issues probably originated from a typo in the initial submission.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 43a5911b 21-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Clean out SoC registers

Clean out initialisation that is handled by SoC. Regulator
settings for Vpll (partly), Vsmps1, Vsmps2, Vsmps3 (partly),
Vrf1, Varm, Vape, Vbb, Vmod are cleaned out. They should not
be touched by the kernel.

We also update many of the initialisation values to be more
in-line with the current development efforts of ST-Ericsson
internal engineers.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 29234928 27-Mar-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Remove set_voltage_time_sel and delay setting

The data sheet does not specify time delay for voltage selection,
thus remove set_voltage_time_sel and delay setting.

Note, currently set_voltage_time_sel callback returns 0 due to missing
delay settings.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 530158b6 27-Mar-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Add missing enable_time settings

Base on the data provide by Bengt Jönsson, add below enable_time settings:

Worst case enable time from data sheet:
Vana: enable time = 140 us
Vaux1/2: enable time = 200 us
Vaux3: enable time = 450 us
Vintcore: enable time = 750 us
Vamic1/2: enable time = 500 us
Vdmic: enable time = 420 us
VTVout: enable time = 500 us
Vaudio: enable time = 140 us
Vusb: enable time = 150 us

This discussion thread is available at: https://lkml.org/lkml/2013/3/26/795

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# f71bf528 26-Mar-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Don't update is_enabled flag in error paths

This avoid setting is_enabled flag to wrong status if enable/disable fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5689e830 25-Mar-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Use regulator_list_voltage_linear for fixed voltage

Both ab8500_regulator_mode_ops and ab8500_regulator_ops do not have volt_table
setting, thus we can not use regulator_list_voltage_table for them.
However, they have min_uV setting with n_voltages = 1, so use
regulator_list_voltage_linear instead.

Also remove setting set_voltage_time_sel for ab8500_regulator_mode_ops.
It is used only for fixed voltage, so it does not need to implement
set_voltage_time_sel.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 328a5369 25-Mar-2013 Axel Lin <axel.lin@ingics.com>

regulator: ab8500: Fix build error

Fix below build error:

CC drivers/regulator/ab8500.o
drivers/regulator/ab8500.c:500:23: error: 'ab8500_regulator_fixed_ops' undeclared here (not in a function)
drivers/regulator/ab8500.c: In function 'ab8500_regulator_probe':
drivers/regulator/ab8500.c:972:8: warning: assignment from incompatible pointer type [enabled by default]
make[2]: *** [drivers/regulator/ab8500.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 732805a5 21-Mar-2013 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulator: ab8500: Separate regulator and MFD platform data

The ab8500 MFD should not have knowledge about regulator-
specific platform data like number of regulators and
regulator registers. As the regulator platform data is
about to grow with external regulators, this information
is moved to a new structure provided by the regulator
driver.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Yvan FILLION <yvan.fillion@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 33bc8f46 21-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Another push to synchronise recent AB8500 developments

This patch ensures that many of the recent developments pertaining to
the AB8500 regulator device are propagated out into the public arena.
It aims to update some of the existing initialisation values in
accordance with internal ST-Ericsson code submissions. This single
patch was originally a collection of updates which have been squashed
together to aid with clarity.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 3c1b8438 21-Mar-2013 Lee Jones <lee.jones@linaro.org>

ARM: ux500: regulators: Add mask for configuration

There is already before a register mask in the regulator driver
to allow some bits of a register to be initialized. The register
value is defined in the board configuration. This patch puts a
mask in the board configuration to specify which bits should
actually be altered. The purpose with this patch is to avoid
future mistakes when updating the allowed bits in the regulator
driver.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 7ce4669c 21-Mar-2013 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulator: ab8500: Added get_optimum_mode on regulators with idle mode

With this change, Vtvout, Vintcore12, Vaux1, 2 and 3 regulators
support DRMS (Dynamic Regulator Mode Switching) which will
dynamically handle requests for max current consumption from
several consumers and select a suitable regulator mode.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# bd28a157 21-Mar-2013 Emeric Vigier <emeric.vigier@stericsson.com>

regulator: ab8500: Add set_mode/get_mode support

Signed-off-by: Ludovic Barré <ludovic.barre@stericsson.com>
Signed-off-by: Emeric Vigier <emeric.vigier@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d79df329 21-Mar-2013 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Further populate initialisation registers

This patch supplies access to some extra settings provided by the
AB8500 regulator device. We also update some of the existing
initialisation values in accordance with internal ST-Ericsson code
submissions. This single patch was originally a collection of updates
which have been squashed together to aid with clarity.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 8dc995f5 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

regulator: remove use of __devexit

CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a5023574 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

regulator: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5eb9f2b9 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

regulator: remove use of __devexit_p

CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a0a7014c 20-Aug-2012 Linus Walleij <linus.walleij@linaro.org>

regulator: ab8500: provide per-regulator shift

This encodes the voltage shifts (the number of bits to shift
the register to get to the selector) into the regulator info.
We have several new variants of the AB8500 so this varies a
lot.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 0d3fb582 09-Aug-2012 Axel Lin <axel.lin@gmail.com>

regulator: ab8500: Remove get_voltage implementation for ab8500_regulator_fixed_ops

This is not required after commit f7df20ec
"regulator: core: Use list_voltage() to read single voltage regulators"

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 7fee2afb 07-Aug-2012 Axel Lin <axel.lin@gmail.com>

regulator: ab8500: Set enable enable_time in regulator_desc

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# bad76991 02-Jul-2012 Lee Jones <lee.jones@linaro.org>

mfd: Register ab8500 devices using the newly DT:ed MFD API

Now the MFD API is Device Tree aware we can use it for platform
registration again, even when booting with DT enabled. To aid in
Device Node pointer allocation we provide each cell with the
associative compatible string.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 07b9e329 07-Jun-2012 Axel Lin <axel.lin@gmail.com>

regulator: ab8500: Remove min_uV and max_uV from struct ab8500_regulator_info

The min_uV and max_uV are not really used in the code and misleading because
the min_uV and max_uV settings does not match the value in the voltage table.

For example, we have
static const unsigned int ldo_vaux3_voltages[] = {
1200000,
1500000,
1800000,
2100000,
2500000,
2750000,
2790000,
2910000,
};

With below min_uV/max_uV settings for AB8500_LDO_AUX3.
.min_uV = 1100000,
.max_uV = 3300000,

The min_uV/max_uV for AB8500_LDO_AUX3 seems copy-paste from AB8500_LDO_AUX2
and is wrong.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 7142e213 07-Jun-2012 Axel Lin <axel.lin@gmail.com>

regulator: ab8500: Use regulator_list_voltage_linear for ab8500_regulator_fixed_ops

Also removes set_voltage_time_sel callback from ab8500_regulator_fixed_ops
because the voltage won't change. ( And ab8500_regulator_fixed_ops does not
implement get_voltage_sel so set_voltage_time_sel won't be called )

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# f7f3f1ad 29-May-2012 Lee Jones <lee.jones@linaro.org>

regulator: Change ab8500 match names to reflect Device Tree

The 'name' field in 'struct of_regulator_match' expects to match with
its corresponding regulator device node in the Device Tree. This patch
renames each of the regulators in the ab8500 regulator driver so this
is true.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 7e715b95 29-May-2012 Lee Jones <lee.jones@linaro.org>

regulator: Change ab8500 match names to reflect Device Tree

The 'name' field in 'struct of_regulator_match' expects to match with
its corresponding regulator device node in the Device Tree. This patch
renames each of the regulators in the ab8500 regulator driver so this
is true.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 6333e9dd 20-May-2012 Axel Lin <axel.lin@gmail.com>

regulator: ab8500: Let regulator core handle the case no delay for setting new voltage if regulator is off

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ec1cc4d9 19-May-2012 Axel Lin <axel.lin@gmail.com>

regulator: ab8500: Use regulator_list_voltage_table()

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 3a8334b9 17-May-2012 Lee Jones <lee.jones@linaro.org>

regulator: Enable the ab8500 for Device Tree

Here we setup the ab8500 regulator driver for DT. We first do
this in the normal way, by providing a match structure during
initialisation, but then we provide information so that
whilst probing we can use existing data structures to do DT
look-ups.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a7ac1d9e 17-May-2012 Lee Jones <lee.jones@linaro.org>

regulator: ab8500: Split up probe() into manageable pieces

ab8500's probe() function is becoming quite large, so in the lead
up to Device Tree enablement which will fork the thread of execution
this patch splits it into 3 main areas; basic error checking will
remain in probe(), but regulator register initialisation and regulator
registration have been moved to their own functions which will
be called in sequence by probe() and the DT equivalent.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ac97c620 10-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

regulator: Fix build of ab8500

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# c172708d 03-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

regulator: core: Use a struct to pass in regulator runtime configuration

Rather than adding new arguments to regulator_register() every time we
want to add a new bit of dynamic information at runtime change the function
to take these via a struct. By doing this we avoid needing to do further
changes like the recent addition of device tree support which required each
regulator driver to be updated to take an additional parameter.

The regulator_desc which should (mostly) be static data is still passed
separately as most drivers are able to configure this statically at build
time.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ae713d39 19-Mar-2012 Axel Lin <axel.lin@gmail.com>

regulator: Convert ab8500 to set_voltage_sel

Convert ab8500 to set_voltage_sel and then we can remove
ab8500_get_best_voltage_index function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 3bf6e90e 24-Feb-2012 Axel Lin <axel.lin@gmail.com>

regulator: Convert ab8499 to use get_voltage_sel()

This change is required to make ab8500_regulator_get_voltage_sel work.
The regulator core will call set_voltage_time_sel only when get_voltage_sel is
implemented.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ee66e653 02-Dec-2011 Linus Walleij <linus.walleij@linaro.org>

mfd: Unify abx500 headers in mfd/abx500

This moves all the header files related to the abx500 family into
a common include directory below mfd. From now on we place any
subchip header in that directory. Headers previously in e.g.
<linux/mfd/ab8500/gpio.h> get prefixed and are now e.g.
<linux/mfd/abx500/ab8500-gpio.h>. The top-level abstract interface
remains in <linux/mfd/abx500.h>.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 2c043bcb 18-Nov-2011 Rajendra Nayak <rnayak@ti.com>

regulator: pass additional of_node to regulator_register()

With device tree support for regulators, its needed that the
regulator_dev->dev device has the right of_node attached.
To be able to do this add an additional parameter to the
regulator_register() api, wherein the dt-adapted driver can
then pass this additional info onto the regulator core.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 65602c32 17-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

regulator: Add module.h to drivers/regulator users as required

Another group of drivers that are taking advantage of the implicit
presence of module.h -- and will break when we pull the carpet out
from under them during a cleanup. Fix 'em now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# 42ab616a 17-Mar-2011 Linus Walleij <linus.walleij@linaro.org>

regulator: add ab8500 enable and raise time delays

This uses the new infrastructure to provide proper delays when
enabling or setting the voltage of one specific regulator.

Cc: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 79568b94 11-Mar-2011 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulator: initialization for ab8500 regulators

The regulators on the AB8500 have a lot of custom
hardware control settings pertaining to 8 external
signals, settings which are board-specific and need
be provided from the platform at startup.

Initialization added for regulators Vana, VextSupply1,
VextSupply2, VextSupply3, Vaux1, Vaux2, Vaux3, VTVout,
Vintcore12, Vaudio, Vdmic, Vamic1, Vamic2, VrefDDR.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Reviewed-by: Rickard Andersson <rickard.andersson@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# ea05ef31 10-Mar-2011 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulator: add support for USB voltage regulator

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 6909b452 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Removed macros for initialization of ab8500 regulators

This patch removes the macros for initializing the regulators.
The purpose is to remove one layer of abstraction and make the
code easier to read.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 09aefa12 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Added verbose debug messages to ab8500 regulators

The verbose debug outputs register writes and reads that can be
used to debug the driver.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# fc24b426 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Modified ab8500 error handling

Error handling is updated to catch NULL pointer errors.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# e1159e6d 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Updated ab8500 variable names, macro names and comments

The regulator enumeration is used for putting the regulator data
in correct place in the info array. This should be matched in the
board configuration.

Variable names are updated to be more consistent, comments are
corrected and macros have been edited to be consistent.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 2b75151a 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Added ab8500 v2 support

The AUX3 regulator voltage setting is changed in ab8500 v2 compared
to ab8500 v1. This patch adds v2 support while keeping support for
v1.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# deaca1ee 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Clean out unused code in ab8500 regulators

The find_regulator function was unused so it has been removed. The
ab8500 pointer in the regulator info structure was unused and so it
has also been removed.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 65e03ed2 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Fixed errors in ab8500 register mapping

For INTCORE and TVOUT regulators, the low power register bit is
included in the mask so that enable will set the regulator in
normal (high power) mode.

ANAMIC1, ANAMIC2, DMIC regulator settings are swapped with each
other so that the correct regulator gets enabled/disabled.

ANA regulator register address is corrected.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# cb189b07 10-Dec-2010 Bengt Jonsson <bengt.g.jonsson@stericsson.com>

regulators: Moved define for number of regulators in ab8500

The define for number of regulators is moved from ab8500-core to
ab8500-regulator so that the regulator driver can be updated
independently of ab8500-core. This also changes the platform
configuration structure of ab8500-core so that it contains a
pointer to the regulator_init_data array plus number of
regulators instead of an fixed size array of pointers to
regulator_init_data.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 3a93f2a9 10-Nov-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

regulator: Report actual configured voltage to set_voltage()

Change the interface used by set_voltage() to report the selected value
to the regulator core in terms of a selector used by list_voltage().
This allows the regulator core to know the voltage that was chosen
without having to do an explict get_voltage(), which would be much more
expensive as it will generally access hardware.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 47c16975 10-Sep-2010 Mattias Wallin <mattias.wallin@stericsson.com>

mfd: Align ab8500 with the abx500 interface

This patch makes the ab8500 mixed signal chip expose the same
interface for register access as the ab3100, ab3550 and ab5500 chip.
The ab8500_read() and ab8500_write() is removed and replaced with
abx500_get_register_interruptible() and
abx500_set_register_interruptible().

Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 49990e6e 04-Sep-2010 Axel Lin <axel.lin@gmail.com>

regulator: ab8500 - fix off-by-one value range checking for selector

selector is used as array index of info->supported_voltages
Thus the valid value range should be 0 .. info->voltages_len -1

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@openource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# d4876a3b 14-Aug-2010 Axel Lin <axel.lin@gmail.com>

regulator: ab8500 - fix the logic to remove already registered regulators in error path

In current implementation, ab8500_regulator_info[0].regulator is not
unregistered if the error happen at i > 0.

This patch fixes the resource leak and also improves the readability.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# af54decd 14-Aug-2010 Dan Carpenter <error27@gmail.com>

regulator/ab8500: move dereference below the check for NULL

I moved the dereference of "ab8500" below the check for NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# c789ca20 13-Jul-2010 Sundar R IYER <sundar.iyer@stericsson.com>

regulator: add support for regulators on the ab8500 MFD

Hi Mark,
> I think that's everything.
Please find the updated patch set as below.

>From f4bf7eec4d210db5075c0bce4521d9be6bc76c8c Mon Sep 17 00:00:00 2001
From: Sundar R Iyer <sundar.iyer@stericsson.com>
Date: Sun, 6 Jun 2010 19:12:12 +0530
Subject: [PATCH v3 1/2] regulator: add support for regulators on the ab8500 MFD

Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>