History log of /drivers/regulator/wm831x-ldo.c
Revision Date Author Comments
fae3b83645ec37b4f274b0bb9c602152ae10ece5 20-Feb-2014 Sachin Kamat <sachin.kamat@linaro.org> regulator: wm831x-ldo: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
8828bae464b129abed95b748263f1ab53bdc5755 11-Oct-2013 Axel Lin <axel.lin@ingics.com> 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>
e277e656804c85a0729d4fd8cdd3c8ab3e6b3b86 11-Oct-2013 Axel Lin <axel.lin@ingics.com> 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>
f3ef11b485db3fa57e635c64a3fd86533f5e42c8 23-Sep-2013 Axel Lin <axel.lin@ingics.com> regulator: wm831x-ldo: Fix max_uV for gp_ldo and aldo linear range settings

Fix the linear range settings in commit 5ff26a14c3331
"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>
fc7c60e390c9b99b28d078c27360cb6cd688cfd3 31-Aug-2013 Mark Brown <broonie@linaro.org> regulator: wm831x-ldo: Convert to devm_regulator_register()

Signed-off-by: Mark Brown <broonie@linaro.org>
41c7a879d1d637c0c9731682a822b1c3162b0764 31-Aug-2013 Mark Brown <broonie@linaro.org> regulator: wm831x-ldo: Use devm_request_threaded_irq()

devm guarantees that resources are freed in the oposite order to that in
which they are allocated.

Signed-off-by: Mark Brown <broonie@linaro.org>
dff91d0b721bf8f036c1071a8f16a7effaa87514 30-Jul-2013 Jingoo Han <jg1.han@samsung.com> regulator: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
5ff26a14c333113967f3abe5fcb81c8e49d282c0 03-Jul-2013 Mark Brown <broonie@linaro.org> regulator: wm831x-ldo: Convert to use linear ranges

Signed-off-by: Mark Brown <broonie@linaro.org>
405c54009c85cf03d459f5880744b0d4ebb892e4 03-May-2013 Axel Lin <axel.lin@ingics.com> regulator: Remove all platform_set_drvdata(pdev, NULL) in drivers

Since 0998d06310 "device-core: Ensure drvdata = NULL when no driver is bound",
this is done by driver core after device_release or on probe failure.
Thus we can remove all platform_set_drvdata(pdev, NULL) in drivers.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
8dc995f56ef7aedb41873fdeaa1971f3aa166ebd 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>
a5023574d120ca3b9337cedd4e27de90cae9aff7 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>
5eb9f2b96381ac3fa4a5910c37213c1cb62e9c65 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>
5656098e198e793f7b43a11c301b5025c6e51c9a 07-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: wm831x: Convert to IORESOURCE_REG

This was originally written by Russell King who unfortunately found
himself unable to take the patch futher.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
22c5fb6a7dc8674424394122337c84eaf48efbdf 28-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: wm831x-ldo: Add bypass support

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
363506cd71a5cafeee67b236112f1baf8c30b0ea 31-Jul-2012 Axel Lin <axel.lin@gmail.com> regulator: wm831x-ldo: Check return value of wm831x_reg_read()

wm831x_reg_read() returns negative error code on failure.
This prevents using the error code as the value read.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
eefaa3c6280f3d523348e1d200e5a8215ed66fbc 27-Jun-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: wm831x-ldo: Specify enable time for alive LDO

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
0a4796896bda399a63090dad267896ea93d44fa7 12-Jun-2012 Axel Lin <axel.lin@gmail.com> regulator: wm831x-ldo: Convert to regulator_set_voltage_sel_regmap and map_voltage

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
c2543b5f6c3e13996776079cda1007ef6e7a0bbb 31-May-2012 Axel Lin <axel.lin@gmail.com> regulator: wm831x-ldo: Use regulator_map_voltage_linear for wm831x_alive_ldo_ops

wm831x_alive_ldo_ops uses simple linear voltage maps.
Thus use regulator_map_voltage_linear is more efficient than using the default
regulator_map_voltage_iterate.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
cd99758ba3bde64347a8ece381cbae2fb5c745b2 14-May-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Convert wm831x to irq_domain

The modern idiom is to use irq_domain to allocate interrupts. This is
useful partly to allow further infrastructure to be based on the domains
and partly because it makes it much easier to allocate virtual interrupts
to devices as we don't need to allocate a contiguous range of interrupt
numbers.

Convert the wm831x driver over to this infrastructure, using a legacy
IRQ mapping if an irq_base is specified in platform data and otherwise
using a linear mapping, always registering the interrupts even if they
won't ever be used. Only boards which need to use the GPIOs as
interrupts should need to use an irq_base.

This means that we can't use the MFD irq_base management since the
unless we're using an explicit irq_base from platform data we can't rely
on a linear mapping of interrupts. Instead we need to map things via
the irq_domain - provide a conveniencem function wm831x_irq() to save a
small amount of typing when doing so. Looking at this I couldn't clearly
see anything the MFD core could do to make this nicer.

Since we're not supporting device tree yet there's no meaningful
advantage if we don't do this conversion in one, the fact that the
interrupt resources are used for repeated IP blocks makes accessor
functions for the irq_domain more trouble to do than they're worth.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
d31e954e07c838f44183addeecc7115d25e83266 09-May-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: wm831x: Convert to regulator_list_voltage_linear()

