Archived
14
0
Fork 0
Commit graph

110 commits

Author SHA1 Message Date
Mark Brown
c53ad7fe57 regulator: More explict error reporting for fixed regulator
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:40 +01:00
Mike Rapoport
c6db182822 regulator: da903x: consolidate DA903[045]_DVC macros
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:39 +01:00
Mark Brown
72b86876d4 regulator: Improve virtual consumer probe error handling
Report errors to the user and try harder to clean up if we're not
able to probe.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:39 +01:00
Mark Brown
9ed2099edc regulator: Fix support for deviceless supply mappings
The patch to add support for looking up consumers by device name
had the side effect of causing us to require a device which is
at best premature since at least cpufreq still operates outside
the device model. Remove that requirement.

Reported-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:39 +01:00
Mark Brown
6bf87d17c9 regulator: Warn when unregistering an in-use regulator
We're probably going to start oopsing fairly soon after this happens.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:39 +01:00
Mark Brown
a7a1ad9066 regulator: Add regulator voltage range check API
Simplify checking of support for voltage ranges by providing an API which
wraps the existing count and list operations.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:38 +01:00
Mark Brown
5ffbd136e6 regulator: Add regulator_get_exclusive() API
Some consumers require complete control of the regulator and can't
tolerate sharing it with other consumers, most commonly because they need
to have the regulator actually disabled so can't have other consumers
forcing it on. This new regulator_get_exclusive() API call allows these
consumers to explicitly request this, documenting the assumptions that
they are making.

In order to simplify coding of such consumers the use count for regulators
they request is forced to match the enabled state of the regulator when
it is requested. This is not possible for consumers which can share
regulators due to the need to keep track of the ownership of use counts.

A new API call is used rather than an additional argument to the existing
regulator_get() in order to avoid merge headaches with driver code in
other trees.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:38 +01:00
Haojian Zhuang
c1b60873ca regulator: support list voltage in da903x
Make da903x driver to list voltage and count voltage.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:38 +01:00
Haojian Zhuang
e88267e164 regulator: replace ADTV1 register by ADTV2 in da903x
In PXA3xx SoC family, V_CORE power doamin is supplied by BUCK1 that is
controller by ADTV1 or ADTV2 register.

By default, v1 and v2 has the same copy. If v1 or v2 is updated, the last
value that is written to either register takes effect. It means that v1
and v2 has different copy. And the actual voltage output is determinated
by last update on either register.

DA9034/35 is binded with PXA3xx SoC family. While SoC is scaling OP or
entering/exiting lower power mode, SoC needs to change voltage of V_CORE
power doamin. In order to be efficient, POWER I2C (hardcode) mode could
be enabled in SoC. In this mode, SoC will control v2 register directly.

In original DA903x driver, software will only read regulator data from v1
register. But SoC controls v2 register directly. It results that v1 and v2
isn't synchronized. Wrong data will be read from v1 register. So access v2
register in da903x driver instead.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:37 +01:00
Haojian Zhuang
fc4f42e7fb regulator: support da9030 BUCK in da903x driver
Support the operation of DA9030 BUCK2 in da903x driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Acked-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:37 +01:00
Haojian Zhuang
0198d1163b regulator: add buck3 in da903x driver
BUCK3 is the new component in DA9035. So there're three BUCKs in DA9035.
And there're two BUCKs in DA9034.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:37 +01:00
Joe Perches
561864e8e3 drivers/regulator/pcf50633-regulator.c: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:36 +01:00
Mark Brown
40f9244f4d regulator: Allow consumer supplies to be set up with dev_name()
Follow the approach suggested by Russell King and implemented by him in
the clkdev API and allow consumer device supply mapings to be set up
using the dev_name() for the consumer instead of the struct device.
In order to avoid making existing machines instabuggy and creating merge
issues the use of struct device is still supported for the time being.

This resolves problems working with buses such as I2C which make the
struct device available late providing that the final device name is
known, which is the case for most embedded systems with fixed setups.

