Commit Graph

1778 Commits

Author SHA1 Message Date
Ke Liu 926986f176 regulator: onsemi-ncp6335d: add list_voltage callback function
This callback function can help perform validation of the
regulator-min-microvolt and regulator-max-microvolt properties at runtime
automatically.

Change-Id: I63917e06c4fa881f67d938d0c53e7ad71ebda25f
Signed-off-by: Ke Liu <keliu@codeaurora.org>
2014-01-21 09:54:01 -08:00
Ke Liu dca5415671 regulator: fan53555: add support for device tree and option 13 feature
Add device tree support. Add support for restoring voltage select register
from back up register. Add support for setting vsel pin by gpio output
according to device tree information. Add option to disable regulator
suspend method. Add set_voltage_time_sel to regulator_ops. Add support for
option 13's voltage range.

Change-Id: Iab9b160ff83c66f59cccedbd23d4aed7acb7d7a3
Signed-off-by: Ke Liu <keliu@codeaurora.org>
2014-01-20 16:40:16 -08:00
Ke Liu b81edfe6d5 regulator: onsemi-ncp6335d: add support for device tree
Add device tree support. Add support for restoring working register
from back up register. Add support for setting vsel pin by gpio output
according to device tree flag. Change ncp6335d_regulator_init into a
global function.

Signed-off-by: Ke Liu <keliu@codeaurora.org>
Change-Id: I5ce861dd307b28e0782d051b105956b10eb1afab
2014-01-15 16:02:34 -08:00
David Collins 94da2480fd regulator: move the rpm-regulator-smd driver to drivers/regulator directory
Move the rpm-regulator-smd driver from the arch/arm/mach-msm
directory into the drivers/regulator directory.  Also rename it
from rpm-regulator-smd.c to rpm-smd-regulator.c so that it
matches the naming scheme of the other regulator drivers. Moving
this driver out of the arch/arm/mach-msm directory allows it to
be shared with architectures other than 'arm'.

Also move the header file from the arch/arm/mach-msm/include/mach
directory into the include/linux/regulator directory.  Moving the
header file requires updating all drivers which include it.

Change the compatible property values so that they match the new
driver name.

Change-Id: I20f2a4503c198ba9d1d04a77b03411dcc98e8aa1
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-12-19 15:27:48 -08:00
David Collins e1832733c6 regulator: qpnp-regulator: fix qpnp_print_actions const usage
The const keyword is not being used correctly for the
qpnp_print_actions array in qpnp-regulator.c.  The array pointer
itself should be specified as const as well.

Change-Id: I0d6f2323d3add646696a7d1453cb58300258c215
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-12-18 16:41:31 -08:00
Ian Maund f06163e6d0 msm: reap unused kernel files
This change removes source files from the kernel tree that
were not being used during make. The list of used files
was generated using an annotated make log and was then
compared with new files added since the public release of
kernel version 3.10.00. New files which were added but
not used have been removed from the tree.

A diff was also run to determine the list of files that had
been modified since the release of kernel version 3.10.00.
These files were then scrubbed based on the current kernel
configuration, removing invalid and unused conditionals.

Some files which support planned functionality or are
useful in debugging have been excluded from this reap.

Change-Id: Ia44a224d3cea7bc78dd45e8a8279860d35d4b008
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2013-11-21 17:45:28 -08:00
Ashay Jaiswal a4c0413573 regulator: qpnp-regulator: Add support for ULT LDO and SMPS regulators
Add support for QPNP PMIC ULT LDO and SMPS regulators.
ULT LDO/SMPS are regulators designed for PMIC chips with minimal
set of features to achieve better area efficiency.

Change-Id: I52ef77d5c60713c9bd2dfc5e3cde5f4df44ebacd
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2013-10-22 10:41:03 +05:30
David Collins cce20202de Revert "regulator: Enable supply regulator if child rail is enabled."
This reverts commit b2296bd43e.

The change results in the following incorrect behavior.
If a given regulator has a parent supply and the regulator is
enabled either before or during regulator_register(), then
regulator_enable() is called on the supply.  Unfortunately, there
is no matching regulator_disable() call.  This means that the
parent supply will stay enabled forever even if the child is
disabled later.

The stated goal of the change was to enable the parent of a
regulator which was enabled based on its machine constraints.
However, the only constraints that leads to enable() being called
for a regulator are boot-on or always-on.  If these have been
specified for a child regulator then they should have also been
specified for its parent regulator.  Therefore, there should be
no need to explicitly enable the parent when the child is
registered.

Change-Id: Ib8e6db65dcd44c27ef99509ff0cfd2f8e16e9f65
CRs-Fixed: 540315
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-13 16:28:28 -07:00
David Collins f095303cc3 regulator: qpnp-regulator: add support for low-noise LDO type regulators
Add support for QPNP PMIC low-noise (LN) LDO type regulators.
This type of regulator provides very clean and constant voltage
at low current.  LN LDOs are used to power oscillators and RF
buffers.

Change-Id: Ibda540899b93bbb750f554e728d118b635bdbc0f
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 17:19:43 -07:00
David Collins 19ab91a5a5 regulator: qpnp-regulator: maintain current voltage range whenever possible
Voltage spikes may occur if the voltage range of a regulator is
changed while the regulator is enabled.  Therefore, modify the
voltage setting function so that the current voltage range is
used whenever possible.

Change-Id: I13dda99c751acfe083f2bcaacf09348d317fc0e7
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 17:19:43 -07:00
David Collins d77f44e7a3 regulator: qpnp-regulator: Add support for reading all possible voltages
Extend the voltage range configuration data so that it fully
describes all possible set point values for each regulator type
in addition to specifying which range to use in the case of
overlap.

Change-Id: Ifdef83720f1c9ef6f74e64ce27ec5e7e27ccba9f
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 17:19:01 -07:00
David Collins 27f5fe3641 regulator: qpnp-regulator: Add support for boost-bypass type regulators
Add support for QPNP PMIC boost-bypass type regulators.  This
type of regulator is designed to output a configurable minimum
voltage.  If the input voltage is above the set point voltage,
then the regulator automatically enters bypass mode such that the
output voltage is equal to the input voltage.  If the input
voltage is below the set point voltage, then it is boosted up to
the set point voltage.

Change-Id: I93704339b7cb730fae099471bf8ec872dae54c04
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 17:18:39 -07:00
David Collins a0899db5e2 regulator: Call proxy-consumer functions for each regulator registered
Add a call to regulator_proxy_consumer_register() at the end of
regulator_register() and a call to
regulator_proxy_consumer_unregister() at the beginning of
regulator_unregister().  These calls ensure that proxy consumer
features may be used by any type of regulator regardless of the
driver supporting it.

Change-Id: Ia70da1df47042fa673c42f389136557f868d19a3
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 17:16:26 -07:00
David Collins bba9f3a122 regulator: qpnp-regulator: Don't print errors during probe deferral
Make the error printing statements after the qpnp-regulator
drivers calls regulator_register() conditional upon the error
code not being -EPROBE_DEFER.  This removes some unnecessary
kernel log messages that take place when a qpnp-regulator device
attempts to probe before its parent regulator.

Change-Id: I92d4ed61a238d384bae43458e3ca86c0079380c0
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 17:06:23 -07:00
David Collins cc67c9a55a regulator: qpnp-regulator: Reset OCP count during voltage switch enable
Reset the OCP counter for voltage switches which use the OCP IRQ
in the qpnp_regulator_vs_enable callback function.  Resetting the
counter here ensures that a voltage switch is always able to
reach its final output voltage when a valid load is connected if
only one OCP event occurs while enabling the switch.