Only the alive LDOs can actually use this as all the other regulators have
two linear ranges.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
b7ca87884b138f27f042dd32bd16e9a9f295da77 10-May-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: wm831x: Register all normal regulators

Register all normal regulators rather than skipping unconfigured ones now
that the core can handle regulators without init data. Skip the boost and
isink regulators since they are normally controlled by other drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
f1aba13fbdcccd36c4ed4b0c1aa910bb05a0fd01 28-Mar-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: wm831x-ldo: Set up supply names

Allows hookup via normal consumer mechanisms.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ca8c361b4aadcf4379c09fc3de3606cab671722a 15-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: wm831x-ldo: Use generic regmap enable/disable operations

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
ac663b472c6c04e3257c60816e01a05c2a02d0d3 15-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: wm831x-ldo: Use regulator_get_voltage_sel_regmap()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
c172708d38a401b2f3f841dfcd862b469fa0b670 04-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>
6085d4d9c39a49f647c57288a245386f797d1001 29-Mar-2012 Axel Lin <axel.lin@gmail.com> regulator: Trivial comment fix for wm831x-ldo driver

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
e841a36abb0f95ea356d52e4386b8e8f762e9c40 29-Mar-2012 Axel Lin <axel.lin@gmail.com> regulator: Fix setting low power mode for wm831x aldo

Set BIT[8] of LDO7 ON Control mode for low power mode.

R16507 (407Bh) LDO7 ON Control
BIT[8] LDO7_ON_MODE: LDO7 ON Operating Mode
0 = Normal mode
1 = Low Power mode

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
fded2f4faee7670b0545ac05bd2b3ed6b9afcda2 14-Dec-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: Convert wm831x regulator drivers to devm_kzalloc()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2c043bcbf287dc69848054d5c02c55c20f7a7bc5 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>
137a6354305455d585fe99fe5e9949acd895b045 25-Jul-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: Fix WM831x regulator ID lookups for multiple WM831xs

With multiple wm831x devices the device IDs used for the regulators will
not always be contiguous so simply taking the modulus is not sufficient
to look up the ID, we need to reverse the way the ID is generated.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
dfda9c27ba15330f37453c389d775ecf9e981d05 01-Mar-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: Convert WM831x regulators to genirq

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
afb8bb805bb9336ec1f7b74e7b5c0e9baceb42c1 10-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: Convert WM831x drivers to use get_voltage_sel()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
3a93f2a9f4d8f73d74c0e552feb68a10f778a219 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>
e260999c66768c2fccd9da8c3918b4e0e5121b3a 06-Sep-2010 Axel Lin <axel.lin@gmail.com> regulator: wm831x-ldo - fix the logic to set REGULATOR_MODE_IDLE and REGULATOR_MODE_STANDBY modes

Problem description in current implementation:
When setting REGULATOR_MODE_IDLE mode, current implementation set
WM831X_LDO1_LP_MODE bit of ctrl_reg (which is wrong, it should clear the bit).
But due to a missing break statement for case REGULATOR_MODE_IDLE, the code
fall through to case REGULATOR_MODE_STANDBY and then clear
WM831X_LDO1_LP_MODE bit. So it still looks OK when checking the status
by wm831x_gp_ldo_get_mode().

When setting REGULATOR_MODE_STANDBY mode, it just does not work.
wm831x_gp_ldo_get_mode() will still return REGULATOR_MODE_IDLE because
the accordingly WM831X_LDO1_LP_MODE bit is clear.

Correct behavior should be:
Clear WM831X_LDO1_LP_MODE bit of ctrl_reg for REGULATOR_MODE_IDLE mode.
Set WM831X_LDO1_LP_MODE bit of ctrl_reg for REGULATOR_MODE_STANDBY mode.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
eb66d565e8eb73ab0c471fd3dac822dc663fe8ea 24-Feb-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> Regulators: wm831x-xxx - clean up driver data after removal

It is a good tone to reset driver data after unbinding the device.
Also set up drivers owner.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
6f17c65240e35ae99319c659c74d54100a832f45 15-Dec-2009 Roel Kluin <roel.kluin@gmail.com> regulator: wm831x_reg_read() failure unnoticed in wm831x_aldo_get_mode()

ret should be signed to notice a failure in wm831x_reg_read().

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
9a767d43fbddb3319dca568df49c48e0d1bb6bd8 16-Oct-2009 Roel Kluin <roel.kluin@gmail.com> regulator: Fix check of unsigned return value and transmit errors in wm831x_gp_ldo_get_mode()

If ret is unsigned, the checks for negative wm831x_reg_read() return values
are wrong. The error value should be transmitted to its caller, e.g.
wm831x_gp_ldo_get_status() which tests for a negative return value.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
d1c6b4fe668b2ae02f490deee86eaab60822a362 28-Jul-2009 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: Add WM831x LDO support

The WM831x series of devices provide three types of LDO:

- General purpose LDOs supporting voltages from 0.9-3.3V
- High performance analogue LDOs supporting voltages from 1-3.5V
- Very low power consumption LDOs intended to support always on
functionality.

This patch adds support for all three kinds of LDO. Each regulator
is probed as an individual platform device with resources used to
provide the register map location of the regulator. Mixed hardware
and software control of regulators is not current supported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>