Consumers must still use the struct device when calling regulator_get().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:36 +01:00
Mark Brown
a5d2abce43 regulator: Make virtual consumer a bit more chatty
This makes it easier to read the logs when doing testing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:35 +01:00
Mark Brown
a07ac21714 regulator: Make virtual consumer use dev_printk
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:35 +01:00
Mark Brown
d61c3d56e2 regulator: Report regulator_get() failure in virtual consumer
The core will no longer complain so we should log an error here.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-09-22 13:32:35 +01:00
Roel Kluin
4dee4d441d regulator: add check index of wm8350->pmic.pdev[]
Ensure that reg is within the bounds of array wm8350->pmic.pdev[].

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>
2009-09-22 13:32:35 +01:00
Linus Walleij
75f2ba8f00 regulator: Voltage count for AB3100
This sets the number of voltages for the AB3100 regulators so that
they play well with the voltage listing functions and can be used
properly with the MMC regulator integration glue for example.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-09-17 15:48:24 +02:00
Linus Walleij
d619bc143e regulator: AB3100 support
This adds support for the regulators found in the AB3100
Mixed-Signal IC.

It further also defines platform data for the ST-Ericsson
U300 platform and extends the AB3100 MFD driver so that
platform/board data with regulation constraints and an init
function can be passed down all the way from the board to
the regulators.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-09-17 09:47:25 +02:00
Sascha Hauer
295c08bc69 regulator: Add Freescale MC13783 driver
This driver provides basic support for the voltage regulators
integrated into the Freescale MC13783 PMIC. It is currently
only possible to enable/disable outputs, not to actually
set the voltage.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-09-17 09:47:19 +02:00
Antonio Ospite
70fde5cbd4 regulator: get pcap data from the parent device
Right now the pcap core driver passes a reference to its pcap data abusing the
subdrivers platform drvdata, this is not good.

Get the reference directly from the parent device.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-09-17 09:47:13 +02:00
Antonio Ospite
e397e7ed50 regulator: register pcap earlier
Register pcap-regulator earlier so it can be used with cpufreq

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-09-17 09:47:11 +02:00
Mark Brown
d4d6b722e7 regulator: Add WM831x ISINK support
The WM831x series of PMICs provide two constant current sinks
designed to drive strings of serially connected LEDs for applications
such as backlights. This driver adds support for those regulators.

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>
2009-09-17 09:47:11 +02:00
Mark Brown
1304850d4c regulator: Add WM831x DC-DC boost convertor support
The WM831x series of PMICs include a single DC-DC boost convertor.
This adds basic support for this convertor.

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>
2009-09-17 09:47:10 +02:00
Mark Brown
8267a9ba82 regulator: Add WM831x EPE support
The WM831x series of PMICs provide two optional outputs for
controlling external devices during power sequencing, for example
an external regulator. While in essence these are GPIOs the
hardware presents them as DCDCs with very little control so
provide support via the regulator API in that fashion.

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>
2009-09-17 09:47:10 +02:00
Mark Brown
d1c6b4fe66 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>
2009-09-17 09:47:09 +02:00
Mark Brown
e4ee831f94 regulator: Add WM831x DC-DC buck convertor support
The WM831x series of devices all have 3 DC-DC buck convertors. This
driver implements software control for these regulators via the
regulator API.  Use with split hardware/software control of individual
regulators is not supported, though regulators not controlled by
software may be controlled via the hardware control interfaces.

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>
2009-09-17 09:47:06 +02:00
Mark Brown
be721979dd regulator: Provide mode to status conversion function
This is useful for implementing get_status() in terms of get_mode().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-09-17 09:47:05 +02:00
Daniel Ribeiro
39b1772a24 regulator: add pcap driver
Add (partial) support for the voltage regulators on the PCAP2 PMIC.

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-09-17 09:46:49 +02:00
Philipp Zabel
c8f1e5025c regulator/max1586: fix V3 gain calculation integer overflow
On Thu, May 28, 2009 at 10:59 AM, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> On Thu, May 28, 2009 at 07:15:16AM +0200, Philipp Zabel wrote:
>> The V3 regulator can be configured with an external resistor
>> connected to the feedback pin (R24 in the data sheet) to
>> increase the voltage range.
>>
>> For example, hx4700 has R24 = 3.32 kOhm to achieve a maximum
>> V3 voltage of 1.55 V which is needed for 624 MHz CPU frequency.
>>
>> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
>
> Looks good.
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Thanks, but it turns out I hit a 32 bit integer overflow in
the gain calculation. I'd like to mend that with the following
patch. Now max_uV could be increased up to 4.294 V, enough to
charge LiPo cells.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:27 +01:00
Philipp Zabel
b110a8fb24 regulator/max1586: support increased V3 voltage range
The V3 regulator can be configured with an external resistor
connected to the feedback pin (R24 in the data sheet) to
increase the voltage range.