Change-Id: Ie5b2d5271c81ef4b3cb9c9d874ca66af5530ddc7
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 16:33:09 -07:00
David Collins 7e93e93514 regulator: qpnp-regulator: Add support for voltage switch OCP IRQ
Add support for a voltage switch OCP interrupt handler which
toggles the switch off and back on after an overcurrent event
takes place.  This toggling should only be performed for a
specified maximum number of times with a specified delay between
subsequent retries.  Disabling a voltage switch is the only way
to clear the latched over-current state.

Change-Id: I8dbc54ff7bc54c1309ee59c1a282d5e4af2f0ec6
CRs-Fixed: 469134
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 16:23:15 -07:00
David Collins 49f9232ccf regulator: qpnp-regulator: Correct voltage switch OCP control
Correct the register values used to override and not override
voltage switch over current protection (OCP).  Also update
documentation to explain exactly how OCP enablement works.
Remove the OCP enable time delay property since it cannot be used
effectively to avoid OCP triggering due to high in-rush current.

Change-Id: I046dd3a42d3f8ec7f3b9689a958b617fbca35254
CRs-Fixed: 469134
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 16:23:15 -07:00
David Collins 0a9e29b850 regulator: qpnp-regulator: Add support to configure voltage switch mode
Add support for a device tree property, qcom,hpm-enable, which
can be used to configure a voltage switch type regulator to be in
high power mode (HPM).  When a switch is in HPM, over current
protection and soft start are enabled at all times.

The new property can also be used for other types of regulators.
However, this will likely not have the intended result as the
mode of non-voltage switch regulators is controlled at runtime
via regulator framework APIs.

Change-Id: Id3fca7ebbe3eb13b557e6d483494f218989cd64c
CRs-Fixed: 469134
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 16:23:14 -07:00
Anirudh Ghayal 6ff93ad44e regulator: ncp6335d: Add sleep mode configuration
Sleep mode configures the regulator to enter into a sleep
state when both EN and VSEL are low. There is a significant
reduction in the leakage current in this mode.

Enable the same for 8x25q.

Change-Id: I7377bf9d702633b9eddcea8f3503cc270bb95c95
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-09-04 15:45:25 -07:00
Utsab Bose 162d6320d1 regulator: onsemi-ncp6335d: Add regulator driver at subsys initcall
Add the onsemi-ncp6335d regulator driver at subsys initcall
as the regulator_get() is used by acpuclock driver at device initcall.
This resolves the dependency chain.

Signed-off-by: Utsab Bose <ubose@codeaurora.org>
Change-Id: Ia7a18218066486c40080b25d57e979372467d8bd
2013-09-04 15:40:55 -07:00
David Collins a667617270 regulator: qpnp-regulator: Assign selector value in set_voltage() callbacks
Assign a value to the selector pointer that is passed into
set_voltage() callback functions in the qpnp-regulator driver.
The value assigned to the selector pointer should correctly map
to the regulator voltage through the list_voltage() callback
function.

Change-Id: I7d72feb77e6122982a46c626741450108742fb8b
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 15:37:47 -07:00
David Collins 62ee3149f0 regulator: stub: Add device tree support
Add support into the stub-regulator driver so that stub-regulator
devices may be specified via device tree.

Change-Id: Ib72ef7c8caacb50955cd7c182e790300daf152ce
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 15:30:33 -07:00
Anirudh Ghayal 990e862f18 drivers: regulator: Add support for OnSemi NCP6335D regulator
This driver supports OnSemi NCP6335D synchronous buck converter.
The NCP6335D is a step-down switching voltage regulator which
provides a voltage range from 0.6 to 1.4V. The regulator is
controlled via the I2C interface.

Change-Id: I237fe781d5c54d2b3ffc65096b9e83c387d3b6f5
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-09-04 15:28:16 -07:00
David Collins 8ce0616722 regulator: qpnp-regulator: Add support for various LDO subtypes
Add support for the following QPNP PMIC LDO subtypes:
N600_STEPPER
N1200_STEPPER
LV_P50
LV_P150
LV_P300
LV_P600
LV_P1200

The register control interface and output voltage mapping for
LDOs of these subtypes are identical to existing NMOS and PMOS
LDO subtypes.

The STEPPER variants add a new register to enable and control the
speed of stepping between voltage set points.  This feature
allows for very smooth voltage transitions.  All manipulation of
the stepping control registers will be handled by boot loaders.

The LV variants are identical to the base PLDO subtypes except
that they have a different ESD structure.

Change-Id: Ib20f3d39bd2ad6210975bcb80431ee133c895278
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 15:19:18 -07:00
David Collins 5618e623e8 regulator: qpnp-regulator: Update boost regulator current limit reg address
Update the address used for the boost regulator current limit
register to reflect the correctly location in hardware.  The
proper address is 0x4A, not 0x40.

Change-Id: Ieefcd072858691940103664a2130a6c69341448f
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 15:11:50 -07:00
David Collins f73d901372 regulator: qpnp-regulator: Add support for rev 1 N1200 and N600 LDOs
The mapping between voltage control register set point values and
physical output voltage changes for range 1 of N1200 and N600
LDOs between PM8941 v1 and PM8941 v2.  LDOs with the previous
mapping have digital major revision equal to 0.  LDOs with the
new mapping have digital major revision equal to 1.  Modify the
qpnp-regulator driver so that the digital major revision register
value is taken into account when deciding which voltage mapping
to utilize.  N1200 and N600 regulators have identical
(range, voltage set point) --> output voltage mapping.

N1200 LDO range 1 hardware set points (rev=0):
375 mV to 768.75 mV with 6.25 mV step size

N1200 LDO range 1 hardware set points (rev=1):
375 mV to 1537.5 mV with 12.5 mV step size

Configure qpnp-regulator to use only range 0 for N1200 rev 1.
Range 0 is used because there is no benefit to using ranges 1 or
2 given that they have the same maximum voltage and step size
and their minimum voltage is greater than or equal to that of
range 0.

Change-Id: Icac6a1d8fccc014a754843d61c1fa40f550f9c77
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 15:11:49 -07:00
Michael Bohan 19b436f1b8 regulator: qpnp: Add property to override type registers
On some regulator hardware, the values read on SPMI offset 0x4 (type)
and 0x5 (subtype) are incorrect. Add a new optional property called
qcom,force-type that allows a user to override the hardware values
with values supplied in the Device Tree.

Change-Id: Id73fe69873f5dc9d0f2623771872aa2eaddd66f1
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2013-09-04 15:08:20 -07:00
David Collins 566bece9ff regulator: qpnp-regulator: Update FTSMPS voltage ranges to match hardware
Update the FTSMPS voltage ranges so that they accurately reflect
the physical output voltages resulting from set points
programmed on PMIC hardware.

Previous hardware documentation contained these equations:
range == 0: Voutput = setpoint * 5 mV + 80 mV
range == 1: Voutput = setpoint * 10 mV + 160 mV

The actual hardware response is:
range == 0: Voutput = setpoint * 5 mV
range == 1: Voutput = setpoint * 10 mV

Update range data in qpnp-regulator to match the true mapping.

Change-Id: Iabf00591f79705de721f571a347afb15c8b7140e
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 15:08:09 -07:00
Michael Bohan 58a7cae082 spmi: qpnp: Change APIs to take a spmi_resource pointer instead of index
Pointers are more flexible than index numbers, since index
numbers depend upon an additional reference to the array in
question. In particular, we'd like to add a new API to lookup a
devnode based on a predefined name in the Device Tree. This API
will return a spmi_resource, and so it's natural to want to use
this pointer directly with the other existing APIs.

Also introduce a new API spmi_for_each_devnode that can be used
to iterate each spmi_resource in the dev_node array. This
abstracts the traversal of the array, which was previously done
within the existing APIs.

Change-Id: I18f9397e5d78770e840a9f95dd8061201931df6e
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2013-09-04 14:57:29 -07:00
Michael Bohan 6b556ed08f spmi: Rename qpnp library to be part of the spmi framework
It turns out that the only use cases for the qpnp library use
the existing spmi data structures. As such, there's really
no justification for having the library not be called 'spmi'.
There is nothing Qualcomm specific about this code.

