[go: nahoru, domu]

History log of /drivers/regulator/mc13xxx-regulator-core.c
Revision Date Author Comments
7dd33c1d57b057c3b8eda8effa72667ec798a814 08-Jun-2014 Alexander Shiyan <shc_work@mail.ru> regulator: mc13xxx: Remove unnecessary locks

Read-modify-write sequence is already protected by regmap, so no
additional locks need. This patch remove such locks from mc13xxx
regulator driver.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>
b431e69a6f2eef526e07819bb8a78d5d2876ff62 02-Mar-2014 Alexander Shiyan <shc_work@mail.ru> regulator: mc13xxx: Fix probing with DT

The nodes of regulators should be retrieved from parent device.
Bug was be introduced by commit (regulator: mc13xxx: Fix NULL
pointer error in non-DT mode) in conjuction with (mfd: Revert
"mfd: Always assign of_node in mfd_add_device()").

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>
bf7f882b1ecef99eedfe36c214458fd457cf7d86 25-Feb-2014 Sachin Kamat <sachin.kamat@linaro.org> regulator: mc13xxx: Fix NULL pointer error in non-DT mode

Add a check to avoid NULL pointer dereference error when
booted in non-DT mode. While at it also remove the additional
of_node_get which is no longer needed for of_get_child_by_name
and fix the node pointer.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reported-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Mark Brown <broonie@linaro.org>
fc5a6e5b0cf107517910b139e3d3af803fa09952 14-Feb-2014 Sachin Kamat <sachin.kamat@linaro.org> regulator: mc13xxx: Use of_get_child_by_name

of_find_node_by_name walks the allnodes list, and can thus walk
outside of the parent node. Use of_get_child_by_name instead.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
eb0d8e7a14041e30f74f63dca12e0f49ee0bec39 27-Apr-2013 Alexander Shiyan <shc_work@mail.ru> regulator: mc13xxx: Add warning of incorrect names of regulators

This patch adds a warning about incorrect regulators instead of
printing the names of non-information message about the wrong amount.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
86f6673325e38274c55f3df9f919d9a618f100d4 30-Jan-2013 Axel Lin <axel.lin@ingics.com> regulator: mc13xxx: Use of_get_child_count()

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
c92f5dd2c42fa61e0ef810fad4584b184ea2d50e 27-Jan-2013 Axel Lin <axel.lin@ingics.com> regulator: Add missing of_node_put()

of_find_node_by_name() returns a node pointer with refcount incremented, use
of_node_put() on it when done.

of_find_node_by_name() will call of_node_put() against from parameter,
thus we also need to call of_node_get(from) before calling
of_find_node_by_name().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2c8a5dcaa4143dfedf956a5349216ded3c3ad085 21-Jan-2013 Matt Sealey <matt@genesi-usa.com> regulator: mc13892: sanity check num_regulators parsed vs. registered

Imagine a situation where a device tree has a few regulators in an
appropriate node:

regulators {
sw1 {
..
};

vvideo {
..
};

:

vfake {
..
};

vtypo {
..
};
};

In the above example, the node name "vfake" is an attempt to match a
regulator name inside the driver which just so happens to not exist. The
node name "vtypo" represents an accidental typographical error in a
regulator name which may have been introduced to a device tree.

In these cases, the number of regulators the mc13892 driver thinks it has
does not match the number of regulators it parsed and registered. Since
it will go over this array based on this number, it will actually
re-register regulator "0" (which happens to be SW1) over and over
again until it reaches the number, resulting in messages on the kernel
log such as these:

SW1: at 1100 mV
VVIDEO: at 2775mV
:
SW1: at 1100 mV
SW1: at 1100 mV

.. up to that number of "mismatched" regulators. Nobody using DT can/will
consume these regulators, so it should not be possible for it to cause any
real regulator problems or driver breakages, but it is an easy thing to
miss in a kernel log and is an immediate indication of a problem with the
device tree authoring.

This patch effectively sanity checks the number of counted children of
the regulators node vs. the number that actually matched driver names,
and sets the appropriate num_regulators value. It also gives a little
warning for device tree authors that they MAY have screwed something up,
such that this patch does not hide the device tree authoring problem.

Signed-off-by: Matt Sealey <matt@genesi-usa.com>
Tested-by: Steev Klimaszewski <steev@genesi-usa.com>
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>
b571dc38d447fb34db39496b8a236946ff9baf34 10-Aug-2012 Axel Lin <axel.lin@gmail.com> regulator: mc13xxx: Remove get_voltage implementation for single voltage regulators

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>
13407ea802ad8ca4e830cee344e2d38dbce730f5 13-Jul-2012 Axel Lin <axel.lin@gmail.com> regulator: mc13xxx: Populate selector from mc13xxx_fixed_regulator_set_voltage