For example, hx4700 has R24 = 3.32 kOhm to achieve a maximum
V3 voltage of 1.55 V which is needed for 624 MHz CPU frequency.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:26 +01:00
Liam Girdwood
6113c3a5a6 regulator: lp3971 - fix driver link error when built-in.
lp3971_i2c_remove' referenced in section `.data' of drivers/built-in.o:
defined in discarded section `.devexit.text' of drivers/built-in.o

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:26 +01:00
Marek Szyprowski
0cbdf7bce5 LP3971 PMIC regulator driver (updated and combined version)
This patch adds regulator drivers for National Semiconductors LP3971 PMIC.
This LP3971 PMIC controller has 3 DC/DC voltage converters and 5 low
drop-out (LDO) regulators. LP3971 PMIC controller uses I2C interface.

Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:26 +01:00
Greg Kroah-Hartman
1909e2f658 regulator: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:25 +01:00
Mark Brown
38c53c8913 regulator: Set MODULE_ALIAS for regulator drivers
Several of the regulator drivers didn't have MODULE_ALIAS so couldn't be
auto loaded. Add the MODULE_ALIAS in case they do get built as modules.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:24 +01:00
Mark Brown
9035cefc2d regulator: Support list_voltage for fixed voltage regulator
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:24 +01:00
Mark Brown
5a1b22beef regulator: Move regulator drivers to subsys_initcall()
Regulators need to be available early in init in order to allow them
to be available for consumers when requested. This is generally done
by registering them at subsys_initcall() time but not all regulator
drivers have done that. Convert these drivers to do so in order to
mimimise future support.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:23 +01:00
Liam Girdwood
7c314991d7 regulator: build fix for powerpc - renamed show_state
This patch fixes the follwing build failure on powerpc:-

> Today's linux-next build (powerpc allyesconfig) failed like this:
>
> drivers/regulator/userspace-consumer.c:43: error: conflicting types
> for 'show_state'
> include/linux/sched.h:273: note: previous definition of 'show_state'
> was here
>
> Caused by commit 5defa2bce704ca4151cfe24e4297aa7797cafd22 ("regulator:
> add userspace-consumer driver") which I have reverted for today.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:23 +01:00
Mike Rapoport
1d98cccf7f regulator: add userspace-consumer driver
The userspace-consumer driver allows control of voltage and current
regulator state from userspace. This is required for fine-grained
power management of devices that are completely controller by userspace
applications, e.g. a GPS transciever connected to a serial port.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:22 +01:00
Robert Jarzmik
55f4fa4e33 Maxim 1586 regulator driver
The Maxim 1586 regulator is a voltage regulator with 2
voltage outputs, specially suitable for Marvell PXA
chips. One output is in the range of required VCC_CORE by
the PXA27x chips, the other in the VCC_USIM required as well
by PXA27x chips.

The chip is controlled through the I2C bus.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-06-15 11:18:22 +01:00
Mike Frysinger
5b4662f098 regulator: da903x: add missing __devexit_p()
The remove function uses __devexit, so the .remove assignment needs
__devexit_p() to fix a build error with hotplug disabled.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mike Rapoport <mike@compulab.co.il>
CC: Eric Miao <eric.miao@marvell.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-05-18 11:21:10 +01:00
Mark Brown
3e59091828 regulator: Fix default constraints for fixed voltage regulators
Default voltage constraints were being provided for fixed voltage
regulator where board constraints were not provided but these constraints
used INT_MIN as the default minimum voltage which is not a valid value
since it is less than zero. Use 1uV instead.

Also set the default values we set in the constraints themselves since
otherwise the max_uV constraint we determine will not be stored in the
actual constraint strucutre and will therefore not be used.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-04-28 18:58:08 +01:00
Philipp Zabel
030853b7ab regulator/bq24022: fix bug in is_enabled function
This seems to be fallout from last October's regulator core rework.
It got noticed only because of recent regulator framework changes.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-04-28 18:58:08 +01:00
Mike Rapoport
aa61d558f0 regulator/virtual: fix strings compare predicates
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-04-28 18:58:07 +01:00
Paul Walmsley
53032dafc6 regulator core: fix double-free in regulator_register() error path
During regulator registration, any error after device_register() will
cause a double-free on the struct regulator_dev 'rdev'.  The bug is in
drivers/regulator/core.c:regulator_register():

...
scrub:
	device_unregister(&rdev->dev);
clean:
	kfree(rdev);                           <---
	rdev = ERR_PTR(ret);
	goto out;
...

device_unregister() calls regulator_dev_release() which frees rdev.  The
subsequent kfree corrupts memory and causes some OMAP3 systems to oops on
boot in regulator_get().

Applies against 2.6.30-rc3.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-04-28 18:58:07 +01:00
Diego Liziero
cd78dfc6c6 drivers/regulator: fix when type is different from REGULATOR_VOLTAGE or REGULATOR_CURRENT
When regulator_desc->type is something different from REGULATOR_VOLTAGE or REGULATOR_CURRENT
the if should probably return ERR_PTR(-EINVAL)

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

@@ expression E; constant C; @@
(
- !E == C
+ E != C
)

Signed-off-by: Diego Liziero <diegoliz@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-04-28 18:58:07 +01:00
Dan Carpenter
036de8efae unreachable code in drms_uA_update()
I removed the extra semi-colon and indented the return statement.

The unreachable code was found by smatch (http://repo.or.cz/w/smatch.git).
The patch was compile tested.

regards,
dan carpenter

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>
2009-04-28 18:58:06 +01:00
Adrian Hunter
d6bb69cfa8 regulator: twl4030 VAUX3 supports 3.0V
TWL4030 and TWL5030 support 3.0V on VAUX3.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
2009-03-31 11:29:54 +01:00
Mark Brown
ca7255614e regulator: Support disabling of unused regulators by machines
At present it is not possible for machine constraints to disable
regulators which have been left on when the system starts, for example
as a result of fixed default configurations in hardware. This means that
power may be wasted by these regulators if they are not in use.

Provide intial support for this with a late_initcall which will disable
any unused regulators if the machine has enabled this feature by calling
regulator_has_full_constraints(). If this has not been called then print
a warning to encourage users to fully specify their constraints so that
we can change this to be the default behaviour in future.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-03-31 09:56:29 +01:00
Mark Brown
50f075963f regulator: Don't increment use_count for boot_on regulators
Don't set use_count for regulators that are enabled at boot since this
stops the supply being disabled by well-behaved consumers which do
balanced enables and disabled. Any consumers which don't do disables
which are not matched by enables are unable to share regulators - shared
regulators are the common case so the API should facilitate them.

Consumers that want to disable regulators that are enabled when they
start have two options:

 - Do a regulator_enable() prior to the disable to bring the use count
   in sync with the hardware state; this will ensure that if the
   regulator was enabled by another driver then this consumer will play
   nicely with it.
 - Use regulator_force_disable(); this explicitly bypasses any checks
   done by the core and documents the inability of the driver to share
   the supply.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-03-31 09:56:29 +01:00