Also cleanup some inconsistencies in the Kernel Doc comments
while we're here.

Change-Id: I1c73c88be740b6f5d38ba2de62de1737981b30fa
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2013-09-04 14:57:28 -07:00
David Collins a937686f60 regulator: msm-gpio-regulator: Correct gpio_request error handling
The gpio_vreg_request_gpio() function inside of the
msm-gpio-regulator driver can return successfully even if
gpio_request() has failed. This can lead to a kernel crash via
null pointer dereference when later gpio and regulator functions
are called.  Modify gpio_vreg_request_gpio() so that it returns
an error immediately if gpio_request() fails.

Change-Id: I59364eb9efda6c2149b807db9a00e782d8ae6bb8
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 14:54:01 -07:00
Brandon Leong f193787660 regulator: debugfs: Adding debugfs functions into regulator framework
Move regulator debugfs functions into core.c. This change allows the user
to read and edit regulator information in user space through the debugfs
file system.

Change-Id: I21fa2c1d5d4ab27871ebb543134c2cee5ad70ded
Signed-off-by: Brandon Leong <bleong@codeaurora.org>
2013-09-04 14:50:32 -07:00
Bobby Crabtree cb0d17a6aa regulator: Add support for voltage aggregation
With this patch the regulator core aggregates voltage requests and
applies the minimum voltage range that satisifies all consumers of
a shared regulator supply. Only the voltages of consumers that have
enabled the supply are aggregated.

Updated voltage ranges are applied to the corresponding driver upon
the following events:

1. A consumer that has already enabled the regulator sets a voltage
2. A consumer enables the regulator
3. A consumer disables the regulator

Change-Id: Ib5012886cb77185a2038d45f08f3758faff68f60
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 14:50:31 -07:00
David Collins 13b515e117 regulator: Remove redundant set_mode call in drms_uA_update
The regulator framework checks if the current mode is the same as the
one being requested inside of regulator_set_mode. However, when
DRMS changing is allowed, regulator_enable calls drms_uA_update.
This function does not check the value of get_mode before calling
set_mode.

Modify drms_uA_update so that set_mode is only called if the requested
mode is different from the current mode returned by get_mode.

Change-Id: Ifb4f3069cf946e8474565ee82508c1ff45b36543
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 14:50:30 -07:00
Justin Paupore 80d7765be7 regulator: Add regulator_bulk_set_voltage
Add a convenience API to set the voltage on multiple consumers
stored in a struct regulator_bulk_data[] in one API call.

Change-Id: Iaeb5ba8c357a66f1401fb1e142bb03904e8e9c7c
Signed-off-by: Justin Paupore <jpaupore@codeaurora.org>
2013-09-04 14:50:30 -07:00
David Collins 1f9b46d711 regulator: Extend of_get_regulator_init_data to support non-DT consumers
Extend the of_get_regulator_init_data function so that it can
parse an additional property from regulator device tree nodes
which is needed to support non-device tree consumers.

The new property is named qcom,consumer-supplies.  Its value
is a list of strings of the form:

qcom,consumer-supplies = "supply_name1", "device_name1",
                         "supply_name2", "device_name2", ...

Change-Id: Ia689d04e6de568e6889b807eed15df3116de01d2
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 14:50:29 -07:00
David Collins 0d01b2dd66 regulator: core: Add option to suppress regulator info messages
Each call to regulator_register() results in a line being written
into the kmsg log.  regulator_init_complete() also prints a line for
each unused regulator which is automatically disabled.

Add a function named regulator_suppress_info_printing() which can
be called to disable these print statements.

Change-Id: Ic4c723b7d02a494b4e261858d699d9625da715ea
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 14:50:28 -07:00
David Collins 267a80d4ee regulator: Add qpnp-regulator driver
Add the qpnp-regulator driver to support regulators found in
Qualcomm plug-and-play (QPNP) PMIC chips.  QPNP chips make use of
Qualcomm's SPMI register convention.  The particular hardware
characteristics of a given regulator can be derived from the
values present in the type and subtype registers.

The qpnp-regulator driver supports probing with either device tree
device specification or with board file specified platform data.

Change-Id: I4f74431a50949763d651faf992b5d2567d05758e
Signed-off-by: David Collins <collinsd@codeaurora.org>
[sboyd: Squash in DT binding document]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-09-04 14:50:28 -07:00
Michael Bohan 3eb9a3700d regulator: Add stub regulator support
Add support for a dummy driver that has an implementation
connected to no real hardware devices. Its purpose is to aid
bringup scenarios by providing clients a regulator interface
that they expect. This driver shouldn't be enabled if a real
device implementation for a particular platform already exists.

Change-Id: Ib83027b4e599ebbc3cb153b2f346bb03495bb746
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2013-09-04 14:50:27 -07:00
Willie Ruan d633191ab7 regulator: add pm8058 xo buffer driver
As a regulator driver, this xo buffer driver takes the vote from
client and controls (enable or disable) XO (crystal) buffers so
that XO clock output can be started or stopped.

Change-Id: Iccac863af2f56d66799d8fdb3320958014466d8d
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2013-09-04 14:50:27 -07:00
David Collins a933f21833 regulator: gpio-regulator: create a regulator driver that wraps a GPIO
Create a new regulator driver, gpio-regulator, which wraps around a
GPIO that is the enable signal for a physical regulator.