This was missing until now and the underlying
_regulator_do_set_voltage is using this value when calling list_voltage.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2c19ad43d1a4b0e376a0c764e3c2350afd018fac 19-Jun-2012 Axel Lin <axel.lin@gmail.com> regulator: mc13xxx: Remove mc13xxx_sw_regulator_is_enabled function

If .is_enabled callback is not implemented, regulator core assumes that the
regulator is always on. Thus we don't need mc13xxx_sw_regulator_is_enabled
function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
34e74f39fa9a2c1489444266cc9e973dc1b3a419 08-Jun-2012 Axel Lin <axel.lin@gmail.com> regulator: mc13xxx: Convert to regulator_list_voltage_table

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ee5e6253ac22210da892435711890fa2272daa41 08-Jun-2012 Axel Lin <axel.lin@gmail.com> regulator: mc13xxx: Fix voltage checking for mc13xxx_fixed_regulator_set_voltage

The voltage range checking should be to ensure mc13xxx_regulators[id].voltages[0]
falls with min_uV and max_uV.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
939b62d897d80be2b4632dd81a838d29e1f5f1e3 20-Mar-2012 Axel Lin <axel.lin@gmail.com> regulator: Convert mc13xxx regulator drivers to set_voltage_sel

Convert mc13892_sw_regulator_ops and mc13xxx_regulator_ops to set_voltage_sel.
mc13xxx_get_best_voltage_index function is not used now, remove it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
532691635475487b8c1d6fc618bd123084904897 09-Feb-2012 David Miller <davem@davemloft.net> regulator: Fix mc13xxx regulator modular build (again)

Since mc13xxx-regulator-core.c and the actual drivers can get built
into seperate modules, you have to export the DT support symbols
"mc13xxx_get_num_regulators_dt" and "mc13xxx_parse_regulators_dt"
otherwise the allmodconfig build fails on sparc64.

[Updated the subject; the same thing was previously reported and fixed
in -next but for some reason nobody noticed for some considerable time
after the issue was introduced -- broonie]

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2343933921efd553dea888fc844abb653824c4c8 24-Jan-2012 Fabio Estevam <fabio.estevam@freescale.com> regulator: mc13xxx-regulator-core: Fix the build when driver is selected as module

Fix the following build error when mc138xxx driver is built as module:

ERROR: "mc13xxx_parse_regulators_dt" [drivers/regulator/mc13892-regulator.ko] undefined!
ERROR: "mc13xxx_get_num_regulators_dt" [drivers/regulator/mc13892-regulator.ko] undefined!

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
93bcb23b38f634e8fb4ddda0d3f4862fda5cedae 21-Dec-2011 Shawn Guo <shawn.guo@linaro.org> regulator: mc13892: add device tree probe support

It adds device tree probe support for mc13892-regulator driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
65602c32ee9b5500e3cb617ccec2154ee2191898 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>
3c24019ddeab71ddf125ad2ad13a38041655c1fd 18-May-2011 Axel Lin <axel.lin@gmail.com> regulator: Fix off-by-one value range checking for mc13xxx_regulator_get_voltage

We use val as array index,
thus the valid value rangae for val should be 0 .. n_voltages-1.

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>
4b2f67d756cf4a5ed8e8d11caa7dcea06c41a09e 23-Feb-2011 Jesper Juhl <jj@chaosbits.net> regulator, mc13xxx: Remove pointless test for unsigned less than zero

The variable 'val' is a 'unsigned int', so it can never be less than zero.
This fact makes the "val < 0" part of the test done in BUG_ON() in
mc13xxx_regulator_get_voltage() rather pointles since it can never have
any effect.
This patch removes the pointless test.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
4d7071f1fdc9c27e15e8aaede27bef9f4feccafe 15-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> regulator: Allow modular build of mc13xxx-core

Since the MFD core for this device and the regulator drivers for these
devices can be built modular we should also support modular build of
the shared code for the regulator drivers, otherwise we try to link
built in code against modular code with unfortunate results.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
167e3d8af98a111994c4d6b3c5cbc589aedbbc2a 14-Dec-2010 Yong Shen <yong.shen@linaro.org> make mc13783 regulator code generic

move some common functions and micros of mc13783 regulaor driver to
a seperate file, which makes it possible for mc13892 to share code.

Signed-off-by: Yong Shen <yong.shen@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>