Change-Id: I541a9a1cd3a6ffe3200ffaeee9f0f62db5e65795
Signed-off-by: David Collins <collinsd@codeaurora.org>
[sboyd: Moved to msm-gpio-regulator to not conflcit with
upstream's version of essentially the same driver]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-09-04 14:50:26 -07:00
David Collins 784a068726 regulator: pm8xxx-regulator: add PM8XXX regulator driver
Create a PM8XXX regulator driver that can support PMIC PM8921
variants including: PM8018, PM8038, and PM8921.

Change-Id: I60d1302e4af9a4c5caa72301c904867acd2ebe0f
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 14:50:25 -07:00
Bobby Crabtree 4700d207f7 regulator: pmic8901-regulator: Add support for PMIC8901 regulator
On 8x60 PMIC LDO/SMPS/LVS are controlled from the apps processor.
This driver talks directly to the PMIC over SSBI through the
PMIC8901 core driver. This driver utilizes the regulator framework
to enable, disable, and change regulator voltage levels.

Change-Id: I21c272a490a2526c2fde9fe3ef7590a57418269a
Signed-off-by: Bobby Crabtree <bobbyc@codeaurora.org>
2013-09-04 14:50:25 -07:00
Bobby Crabtree a6ac865c0b regulator: pmic8058-regulator: add support for PMIC8058 regulator
On 8x60 PMIC LDO/SMPS/LVS are controlled from the apps processor.
This driver talks directly to the PMIC over SSBI through the
PMIC8058 core driver. This driver utilizes the regulator framework
to enable, disable, and change regulator voltage levels.

Change-Id: I25e24a3d2801d345d9f3943d54e34a563b6cc21a
Signed-off-by: Bobby Crabtree <bobbyc@quicinc.com>
2013-09-04 14:50:24 -07:00
David Collins 102da938db regulator: Add proxy consumer driver
Add a proxy consumer driver which can be used to ensure that a
given regulator maintains a certain minimum state during bootup.
Enable state, voltage, and current may be forced to specified
levels.

Change-Id: I0ccc63a41684462684ac737fb2f4129a3e6e4aea
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-08-22 18:09:07 -07:00
Matt Wagantall 853db7207c regulator: Replace error prints in regulator_check_drms() with debug prints
Errors returned from regulator_check_drms() are not treated as fatal
by any of its callers, nor are they passed up through exported
regulator APIs. Instead, these errors are used to indicate that a
regulator does not support multiple current modes.

For example, the exported regulator_set_optimum_mode() API explicitly
discards errors from regulator_check_drms() and returns success anyway
since there is no work to be done to change modes.

To prevent errors from being printed in these cases, downgrade the
rdev_err() prints in regulator_check_drms() to rdev_dbg() prints.

Change-Id: I465dcad59722b0f1fb9384beba01f6411a4a693a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2013-07-08 05:52:30 -07:00
Marc Dietrich ec8da805c4 mfd: tps6586x: correct device name of the regulator cell
Change the device name of the regulator function to the one chosen for
MODULE_ALIAS. This fixes kernel auto-module loading for the regulator function.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-24 12:37:47 +01:00
Mark Brown dcbd8eec68 Merge remote-tracking branch 'regulator/fix/palmas' into regulator-linus 2013-05-30 11:58:40 +01:00
Mark Brown 2a66a854f5 Merge remote-tracking branch 'regulator/fix/doc' into regulator-linus 2013-05-30 11:58:39 +01:00
Mark Brown e4bf063cb8 Merge remote-tracking branch 'regulator/fix/dbx500' into regulator-linus 2013-05-30 11:58:37 +01:00
Kishon Vijay Abraham I f232168df0 regulator: palmas: Fix "enable_reg" to point to the correct reg for SMPS10
regulator_enable_regmap() uses enable_reg to enable the regulator.
But enable_reg for smps10 points to SMPS10_STATUS which is a
read-only register. Fixed the same by having enable_reg
set to SMPS10_CTRL.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
2013-05-30 11:55:55 +01:00
Sachin Kamat 3f4d636408 regulator: palmas: Fix incorrect condition
Since 'id' cannot take two values at the same time, the condition
should probably be an OR (||) instead of AND (&&).

Introduced by commit 28d1e8cd67 ("regulator: palma: add ramp delay
support through regulator constraints").

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-30 11:55:46 +01:00
Charles Keepax ce0d10f887 regulator: core: Correct spelling mistake in comment
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-21 10:35:40 -05:00
Linus Torvalds 5647ac0ad4 Removal of GENERIC_GPIO for v3.10
GENERIC_GPIO now synonymous with GPIOLIB. There are no longer any valid
 cases for enableing GENERIC_GPIO without GPIOLIB, even though it is
 possible to do so which has been causing confusion and breakage. This
 branch does the work to completely eliminate GENERIC_GPIO.
 
 However, it is not trivial to just create a branch to remove it. Over
 the course of the v3.9 cycle more code referencing GENERIC_GPIO has been
 added to linux-next that conflicts with this branch. The following must
 be done to resolve the conflicts when merging this branch into mainline:
 
 * "git grep CONFIG_GENERIC_GPIO" should return 0 hits. Matches should be
   replaced with CONFIG_GPIOLIB
 * "git grep '\bGENERIC_GPIO\b'" should return 1 hit in the Chinese
   documentation.
 * Selectors of GENERIC_GPIO should be turned into selectors of GPIOLIB
 * definitions of the option in architecture Kconfig code should be deleted.
 
 Stephen has 3 merge fixup patches[1] that do the above. They are currently
 applicable on mainline as of May 2nd.
 
 [1] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg428056.html
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRifUnAAoJEEFnBt12D9kBs2YP/0U6+ia+xYvkVaJc28PDVIzn
 OReZNcJOYU8D5voxz0voaRD0EdcPwjbMu9Kp9aXMHlk4VxevF+8jCc/us0bIjtO1
 VcB5VmSCIhMhxdnBlum11Mk7Vr5MCweyl9NBsypnPt8cl4obMBZHf2yzoodFktNb
 wtyYlOb6FALtc6iDbOO6dG3w9F7FAOLvskUFzdv89m8mupTsBu9jw9NqFDbJHOex
 rxq0Sdd+kWF/nkJVcV5Y6jIdletRlhpipefMJ9diexreHvwqh+c4kJEYZaXgB5+m
 ha95cPbReK1d+RqzM3A8d4irzSVSmq4k7ijI6QkFOr48+AH7XsgKv5so885LKzMN
 IIXg2Phm9i0H8+ecEvhcc4oIYBHJiEKK54Y0qUD9dqbFoDGPTCSqMHdSSMbpAY+J
 bIIXlVzj1En3PPNUJLPt8q8Qz6WxCT9mDST3QSGYnD4o90HT+1R9j92RxGL6McOq
 rUOyJDwmzFvpBvKK4raGdOU435M+ps2NPKKNIRaIGQPPY9rM1kN4YqvhXukEsC9L
 3a3+3cQLh7iKxBHncxeQsJfethP1CPkJnzvF9r+ZZLf2rcPH4pbQIE2uO0XnX/nd
 5/DKi0nGgAJ//GMMzdo3RiOA5zGFjIZ/KMvfhQldpP6qFJRhqdGi6FPlAcwr1z1n
 YnCByPwwlvfC4LTXFOGL
 =xodc
 -----END PGP SIGNATURE-----

Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux

Pull removal of GENERIC_GPIO from Grant Likely:
 "GENERIC_GPIO now synonymous with GPIOLIB.  There are no longer any
  valid cases for enableing GENERIC_GPIO without GPIOLIB, even though it
  is possible to do so which has been causing confusion and breakage.
  This branch does the work to completely eliminate GENERIC_GPIO."

* tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux:
  gpio: update gpio Chinese documentation
  Remove GENERIC_GPIO config option
  Convert selectors of GENERIC_GPIO to GPIOLIB
  blackfin: force use of gpiolib
  m68k: coldfire: use gpiolib
  mips: pnx833x: remove requirement for GENERIC_GPIO
  openrisc: default GENERIC_GPIO to false
  avr32: default GENERIC_GPIO to false
  xtensa: remove explicit selection of GENERIC_GPIO
  sh: replace CONFIG_GENERIC_GPIO by CONFIG_GPIOLIB
  powerpc: remove redundant GENERIC_GPIO selection
  unicore32: default GENERIC_GPIO to false
  unicore32: remove unneeded select GENERIC_GPIO
  arm: plat-orion: use GPIO driver on CONFIG_GPIOLIB
  arm: remove redundant GENERIC_GPIO selection
  mips: alchemy: require gpiolib
  mips: txx9: change GENERIC_GPIO to GPIOLIB
  mips: loongson: use GPIO driver on CONFIG_GPIOLIB
  mips: remove redundant GENERIC_GPIO select
2013-05-09 09:59:16 -07:00
Sachin Kamat 3d75095a53 regulator: dbx500: Make local symbol static
power_state_active_get is used only in this file. Make it static.
While at it also move this function definition inside the
CONFIG_REGULATOR_DEBUG macro as it is called only from within it.
This also avoids further build warning related to unused definition.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-08 13:42:30 +01:00
Robert P. J. Day 31d6eebf7e regulator: Fix kernel-doc generation warnings.
Add a couple kernel-doc lines to get rid of kernel-doc generation
warnings, no functional change.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-02 15:42:54 +01:00
Mark Brown bee5465814 Merge remote-tracking branch 'regulator/topic/wm8994' into v3.9-rc8 2013-04-28 02:13:50 +01:00
Mark Brown bcd5d1d978 Merge remote-tracking branch 'regulator/topic/twl' into v3.9-rc8 2013-04-28 02:13:49 +01:00
Mark Brown 32e40be1e2 Merge remote-tracking branch 'regulator/topic/tps80031' into v3.9-rc8 2013-04-28 02:13:48 +01:00
Mark Brown 64dceea446 Merge remote-tracking branch 'regulator/topic/tps6586x' into v3.9-rc8 2013-04-28 02:13:48 +01:00
Mark Brown 813dc1b086 Merge remote-tracking branch 'regulator/topic/tps65023' into v3.9-rc8 2013-04-28 02:13:47 +01:00
Mark Brown 22a712b90c Merge remote-tracking branch 'regulator/topic/tps62360' into v3.9-rc8 2013-04-28 02:13:47 +01:00
Mark Brown eea8e85e3b Merge remote-tracking branch 'regulator/topic/s5m8767' into v3.9-rc8 2013-04-28 02:13:46 +01:00
Mark Brown fbf6630d70 Merge remote-tracking branch 'regulator/topic/rc5t583' into v3.9-rc8 2013-04-28 02:13:46 +01:00
Mark Brown ae5f5203e5 Merge remote-tracking branch 'regulator/topic/palmas' into v3.9-rc8 2013-04-28 02:13:45 +01:00
Mark Brown 95328a190e Merge remote-tracking branch 'regulator/topic/max8998' into v3.9-rc8 2013-04-28 02:13:44 +01:00
Mark Brown 9eaec296d0 Merge remote-tracking branch 'regulator/topic/max8997' into v3.9-rc8 2013-04-28 02:13:43 +01:00
Mark Brown 8ca5e1fa9e Merge remote-tracking branch 'regulator/topic/max8973' into v3.9-rc8 2013-04-28 02:13:43 +01:00
Mark Brown a2c05e91b9 Merge remote-tracking branch 'regulator/topic/max8952' into v3.9-rc8 2013-04-28 02:13:43 +01:00
Mark Brown 2e1be9f7b3 Merge remote-tracking branch 'regulator/topic/max8925' into v3.9-rc8 2013-04-28 02:13:42 +01:00
Mark Brown c4578da56a Merge remote-tracking branch 'regulator/topic/max77686' into v3.9-rc8 2013-04-28 02:13:42 +01:00
Mark Brown 388128ffd6 Merge remote-tracking branch 'regulator/topic/max1586' into v3.9-rc8 2013-04-28 02:13:41 +01:00
Mark Brown 329bd970d8 Merge remote-tracking branch 'regulator/topic/lp8788' into v3.9-rc8 2013-04-28 02:13:41 +01:00
Mark Brown 3dc06c1baf Merge remote-tracking branch 'regulator/topic/gpio' into v3.9-rc8 2013-04-28 02:13:40 +01:00
Mark Brown 5f19a85ba7 Merge remote-tracking branch 'regulator/topic/fan53555' into v3.9-rc8 2013-04-28 02:13:39 +01:00
Mark Brown 1d60a4cf97 Merge remote-tracking branch 'regulator/topic/enable-invert' into v3.9-rc8 2013-04-28 02:13:37 +01:00
Mark Brown 0e340ce1dd Merge remote-tracking branch 'regulator/topic/core' into v3.9-rc8 2013-04-28 02:13:37 +01:00
Mark Brown 97844ede94 Merge remote-tracking branch 'regulator/topic/ascend' into v3.9-rc8 2013-04-28 02:13:36 +01:00
Mark Brown 83b0dd9ea3 Merge remote-tracking branch 'regulator/topic/as3711' into v3.9-rc8 2013-04-28 02:13:36 +01:00
Mark Brown f50b7f2b51 Merge remote-tracking branch 'regulator/topic/arizona' into v3.9-rc8 2013-04-28 02:13:35 +01:00
Mark Brown c98cac899b Merge remote-tracking branch 'regulator/topic/ab8500' into v3.9-rc8 2013-04-28 02:13:34 +01:00
Mark Brown 9e63d23056 Merge remote-tracking branch 'regulator/topic/ab3100' into v3.9-rc8 2013-04-28 02:13:33 +01:00
Axel Lin 78040b630f regulator: mc13892: Fix MC13892_SWITCHERS0_SWxHI bit in set_voltage_sel
It is necessary to clear MC13892_SWITCHERS0_SWxHI bit when set voltage to the
voltage range from 1100000 to 1375000. Leaving MC13892_SWITCHERS0_SWxHI bit
untouched may result in wrong voltage setting.

For example, currently switch voltage from 1400000 to 1300000 will set the
voltage to 1800000 because the HI bit is still set.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2013-04-28 02:13:02 +01:00
Axel Lin 020501f1a0 regulator: Remove NULL test before calling regulator_unregister()
It's safe to call regulator_unregister() with NULL, thus remove the NULL test
before regulator_unregister() calls.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2013-04-28 02:11:19 +01:00
Alexander Shiyan 86b139f0f3 regulator: mc13783: Add device tree probe support
Patch adds device tree probe support for mc13783-regulator driver.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2013-04-28 02:10:00 +01:00
Alexander Shiyan eb0d8e7a14 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>
2013-04-28 02:10:00 +01:00
Axel Lin 3ecf198eab regulator: max77686: Don't update max77686->opmode if update register fails
Ensure max77686->opmode always has correct status.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2013-04-28 02:07:52 +01:00
Axel Lin 71622e15dd regulator: max8952: Add missing config.of_node setting for regulator register
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-26 18:17:01 +01:00
Axel Lin 018fd856ce regulator: ab3100: Fix regulator register error handling
Ensure to unregister all regulators before return error in probe().

The regulator register order depends on the regulator ID pass to
ab3100_regulator_register() function. Thus we need to scan ab3100_regulator_desc
and find the index of successfully registered regulators, or alternatively just
call ab3100_regulators_remove() to unregister all registered regulators.

Since current code uses a static ab3100_regulators table, explicitly set
reg->rdev = NULL after regulator_unregister() call to ensure calling
ab3100_regulators_remove() in the unwind path always work.

Also move ab3100_regulators_remove() to avoid forward declaration.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-26 16:33:10 +01:00
Axel Lin b92f567deb regulator: tps6524x: Use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-26 16:32:05 +01:00
Axel Lin 6dcbc200fe regulator: lp8788-buck: Use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-25 11:50:23 +01:00
Axel Lin a32f9e0202 regulator: lp872x: Use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-25 11:50:23 +01:00
Axel Lin 3bdf599289 regulator: mc13892: Use regulator_map_voltage_ascend for mc13892_sw_regulator_ops
Both mc13892_sw1 and mc13892_sw voltage table have ascendant voltage list.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-25 11:49:46 +01:00
Axel Lin c4bbfbd548 regulator: tps65023: Use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-25 11:49:28 +01:00
Axel Lin 2040541afb regulator: tps65023: Merge tps65020 ldo1 and ldo2 vsel table
tps65020 ldo1 and ldo2 vsel tables are identical, merge them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-25 11:49:27 +01:00
Axel Lin a1bb63a80c regulator: tps6507x: Use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-25 11:48:37 +01:00
Linus Walleij 8735bc2fe6 regulator: ab3100: device tree support
This implements device tree support for the AB3100 regulators
driver. The initial settings are moved out of platform data
and into the driver for the device tree case, as it appears
that there is no way to supply this as AUXDATA for an I2C
device. The style and bindings are heavily inspired by
Lee Jones' style for AB8500.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-24 10:54:07 +01:00
Linus Walleij 9b31835341 regulator: ab3100: refactor probe to use IDs
This refactors the AB3100 regulator probe to use regulator IDs
and pass this to a separate registration function. This works
much smoother when migrating to device tree, as we can use a
match table with this regulator ID encoded in the .driver_data.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-24 10:53:59 +01:00
Axel Lin b27032ca3e regulator: max8973: Don't override control1 variable when set ramp delay bits
Current code overrides control1 variable when setting ramp delay bits.
Fix it by just setting ramp_delay bits.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-24 10:52:28 +01:00
Axel Lin bc49c87ec7 regulator: tps80031: Convert tps80031_dcdc_ops to [get|set]_voltage_sel_regmap
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:47:38 +01:00
Axel Lin 58fa6ab42c regulator: tps80031: Fix LDO2 track mode for TPS80031 or TPS80032-ES1.0
Currently we have a special code in tps80031_ldo_set_voltage_sel() to handle
LDO2 track mode for TPS80031 or TPS80032-ES1.0. The purpose is to address below
issues:

Issue description:
- LDO2 traking mode is enabled
- LDO2 tracks SMPS2 voltage.
- LDO2 automatically switch-off when LDO2_CFG_VOLTAGE is changed to some discrete values (non exhaustive list):
            00011001, 00011010, 00011011, 00011100, .
- LDO2 switch-on again when LDO2_CFG_VOLTAGE is changed to other values (non exhaustive list):
        00011000, 00010111, .

LDOs have reserved codes. For these codes, LDO is switch-off.

In tracking, LDO2 ref comes from SMPS2.
However LDO2 enable is still gated by LDO2 VSEL decoding.
As a result, in tracking mode LDO2 will be disabled for following code (SMPS VSEL format):
000000 & 100000 (MSB not decoded)
011001 & 111001 (MSB not decoded)
011010 & 111010 (MSB not decoded)
011100 & 111100 (MSB not decoded)
011101 & 111101 (MSB not decoded)
011110 & 111110 (MSB not decoded)

However, current code has below bugs:
1. It uses regulator_list_voltage_linear, so list_voltage() still shows above
   invalid selectors have supported voltage.
2. Current code may return -EINVAL in tps80031_ldo_set_voltage_sel() for
   supported voltage. This is because when we use regulator_list_voltage_linear
   as list_voltage callback, regulator core will default use
   regulator_map_voltage_linear(). regulator_map_voltage_linear() has an
   assumption that the voltages are linear which is not true for this case.

   For example,
   when request voltage range is: min_uV=950000 uV && max_uV=1200000 uV
   regulator_map_voltage_linear() returns the selector is 29 (0x1D),
   set_voltage_sel() returns -EINVAL.
   (The selector is in invalid range, 0x19 ~ 0x1f).

   In above case, map_voltage() should find the lowest valid voltage within
   specific range (selector = 0x20) and set_voltage_sel() should successfully
   set the voltage to 987500 uV.

This patch fixes these issues by:
1. Add checking valid setting for LDO2 track mode of TPS80031 or TPS80032-ES1.0
   in list_voltage.  So it returns -EINVAL for invalid selectors.
2. Implement tps80031_ldo_map_voltage, use regulator_map_voltage_iterate()
   to find the lowest voltage within specific range for TPS80031 or
   TPS80032-ES1.0. This is required when the voltage map is no longer linear.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:47:37 +01:00
Axel Lin 4d673bbc58 regulator: tps6586x: Convert to use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Thus use regulator_map_voltage_ascend is more efficient than the default
regulator_map_voltage_iterate.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:41:06 +01:00
Axel Lin 9fa8175f0f regulator: tps65910: Convert to use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Some regulators have more than 200 supported voltages.
e.g.
For TPS65910_REG_VDD1 and TPS65910_REG_VDD2:
n_voltages = VDD1_2_NUM_VOLT_FINE * VDD1_2_NUM_VOLT_COARSE
           = 73 * 3
           = 219

Thus it worth converting to regulator_map_voltage_ascend rather than use
default regulator_map_voltage_iterate.

For consistent, convert all regulators to regulator_map_voltage_ascend.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:41:06 +01:00
Axel Lin b50003b69d regulator: lp3972: Convert to use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Thus use regulator_map_voltage_ascend is more efficient than the default
regulator_map_voltage_iterate.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:39:33 +01:00
Axel Lin 3e655618e1 regulator: lp3971: Convert to use regulator_map_voltage_ascend
All regulators have ascendant voltage list in this driver.
Thus use regulator_map_voltage_ascend is more efficient than the default
regulator_map_voltage_iterate.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:39:27 +01:00
Axel Lin 46bcb006ae regulator: tps65023: Use [set|get]_voltage_sel_regmap instead of open coded
Simply the [get|set]_voltage_sel implementation by using
regulator_[set|get]_voltage_sel_regmap instead of open coded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:32:56 +01:00
Axel Lin 1864b67090 regulator: tps62360: Fix off-by-one shift for ramp_ctrl
According to the datasheet[1]

Register 0x06h Description: RmpCtrl (REGISTER ADDRESS: 0x06h Read/Write)
BIT[5..7]:
        RMP[2:0] Output voltage ramp timing
        D7-D5   Slope
        000     32mV/us
        001     16mV/us
        010     8mV/us
        ...
        110     0.5mV/us
        111     0.25mV/us

Thus to get correct ramp_ctrl value, we need to right-shift 5 bits.

[1] http://www.ti.com/lit/ds/symlink/tps62360.pdf

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23 11:26:56 +01:00
Axel Lin 0ea34b5786 regulator: palmas: Fix off-by-one for ramp_delay and register value mapping
Datasheet says:
Time Step (TSTEP) selection, when changing the output voltage, the new value is
reached through successive voltage steps (if not bypassed). The equivalent
programmable slew rate of the output voltage is:

TSTEP[1:0]: 00 Jump (no slope control)
TSTEP[1:0]: 01 10mV/us
TSTEP[1:0]: 10 5mV/us (default)
TSTEP[1:0]: 11 2.5mV/us

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-22 13:34:42 +01:00
Axel Lin e31089c608 regulator: palmas: Add missing ctrl_addr setting for SMPS10
The ctrl_addr setting for SMPS10 is missed, thus palmas_smps_init() read/write
wrong register for SMPS10 in current code. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-22 13:27:16 +01:00
Axel Lin f22c2bae2e regulator: palmas: Don't update tstep register for SMPS3 and SMPS7
SMPS3 and SMPS7 do not have tstep_addr setting, so current code actually
writes 0 to smps12_ctl (offset is 0) register when set_ramp_delay callback
is called for SMPS3 and SMPS7.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-19 11:47:29 +01:00
Axel Lin 3df4a81c46 regulator: palmas: Fix min_uV for LDO8 tracking mode
When SMPS45 is set to off and LDO8 tracking is enabled, the output voltage can
be set from 0.45 to 1.65 V. Thus set min_uV to be 450000.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 18:35:17 +01:00
Axel Lin 5d9de8b121 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>
2013-04-18 18:26:35 +01:00
Axel Lin 9135d3bcec 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>
2013-04-18 18:26:30 +01:00
Laxman Dewangan 51d3a0c999 regulator: palmas: preserve modes of rails during enable/disable
The Palma device like TPS65913 have the mode mask which is also
used for enable/disable the rails. The mode bits are defined as
	00: OFF
	01: AUTO
	10: ECO
	11: Forced PWM

and modes are set accordingly as
	REGULATOR_MODE_NORMAL: AUTO
	REGULATOR_MODE_IDLE: ECO
	REGULATOR_MODE_FAST: PWM

Two issue observed:
1. If client calls following sequence:
	regulator_enable(),
	regulator_set_mode(FAST),
	regulator_disable()

	and again the regulator_enable() then the mode is reset
	to NORMAL inplace of keeping the mode as FAST.

	Fixing this by storing the current mode configured by client
	and restoring modes when enable() is called after disable().

2. In following sequence, the regulator get enabled:
	regulator_disable()
	regulator_set_mode(FAST),

	Fixing this by updating new mode in register only if it is
	enabled.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 18:23:53 +01:00
Laxman Dewangan 28d1e8cd67 regulator: palma: add ramp delay support through regulator constraints
Currently Palma regulator driver support the ramp delay
through rail specific platform data.

As regulator framework support the configuration of ramp
delay through regulator constraint, using the framework
method and removing the platform specific data approach.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 18:23:20 +01:00
Axel Lin fcf371ee56 regulator: core: Add regulator_map_voltage_ascend() API
A lot of regulator hardware has ascendant voltage list.
This patch adds regulator_map_voltage_ascend() and export it.

Drivers that have ascendant voltage list can use this as their map_voltage()
operation, this is more efficient than default regulator_map_voltage_iterate()
function.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 12:09:32 +01:00
Axel Lin b4d12a7929 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>
2013-04-17 15:09:27 +01:00
Axel Lin 7384744d2d regulator: ab8500-ext: Remove enable() and disable() functions
Both enable() and disable() functions have only one caller, thus remove them.

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>
2013-04-17 15:08:38 +01:00
Axel Lin 66511fa4a7 regulator: ab8500-ext: Don't update info->update_val if set_mode() fails
This ensures info->update_val status is still correct if set_mode() call fails.
Otherwise, get_mode() may return wrong status if a set_mode() call 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>
2013-04-17 15:08:33 +01:00
Axel Lin 0b665062a1 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>
2013-04-17 15:08:27 +01:00
Axel Lin f04adc5ab3 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>
2013-04-17 15:08:22 +01:00
Laxman Dewangan 17c11a7603 regulator: palmas: add support for LDO8 tracking mode
LDO8 of Palma device like tps65913 support the tracking mode
on which LDO8 track the SMPS45 voltage when SMPS45 is ON
and use the LDO8.VOLTAGE_SEL register when SMPS45 is OFF.

On track mode, the steps of voltage change for LDO8 is 25mV
where in non-tracking mode it is 50mV. Set the steps accordingly.
Number of voltage count is still same for both the cases.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17 15:05:19 +01:00
Laxman Dewangan aa07f02793 regulator: palmas: support for external regulator through control outputs
Palmas device have control outputs like REGEN1, REGEN2, REGEN3,
SYSEN1 and SYSEN2. These control outputs can be used for controlling
external voltage switches to enabled/disable voltage outputs.

Add support of these control outputs through regulator framework.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17 15:05:10 +01:00
Laxman Dewangan 30590d0480 regulator: palmas: clear sleep bits if not selected
Clear the sleep/warm reset bits when it is not selected through
regulator platform data. This will make sure that configuration
is inline with the platform data regardless of boot/POR
configuration.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17 15:03:06 +01:00
Nishanth Menon 1e4b545cdd regulator: core: return err value for regulator_get if there is no DT binding
commit 6d191a5fc7
(regulator: core: Don't defer probe if there's no DT binding for a supply)

Attempted to differentiate between regulator_get() with an actual
DT binding for the supply and when there is none to avoid unnecessary
deferal.
However, ret value supplied by regulator_dev_lookup() is being
ignored by regulator_get(). So, exit with the appropriate return value.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17 14:58:17 +01:00
Axel Lin d6c7d73192 regulator: as3711: Use a static of_regulator_match table for of_regulator_match
The same table can be used for multiple instance of pdev, so we don't need to
allocate memory for of_regulator_match table per pdev.

match->driver_data points to the corresponding entry of as3711_reg_info,
however it is not used in current code, thus this patch does not set
driver_data in the of_regulator_match table.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17 14:41:07 +01:00
Axel Lin 241896ce8d 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>
2013-04-16 12:23:27 +01:00
Axel Lin bcffe53fcb regulator: rc5t583: Remove unused fields from struct rc5t583_regulator_info
The *dev and *mfd of struct rc5t583_regulator_info are not used after convert
to use regmap, remove them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-16 12:22:06 +01:00
Alexandre Courbot 76ec9d18b8 Convert selectors of GENERIC_GPIO to GPIOLIB
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on
GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
2013-04-16 18:47:14 +09:00
Axel Lin a2f07305e5 regulator: max8997: Test pdata by NULL checking instead of IS_ERR_OR_NULL
pdata is either a valid pointer or NULL, use NULL checking rather than
IS_ERR_OR_NULL macro.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-15 17:21:18 +01:00
Axel Lin 375dc9c141 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>
2013-04-15 16:54:25 +01:00
Axel Lin e4fc9d6d9f 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>
2013-04-12 13:29:33 +01:00
Sylwester Nawrocki 3ea9389656 regulator: wm8994: Use GPIO parsed from DT when registering regulators
Ensure the regulators are registered with a GPIO parsed from the device
tree when available.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-11 17:56:21 +01:00
Axel Lin 42e8c811ba 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>
2013-04-11 17:43:56 +01:00
Axel Lin 3480c0cab6 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>
2013-04-11 17:43:50 +01:00
Axel Lin e343ab08bd regulator: ab8500-ext: Remove get_voltage to avoid duplicate implementation
The implementation of ab8500_ext_fixed_get_voltage is identical to
ab8500_ext_list_voltage. We can avoid the duplicate implementation by just
remove get_voltage. For fixed regulator, regulator core will call
list_voltage(rdev, 0) to get voltage if both get_voltage get_voltage_sel are
not implemented.

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>
2013-04-08 11:23:56 +01:00
Axel Lin bcbba9de0f regulator: ab8500-ext: Remove unnecessary checking for ab9540 and ab8540
This code was added by commit 0fe17e20a6
"regulator: ab8500-ext: Add support for AB9540 regulators"
and commit bd44e2cb "regulator: ab8500: Also check for AB8505 based platforms"

The original patch[1] is to set info->desc.ops = &ab9540_ext_regulator_ops.

However, ab9540_ext_regulator_ops is identical to ab8500_ext_regulator_ops[2].
Thus we can complete remove the unnecessary checking for ab9540 and ab8540.

[1] https://lkml.org/lkml/2013/3/28/333
[2] https://lkml.org/lkml/2013/4/1/178

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>
2013-04-08 11:23:49 +01:00
Axel Lin 9ab51a0eb4 regulator: ab8500-ext: Get rid of is_enabled from struct ab8500_ext_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.

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>
2013-04-08 11:23:45 +01:00
Axel Lin 438e695b87 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>
2013-04-08 11:23:31 +01:00
Mark Brown e3d27775fc regulator: wm8994: Provide default init data
Almost all systems use the regulators on the WM8994 series devices to
provide DCVDD and AVDD1 so if no init data is supplied then set up the
supplies for the user. This simplifies integration of the device into
systems, especially when device tree is supported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-07 20:24:07 +01:00
Axel Lin cd2a55d2eb 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>
2013-04-05 11:23:10 +01:00
Tomasz Figa 3ff4aa95b3 regulator: max8952: Add Device Tree support
This patch adds Device Tree support to max8952 regulator driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05 11:20:52 +01:00
Tomasz Figa 3ec6eb9cc2 regulator: max8952: Separate constraints from platform data struct
This patch modifies platform data structure of max8952 driver to
use pointer to regulator_init_data struct instead of embedding it.

This is a prerequisite for adding Device Tree support for the driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05 11:20:51 +01:00
Andrew Bresticker 0f7b87f0ac regulator: core: don't require a supply when supply_name is specified
Regulator drivers may specify regulator_desc->supply_name which
regulator_register() will use to find the supply node for a regulator.
If no supply was specified in the device tree or the supply has yet
to be registered regulator_register() will fail, deferring the probe
of the regulator.  In the case where no supply node was specified in the
device tree, there is no supply and it is pointless to try and find one
later, so go ahead and add the regulator without the supply.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05 10:55:22 +01:00
Mark Brown 0565021655 regulator: wm8994: Convert to module_platform_driver()
The regulators can only be used to supply the CODEC so we don't need to
worry about users that still need fudges for init ordering issues.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05 10:44:23 +01:00
Axel Lin b5366e5edc regulator: lp8788: Implement list_voltage for lp8788_ldo_voltage_fixed_ops
For fixed voltage, we can just set min_uV and use regulator_list_voltage_linear
for list_voltage callback. Regulator core will call list_voltage(rdev, 0) if
both get_voltage get_voltage_sel are not implemented. Thus we can also remove
lp8788_ldo_fixed_get_voltage() function.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-03 18:46:29 +01:00
Axel Lin 80abd60d98 regulator: lp8788: Remove lp8788_dldo_id and lp8788_aldo_id arrays
The id for DLDOx matches the entries in enum lp8788_ldo_id and it's easy to
calculate the id for ALDOx. Thus remove lp8788_dldo_id and lp8788_aldo_id
arrays.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-03 18:46:14 +01:00
Axel Lin aca45e9e2f 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>
2013-04-03 18:40:29 +01:00
Axel Lin d7816ab09b regulator: ab8500: Fix list_voltage for fixed voltage regulators
commit b080c78a4e
"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>
2013-04-03 18:40:28 +01:00
Lee Jones da45edc7f8 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>
2013-04-03 18:40:28 +01:00
Lee Jones d319310395 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>
2013-04-03 18:40:27 +01:00
Lee Jones 5fc9da6d37 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>
2013-04-03 18:40:27 +01:00
Lee Jones a4d68468ca 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>
2013-04-03 18:40:26 +01:00
Zhenhua HUANG 684d5ce4af 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>
2013-04-03 18:40:26 +01:00
Lee Jones 33aeb49e24 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>
2013-04-03 18:40:25 +01:00
Axel Lin 37daa8aed1 regulator: ab8500-ext: Don't update info->is_enabled if write to 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>
2013-04-02 23:05:39 +01:00
Axel Lin 1ec990c002 regulator: dbx500-prcmu: Remove operating_point from struct dbx500_regulator_info
operating_point is not used since the initial commit of db8500-prcmu driver,
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>
2013-04-02 23:05:28 +01:00
Lee Jones 4c84b4ddd4 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>
2013-04-02 23:01:44 +01:00
Lee Jones 3fe5228910 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>
2013-04-02 23:01:43 +01:00
Lee Jones d7607baf32 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>
2013-04-02 23:01:43 +01:00
Lee Jones bd44e2cb4a 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>
2013-04-02 23:01:43 +01:00
Lee Jones 8a3b1b8703 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>
2013-04-02 23:01:42 +01:00
Rabin Vincent f7eae37fcc 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>
2013-04-02 23:01:42 +01:00
Lee Jones 0b94641126 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>
2013-04-02 23:01:42 +01:00
Lee Jones 0fe17e20a6 regulator: ab8500-ext: Add support for AB9540 regulators
Add the support for ab9540 external regulators.

Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-02 23:01:41 +01:00
Lee Jones 62ab411111 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>
2013-04-01 13:23:39 +01:00
Lee Jones b080c78a4e 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>
2013-04-01 13:23:38 +01:00
Lee Jones ae0a9a3efc 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>
2013-04-01 13:23:38 +01:00
Lee Jones 547f384f33 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>
2013-04-01 13:23:38 +01:00
Bengt Jonsson a6324709ab regulator: ab8500-ext: Add support for AB8505/AB9540
The external regulator driver checks for old AB8500 HW
to apply a fix. This patch adds a check to see that
it is a AB8500 (not AB8505/AB9540).

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>
2013-04-01 13:23:37 +01:00
Lee Jones ed3c138eb3 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>
2013-04-01 13:23:37 +01:00
Lee Jones 8e6a8d7d23 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>
2013-04-01 13:23:37 +01:00
Lee Jones b54969ac40 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>
2013-04-01 13:23:36 +01:00
Axel Lin d67c42cc17 regulator: max1586: Constify v6_voltages_uv table
Make v6_voltages_uv to be const unsigned int.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-30 13:53:21 +00:00
Axel Lin 742a73259d 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>
2013-03-29 17:52:55 +00:00
Lee Jones da0b0c47dc 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>
2013-03-29 17:50:35 +00:00
Lee Jones 41a06aa738 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>
2013-03-29 17:50:07 +00:00
Bengt Jonsson 18bc2b3930 regulator: ab8500-ext: Add HW request support
Support for HW request is added in the external regulator
driver. A flag in the board configuration can be set to
let HW control the regulator when there is no SW request.
This means that the regulator will be put in high power
mode when there is a SW request and in HW-request mode
otherwise.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Mattias NILSSON <mattias.i.nilsson@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-29 17:49:09 +00:00
Lee Jones d1a820011b 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>
2013-03-29 17:49:07 +00:00
Laxman Dewangan 504382c99d regulator: palmas: add input supply names
Palmas regulator support the different input supply pins for each of
the rails. Fill the regulator info data with their input supply pin
names.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-28 00:26:04 +00:00
Lee Jones cc40dc2981 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>
2013-03-28 00:20:15 +00:00
Lee Jones 43a5911b3d 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>
2013-03-28 00:11:02 +00:00
Axel Lin 292349287f 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>
2013-03-27 23:17:10 +00:00
Axel Lin 530158b6d2 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>
2013-03-27 23:17:05 +00:00
Axel Lin f71bf52808 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>
2013-03-26 14:04:22 +00:00
Mark Brown ce1bcb7eab regulator: arizona: Increase ramp delay for high current regulators
As per latest evaluation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26 13:27:11 +00:00
Axel Lin 5689e83074 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>
2013-03-25 10:19:52 +00:00
Axel Lin 328a536966 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>
2013-03-25 10:19:43 +00:00
Guennadi Liakhovetski 416d67599e regulator: as3711: add OF support
AS3711 regulator OF support only evaluates standard regulator DT
properties.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-25 01:08:09 +00:00
Ian Lartey 574651f0f8 regulator: palmas remove palmas-charger option from DT bindings
Signed-off-by: Ian Lartey <ian@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-25 01:07:25 +00:00
Maxime Ripard 167d41dce7 regulator: Fix typo in of_get_regulator function comments
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-25 01:06:35 +00:00
Bengt Jonsson 732805a563 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>
2013-03-22 12:03:17 +01:00
Lee Jones 33bc8f46a8 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>
2013-03-22 12:03:17 +01:00
Lee Jones 3c1b8438d4 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>
2013-03-22 12:03:16 +01:00
Bengt Jonsson 7ce4669c8f 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>
2013-03-22 12:03:16 +01:00
Emeric Vigier bd28a15733 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>
2013-03-22 12:03:16 +01:00
Lee Jones d79df329d0 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>
2013-03-22 12:03:16 +01:00
Alexandru Gheorghiu eb8ad60991 regulator: fan53555: Use PTR_RET function
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-20 14:30:12 +01:00
Laxman Dewangan bbcf50b1d6 regulator: palmas: rename probe/remove callback functions
When palmas regulator probe creates stack dump during initialization
due to some crash, it prints the call trace as follows:
[3.166321] [<c028fa20>] (_regmap_read+0x5c/0xa8) from [<c028fab0>] (regmap_read+0x44/0x5c)
[3.174669] [<c028fab0>] (regmap_read+0x44/0x5c) from [<c023062c>] (palmas_probe+0x240/0x7d0)
[3.183193] [<c023062c>] (palmas_probe+0x240/0x7d0) from [<c0284064>] (platform_drv_probe+0x14/0x18)
[3.192322] [<c0284064>] (platform_drv_probe+0x14/0x18) from [<c0282ee4>] (driver_probe_device+0x104/0x214)
[3.202055] [<c0282ee4>] (driver_probe_device+0x104/0x214) from [<c028167c>] (bus_for_each_drv+0x5c/0x88)

The palmas_probe is current name but it helps on debugging if the
function name is more appropriate to the sub-module name.

Renaming the palmas_probe() to palmas_regulator_probe() and
palmas_remove() to palams_regulator_remove().

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-20 13:38:09 +01:00
Axel Lin 71f2146f6c regulator: palmas: Use of_property_read_bool to read "ti,warm-reset" DT property
It does not make sense to assign return value of of_property_read_u32() to
pdata->reg_init[idx]->warm_reset. Use of_property_read_bool() to read
"ti,warm-reset" DT property instead which will return correct setting
for pdata->reg_init[idx]->warm_reset.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-12 18:16:17 +00:00