Add support for CPR target quotient scaling for the virtual
corners between all adjacent pairs of fuse corners. Currently
target quotient scaling only occurs for the virtual corners that
fall between the highest and second highest fuse corners.
This modification ensures that further power savings are
possible on boards that have multiple virtual corners associated
with the lower fuse corners.
Change-Id: I078f32557531ffb8305d8e7e8225658da821aef4
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
Ensure that all per-virtual-corner open-loop voltage values are
rounded up to the nearest supported regulator set point.
Change-Id: Id2bbb71f525f058f6bf49aa957dc70bed7c4be2c
Signed-off-by: David Collins <collinsd@codeaurora.org>
Use linear interpolation of frequencies to calculate the CPR
open-loop voltage for each virtual voltage corner. Fill an
operating point table associated with the regulator device with
<virtual corner, open loop voltage> pairs.
The open-loop voltage values are used as initial voltages when
CPR is enabled. They are also used all the time when CPR is
disabled.
Change-Id: I424ee8a6178e85525601a9d24d161e602ac602f9
Signed-off-by: David Collins <collinsd@codeaurora.org>
Reduce the minimum CPR target quotient difference allowed between
the highest and second highest fuse corners from 100 to 50. This
ensures that CPR stays enabled for VDD_APC1 on MSM8994v2. The
CPR ring oscillators used for VDD_APC1 on MSM8994v2 output low
values. Therefore, the difference between the Turbo and Nominal
target quotient fuse values may legitimately be less than 100.
Change-Id: Ia662dd05f3af9148a63298900970cdb0c0824c50
Signed-off-by: David Collins <collinsd@codeaurora.org>
The i2c-core may perform a bus recovery procedure if
the I2C lines are stuck low. In such a case the client
is expected to retry its i2c transaction. Add a mechanism
to perform multiple delayed retries in case of a I2C
transaction failure.
CRs-Fixed: 715354
Change-Id: I7ef83f1a633ed80830e52e8ccd7bb36144900093
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
The i2c-core may perform a bus recovery procedure if
the I2C lines are stuck low. In such a case the client
is expected to retry its i2c transaction. Add a mechanism
to perform multiple delayed retries in case of a I2C
transaction failure.
CRs-Fixed: 715354
Change-Id: Idbdeb070740752be958bb877d9c538a35c99eb7b
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Add support for per-virtual-corner ceiling and floor voltage
limits to be specified via device tree. These limits override
the required per-fuse-corner limits also specified via device
tree.
Specifying per-virtual-corner floor voltages allows for further
power savings on chips which can safely operate at lower voltages
for the lower CPU frequenices associated with a given fuse
corner.
Change-Id: I3712bb34a55155780445cbecbd5190e2da31c35a
CRs-Fixed: 721967
Signed-off-by: David Collins <collinsd@codeaurora.org>
commit 5b919f3ebb533cbe400664837e24f66a0836b907 upstream.
WM5110/8280 devices do not support bypass mode for LDO1 so remove
the bypass callbacks registered with regulator core.
Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Print the CPR up and down threshold values into the kernel log so
that it is easy to verify that a given device is utilizing
correct values.
Change-Id: Ib690918cda16e72ea77df40e6f0b425bc9c35580
CRs-Fixed: 723371
Signed-off-by: David Collins <collinsd@codeaurora.org>
Some targets need specific data to be configured into L1 and L2
CUSTOM_ACC registers across APC corner switch. Add support to
pass custom register addresses and configuration data through
device tree.
CRs-Fixed: 715818
Change-Id: I96245382d3980f96ec7a1eea5d680284939ae925
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Add a notifier event which is triggered when a regulator is
enabled. This can be used by a driver which must configure the
hardware state whenever a given supply is enabled even if some
other consumer was responsible for enabling the supply.
Change-Id: Ic8363308b64953451dd01756e1bfdc2a64527096
Signed-off-by: David Collins <collinsd@codeaurora.org>
The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Use the new API while maintaining backward
compatibility.
Change-Id: I9e93d2120d91a014da244dd1291eaa941235c4a8
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Use the new API while maintaining backward
compatibility.
Change-Id: Ia6e5ab948f31c03cfcf7d1391154c18148b7099f
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Add support for sending dynamic requests for the enable pin
control parameter 'pcen' via regulator_enable() and
regulator_disable() calls. This is managed via a new device tree
property which specifies the 'pcen' value to send for both the
disabled and enabled logical states.
Change-Id: I80744f112298f6de3761ac1868a0589686f633a2
Signed-off-by: David Collins <collinsd@codeaurora.org>
Some targets share a single ACC control register between two
independent application processor clusters. Add locking around
ACC register updating calls in order to guarantee mutual
exclusion between the clusters on these targets.
Change-Id: If3bfdd6b6e798fafed4df9131b5620172cacd72f
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support for arbitrary L1 and L2 memory accelerator selector
sizes. The default value of 2 is not sufficient for all targets.
Provide this support via a pair of new device tree properties.
Change-Id: I8c625e16852451be500c711c4011971fd7dfce34
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support for a boolean device tree property which can be
specified in order to cause default initial parameter values to
be sent to the RPM before any consumers have made their own
requests. This feature can be used in situations where it is
not desirable to enable a RPM controlled regulator but where some
other SMD parameter must be sent.
Change-Id: Ic9ed813064b0d3e3884fc328af7cb6b8562b9dfe
Signed-off-by: David Collins <collinsd@codeaurora.org>
The function of_property_read_bool() is used in the
tps65132-regulator driver to test for the existence of
non-boolean device tree property i2c-pwr-supply. This call will
work as expected; however, of_property_read_bool() is only meant
to be used for reading boolean device tree properties.
Replace this usage of of_property_read_bool() with
of_find_property().
Change-Id: I7f206d18db29899e04effea4a63c60f9ee5c1937
Signed-off-by: David Collins <collinsd@codeaurora.org>
The function of_property_read_bool() is used in the
proxy-consumer driver to test for the existence of non-boolean
device tree properties qcom,proxy-consumer-voltage and
qcom,proxy-consumer-current. These calls will work as expected;
however, of_property_read_bool() is only meant to be used for
reading boolean device tree properties.
Replace all usages of of_property_read_bool() which test for
non-boolean property existence with of_find_property().
Change-Id: I83a718d05f5495f514d6a70004fcb5a2780d45c0
Signed-off-by: David Collins <collinsd@codeaurora.org>
The function of_property_read_bool() is used in several places
in the cpr-regulator driver to test for the existence of
non-boolean device tree properties. These calls will work as
expected; however, of_property_read_bool() is only meant to be
used for reading boolean device tree properties.
Replace all usages of of_property_read_bool() which test for
non-boolean property existence with of_find_property().
Change-Id: Icafaa209443d9fd24b5bbbc023c1fb70f9928249
Signed-off-by: David Collins <collinsd@codeaurora.org>
The debugfs node allows read/write access to all the FAN buck
registers. Useful in validating the regulator.
Change-Id: Ie7203d6c1e31a58619d7ff5313f682c961258c37
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Remove cpr_vreg pointer NULL checks in cpr-regulator debugfs
callback functions. The cpr_vreg pointer is guaranteed to be
valid in these callback functions so there is no need to check
it. Additionally, the print statements inside of the NULL checks
where incorrectly referencing cpr_vreg after it was known to be
NULL.
Change-Id: Id2efd9f28f97ce448fd86f03922ca2cfd63173a8
Signed-off-by: David Collins <collinsd@codeaurora.org>
Correct the condition that is checked to determine if an
spm-regulator device is operating in LV (low voltage) or MV
(medium voltage) range. This ensures that the proper range
name is printed by the probe function.
Change-Id: Ie0e1075405cadd1961beefeef8fb0a8b9c2a6bf4
Signed-off-by: David Collins <collinsd@codeaurora.org>
The msm_spm_set_vdd() function can only succeed if at least one
core of the cluster powered by the supply regulator is online.
However, it is valid for consumers to make voltage requests when
all cores are offline. This typically happens during suspend
after the last core of a secondary cluster is taken offline or
during resume before the first core of a secondary cluster is
brought back online.
Change the log level for the SPMI fall back message that is
printed when msm_spm_set_vdd() returns an error from err to
debug. This ensures that confusion cannot arise from seeing
the fall back message and assuming that it was generated due
to incorrect operation.
Change-Id: I5a970173f628c762b0ec328aa8a6ba2c4bc1bdf1
Signed-off-by: David Collins <collinsd@codeaurora.org>
Change the cpr-regulator interrupt handler log message that is
printed if an unknown IRQ status bit is set from err to debug
log level. This message is printed in the case that software
changes the voltage corner of a cpr-regulator device during the
interval between when a CPR interrupt physically triggers and
when the handler for it is executed. Since this behavior does
not correspond to an error case, the message should only be
printed for debugging purposes.
Change-Id: Ib1a00e456186586e1ccd025a817bf60b04f59745
Signed-off-by: David Collins <collinsd@codeaurora.org>
Recent targets trigger many CPR interrupts while in steady state.
This results in a huge amount of noise in the kernel log since
CPR interrupt messages are printed by default. Change the
default behavior so that no CPR debug messages are printed.
It is still possible to re-enable cpr-regulator debug printing
at runtime from userspace if necessary.
Change-Id: I24227c08c27e1039278a36d758463bcdd78b93aa
Signed-off-by: David Collins <collinsd@codeaurora.org>
Explicitly define the values to use for the
qcom,cpr-speed-bin-max-corners device tree property in order to
support CPR target quotient scaling when no speed bin fuse is
present.
Change-Id: Ibb7ce486402b0d4a24e4862ccd68d91ad938465e
Signed-off-by: David Collins <collinsd@codeaurora.org>
Update all kernel log printing statements in the cpr-regulator
driver so that they include the name of the regulator that the
message corresponds to. This ensures that it is possible to
distinguish messages generated by different regulator devices on
boards that have more than one cpr-regulator device.
Change-Id: I84c7a85ce98375e450a65a3623d407a626324cfe
Signed-off-by: David Collins <collinsd@codeaurora.org>
Modify the cpr-regulator driver so that CPR is not enabled (i.e.
LOOP_EN set to 1) in the case that vreg_enable is false. At the
same time, move vreg_enable setting statements inside of mutex
protected blocks in order to avoid race conditions between the
debugfs, regulator, and suspend/resume call paths.
If CPR is enabled while vreg_enable is false, then unexpected CPR
interrupts will likely fire due to the physical APC voltage not
matching the logical value. The physical APC voltage is only
guaranteed to change after the enable callback is called at which
point vreg_enable is set to true.
Change-Id: I1cff2db1d0527f6675d7592a64ed6303da6dcacf
Signed-off-by: David Collins <collinsd@codeaurora.org>
Modify the cpr-regulator driver so that cpr_corner_restore() is
called in place of cpr_corner_switch() in the
cpr_regulator_enable() function. This is needed because the
cpr_corner_switch() call will always have no effect since the
corner value passed in is cpr_vreg->corner. By not updating the
corner related register values, it is possible to get stuck in a
situation where CPR is enabled for a corner but the target
quotient being used corresponds to a different corner. If the
new corner is supposed to have a higher target quotient than the
previous corner, then this situation can result in a crash due to
undervolting the processor.
Change-Id: I4f7192a187641e140062ebea72c4c62edddc6421
Signed-off-by: David Collins <collinsd@codeaurora.org>
On some targets both the L1 and L2 ACC configuration
bits are located in the same register. Caching this
register per memory may lead to incorrect ACC values
being programmed. Fix this by always using the latest
ACC configuration from the memory.
Change-Id: Ie3ab96666f6db98559332afd0349d464a5ad1348
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Update the cpr-regulator driver so that the clamp timer interval
register parameter can be configured for a given cpr-regulator
device via the qcom,cpr-clamp-timer-interval device tree
property. The clamp timer interval defines a delay to wait with
the CPR controller loop disabled after the CPU clamp signal
changes or a new sensor bypass or mask register value is written.
A non-zero clamp timer interval value can be used to handle
resetting CPR sensors that are disabled on processors that make
use of BHS type switches for power collapsing.
A side effect of using a non-zero clamp timer interval value is
that software will not be able to determine the error or
error_steps values associated with a given CPR up or down
recommendation.
Change-Id: Ied5d689848d042ee60488f5001b0ca267627497a
CRs-Fixed: 687809
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add a fuse based logic to skip the L1 memory ACC configuration. This is
required on some parts.
CRs-Fixed: 680261
Change-Id: Id07d65b8482f63e114ec6ae3b3fc3b961235d846
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Compiling the kernel with the -O2 GCC flag reveals a number
of warnings relating to potentially uninitialized variables
and other edge cases.
Change-Id: I3758dbe1af276d79f55188b9f2db850c730acb80
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Add a global linked list named cpr_regulator_list to keep track
of all cpr-regulator devices. It can be used when analyzing RAM
dumps in order find out the state of cpr-regulator devices at the
time of a crash.
Change-Id: Ic2abc76c02799edd641e49ee0dfe003614802b11
Signed-off-by: David Collins <collinsd@codeaurora.org>
The cpr_enable module parameter is currently tied to a global
pointer, the_cpr, which corresponds to the last cpr-regulator
device probed. This means that it is not possible to enable or
disable the CPR controller for the cpr-regulator devices that
probed first.
Remove the the_cpr pointer and the cpr_enable module parameter.
Replace them with a debugfs node for each cpr-regulator device
which can be used to enable and disable CPR individually.
Also fix the callback for the existing debug_info debugfs node
since it depends upon the_cpr.
New Debug Interface:
/sys/module/cpr_regulator/parameters/debug_enable
Integer in which bit 0 enables kernel log messages
generated when handling CPR interrupts and bit 1 enables
other cpr-regulator log messages. This parameter affects
all cpr-regulator devices.
/sys/kernel/debug/regulator/<regulator-name>/cpr_enable
Integer which controls whether or not CPR is enabled for
a particular cpr-regulator device. A value of 0
corresponds to CPR disabled and a value of 1 corresponds
to CPR enabled. <regulator-name> corresponds to
the name of the cpr-regulator device which is specified
via the regulator-name device tree property.
/sys/kernel/debug/regulator/<regulator-name>/debug_info
CPR status information for a particular cpr-regulator
device. <regulator-name> corresponds to the name of the
cpr-regulator device which is specified via the
regulator-name device tree property.
Old Debug Interface:
/sys/module/cpr_regulator/parameters/debug_enable
Integer in which bit 0 enables kernel log messages
generated when handling CPR interrupts and bit 1 enables
other cpr-regulator log messages. This parameter affects
all cpr-regulator devices.
/sys/module/cpr_regulator/parameters/cpr_enable
Integer which controls whether or not CPR is enabled for
the last cpr-regulator device probed. A value of 0
corresponds to CPR disabled and a value of 1 corresponds
to CPR enabled. This parameter incorrectly does not
control the CPR enable state for the first cpr-regulator
devices probed.
/sys/kernel/debug/regulator/<regulator-name>/debug_info
CPR status information for the last cpr-regulator device
probed (regardless of which cpr-regulator device it seems
to be associated with). <regulator-name> corresponds to
the name of the cpr-regulator device which is specified
via the regulator-name device tree property.
Change-Id: I404ebdb3180f7dd9ae095867f7545d274be29e62
Signed-off-by: David Collins <collinsd@codeaurora.org>
Update the spm-regulator driver so that it falls back on an SPMI
register write if the msm_spm_set_vdd() call to set the voltage
of a regulator fails. This retry mechanism is needed because
msm_spm_set_vdd() is not guaranteed to work for all regulators at
all times. It can only work if at least one processor core
powered by the regulator is online. Unfortunately, the clock
driver may request a voltage during the process of bringing the
first such core online.
Change-Id: I93980d603a324da2b8d21e0b78958ff5032168b0
Signed-off-by: David Collins <collinsd@codeaurora.org>
The debugfs node allow read/write access to all the NCP
registers. Useful in validating the regulator.
Change-Id: Ia313afad45efccc6831ffea641a3575ef43dbdd0
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Some SoCs have extremely limited fuse space. In order to save
fuse bits, the CPR target quotients are packed to take up less
space. Add support to unpack the target quotient for each fuse
corner using an offset and multiplier.
Change-Id: Ie1b49b8e881dbb239277876c8a4ae8603832e878
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support in the cpr-regulator driver for a new device tree
property named qcom,cpr-init-voltage-ref which specifies the
reference voltages to use when decoding initial voltage fuse
values. This property decouples inital voltage fuse decoding
from the specification of CPR ceiling voltages. This feature
is needed since some SoCs utilize reference voltages which
are different from the ceiling voltages.
Change-Id: I87cd8a053253fa538e773aefa774c53ab69063a2
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add ti,en-gpio-lpm property to set the enable pins to input/pull
down state when the boost regulator being disabled. This can reduce the
rock bottom power numbers when system entering into sleep state with the
regulators disabled.
Take this chance to correct a typo of drive-strength property specified
in tps65132-en-pin pin group node for msm8916 QRD SKUH board.
Change-Id: I2c2df1f4893c31deeba02c3b2988d1157bdb7b61
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Some SoCs utilize more than three CPR fuse corners. Add support
for an arbitrary number of fuse corners which is specified via
the device tree property qcom,cpr-fuse-corners.
Update the description for device tree properties that have fixed
sizes to support exactly three fuse corners (SVS, Nominal, Turbo)
in order to denote that their size is now dependent upon the
value of qcom,cpr-fuse-corners. Also replace all fixed size
arrays in the cpr-regulator driver which are used to hold fuse
corner data with dynamically allocated arrays.
Change-Id: Iead3e6e1fba329bf745970925f9faa2a5a227dcf
Signed-off-by: David Collins <collinsd@codeaurora.org>
Currently, the voltage transition slew rate setting for fan53555 is
based on 10 mV voltage scaling step. For regulator with a scaling step
other than 10 mV, the slew rate has a relationship between voltage
scaling step and the slew rate based on 10 mV voltage scaling step.
Change the slew rate setting according to the voltage scaling step, and
round it to a lower avaiable value if it is an itermediate one.
Change-Id: Iccb13ebcb4bac15d76420602363bdcdfe5fc0a2d
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
ACPU clock driver initialization has dependency on regulator driver
initialization. The cpufreq driver requires the ACPU clock handle which
in turn requires the APC regulator handle.
In commit cf54c951db ("clock-a7/krait:
Change initcall level for early probe"), the cpufreq driver was modified
to use subsys_initcall level and ACPU clock driver changed to use
arch_initcall level. Change fan53555 regulator driver to arch_initcall
level to make sure the cpufreq driver can probe successfully.
Change-Id: I0914648c04f50dd542ed872aaa76afe674607546
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
The chips with die revision 23 have 600 mV minimum voltage and 12.5 mV
step size. Add support for chips with this die revision.
Change-Id: Ie63637bdcfae73a706f364e74908d285c2a60954
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
TLMM_SPARE register will be controlled at bootloader. Remove the
TLMM_SPARE register access in onsemi-ncp6335d regulator driver.
This reverts commit e61b7c5004.
Change-Id: I73319ff47c6656e2c042736ad507c73ddb9065c8
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Print out the type, subtype, and digital major revision register
values when a regulator fails to match supported variants. This
will help when debugging PMIC simulator issues.
Change-Id: I4d0ca163921e6f14737df2977c39cf43b3d303d3
Signed-off-by: David Collins <collinsd@codeaurora.org>
Remove the target quotient validation check which requires the
nominal corner target quotient to be strictly greater than the
SVS corner target quotient. This check unnecessarily disables
CPR on targets which have an SVS quotient that is programmed to
be equal to the nominal quotient.
Change-Id: Ibb8e70d67c1042168e6a711915ef0dfe2fe34b96
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
ACPU clock driver initialization has dependency on regulator
driver initialization.
The cpufreq driver to successfully register requires the acpu
clock handle which in turn requires the apc regulator handle.
In a recent change the init-call ordering of the cpufreq and
acpu-clock drivers has changed to register them early. Move the
onsemi regulator initialization to arch_initcall() to handle
this modification.
Change-Id: I68d089df66ba559bf39c7d3f67702e1f98546f7c
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
TPS65132 is a dual output regulator chip. It is usually used for
providing positive and negative supply voltages for LCD panel source
driver ICs.
The chip has a positive supply rail and a negative supply rail. Both
rails support 4V~6V output voltage range and each rail can be
controlled separately.
Change-Id: I6012bc8dd0f19a8cd6a94fe00457fc65b8408346
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Add support in the spm-regulator driver to configure the PMIC
regulator voltage via SPMI instead of via SPM. This can be used
when simulated chips do not have fully functional SPM models.
Change-Id: Id75b3dd580ed267dfc5c647d36756690d32b774f
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support in the cpr-regulator driver for reading the following
fuse parameters which may span two fuse rows:
qcom,cpr-fuse-target-quot, qcom,cpr-fuse-ro-sel, and
qcom,cpr-fuse-init-voltage. This feature is required for new
chips which pack CPR parameters tightly without regard for fuse
row boundaries.
Change-Id: Idc28a54a37cdc0e40d25ca56e6726b76fc0db213
Signed-off-by: David Collins <collinsd@codeaurora.org>
The CPR target quotient register fields have a length of 12 bits.
However, some targets have a very limited number of fuse bits and
thus encode the target quotients for the different voltage
corners with less than 12 bits. Add support in the cpr-regulator
driver for the optional device tree property
qcom,cpr-fuse-target-quot-size which can be used to specify the
bit length of the target quotient fuse values for each corner.
Change-Id: Ibdb3e2b1adc415480fdf47977b9d1b8c3dc0193d
Signed-off-by: David Collins <collinsd@codeaurora.org>
Update the cpr-regulator driver and documentation in order to
make the qcom,cpr-fuse-bp-cpr-disable device tree property
optional. Some targets do not allocate a fuse bit for the
purpose of disabling CPR so this property cannot be considered
required.
Change-Id: I39aa59e92585c87b97714fc1684b17f3b9c0523f
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support for QPNP PMIC FTS 2.5 type regulators. This type of
regulator supports auto mode control, auto phase control, and
three phases enabled at one time. The FTS 2.5 voltage mapping is
similar to that of existing FTS 2 except for an additional
offset.
Change-Id: I0fa7876ce916f2d039d18a7d89ce7b32c783f68d
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support for QPNP PMIC FTS 2.5 type regulators. This type of
regulator supports auto mode control, auto phase control, and
three phases enabled at one time. The FTS 2.5 voltage mapping is
similar to that of existing FTS 2 except for an additional
offset.
Change-Id: I8c8a3498896fab795d3151a61e19c5b62bd02c2e
Signed-off-by: David Collins <collinsd@codeaurora.org>
commit 66fda75f47dc583f1c187556e9a2c082dd64f8c6 upstream.
There are many places where ops->disable is called directly. Instead we
should use _regulator_do_disable() which also handles gpio regulators.
To be able to use the wrapper function from _regulator_force_disable(),
I moved the _notifier_call_chain() call from _regulator_do_disable() to
_regulator_disable(). This way, _regulator_force_disable() can use
different flags for _notifier_call_chain() without calling it twice.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
disable_irq() is not an efficient call and could cause potential deadlock.
Improve the interrupt handling by removing disable_irq and enable_irq
completely, and instead, checking the state of the interrupt source
(LOOP_EN and BUSY bits) in ISR to bail out immediately if any condition is
not met.
CRs-Fixed: 630182
Change-Id: Ieedadf4f0db4febc41ab85f383af683bdaf34615
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Signed-off-by: Ke Liu <keliu@codeaurora.org>
commit 30c219710358c5cca2f8bd2e9e547c6aadf7cf8b upstream.
There are some direct ops->enable in the regulator core driver. This is
a potential issue as the function _regulator_do_enable() handles gpio
regulators and the normal ops->enable calls. These gpio regulators are
simply ignored when ops->enable is called directly.
One possible bug is that boot-on and always-on gpio regulators are not
enabled on registration.
This patch replaces all ops->enable calls by _regulator_do_enable.
[Handle missing enable operations -- broonie]
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Some devices do not have PVS version fuse bits. In such cases the
qcom,pvs-version-fuse-sel property cannot be specified. Initialize
pvs_version to 0 in the case that qcom,pvs-version-fuse-sel is not
present. This allows virtual corners to be used when there are no PVS
version fuse bits.
Change-Id: I835cc12c942a464bfda354fe53b9361ff352cf31
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
The memory accelerator controls delays while accessing
memories. These delays vary based on the power-mode.
Provide the power-mode (corner) information from CPR
to the memory accelerator driver through the regulator
interface.
Change-Id: I9c13df1695d760aa7b4797f3ba5dc65590cf21e6
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
The memory accelerator (MEM ACC) controls the delays applied during
memory access. These delays vary based on the power-mode (corner)
on which the memory is connected. This driver adds a regulator
interface to configure the power-mode of the memory accelerator
based on the APC (application processor) corner.
Change-Id: I830ff000f8a16c4d3de5bdebf48d424354ddb086
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
RPM regulator initialization is done at module_init level which is
late in the boot-up sequence and drivers dependent on regulators
do probe deferral.
Move RPM regulator initialization to arch_init level to minimize
probe deferrals by dependent drivers.
Change-Id: I3e0bc7cb46a90eb62418122869c70345da9217ee
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Check the status of the spm driver using msm_spm_probe_done()
inside of the spm-regulator probe function. Return any error
code from the probe function. This ensures that spm-regulator
will defer its probe in the case that the spm driver has not
yet probed.
Change-Id: I6d006cee6289bd51e38271e70f81c7a4622016ee
Signed-off-by: David Collins <collinsd@codeaurora.org>
The CPR scheme fuse bit is used for indicating if a global or local
target scheme is used for CPR. It will be eliminated on some future
devices.
Make the "qcom,cpr-fuse-bp-scheme" property optional to allow the
future devices without a scheme fuse bit to boot up successfully.
Change-Id: I892e763a0875ec8a5abec8798485defae9b3252b
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Currently, CPR redundant fuse checking for CPR ring oscillation
selection and target quotient values is mandatory.
However, some devices lack these redundant fuse bits in order to save
space. Therefore, redefine the affected device tree properties as
optional and update the cpr-regulator driver so that it can function
without them.
Change-Id: I5461fc4b173fac318986d7762bbcb15ba86a5a88
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
A new initial voltage coding scheme has been introduced which defines
the initial voltage for each fuse corner using its own fuse value.
Previously, the initial voltage for all fuse corners was determined
from a single PVS bin fuse value. Add support in the cpr-regulator
driver for this new initial voltage coding scheme.
Each fuse encodes the initial voltage for a fuse corner as follows. The
MSB of the fuse value is a sign bit. The remaining bits define an offset.
The offset has units of a predetermined step size which is captured in
device tree. The initial voltage is then: ceiling_voltage - sign *
offset.
Change-Id: I6d48f3c68d62adc730fd406f937f7f3033b73552
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
Move the cpr-regulator driver from the arch/arm/mach-msm
directory into the drivers/regulator directory. Moving this
driver out of the arch/arm/mach-msm directory allows it to be
shared with architectures other than 'arm'. In particular,
moving it allows it to be used by arm64.
Change-Id: I0b487c7fae42c260e06f5b70d1716bfbef065f4b
Signed-off-by: David Collins <collinsd@codeaurora.org>
Move the spm-regulator driver from the arch/arm/mach-msm
directory into the drivers/regulator directory. Moving this
driver out of the arch/arm/mach-msm directory allows it to be
shared with architectures other than 'arm'. In particular,
moving it allows it to be used by arm64.
Also move the header file for the spm-regulator driver from the
arch/arm/mach-msm directory into the include/linux/regulator
directory. Moving the header file requires updating all files
which include it.
Change-Id: I0c5a20a5f3512ef19c9cdb939342224d11667650
Signed-off-by: David Collins <collinsd@codeaurora.org>
Move rpm-smd and rpm-notifier headers to a machine independent
directory in kernel. Change the source files which are referring
to these headers and point them to a new location.
Change-Id: I69f0c1189ac9c69d8e869534f2f6689bf3ac980e
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Add support to the onsemi-ncp6335d driver to select which regulator
operating mode to utilize. There are two possible mode selections: PWM mode
and auto mode. If no mode property is specified in device tree, the
regulator will operate in the hardware default mode.
CRs-Fixed: 607899
Change-Id: I2e21c452a3ea3963146d9abbc7e89e811fd90388
Signed-off-by: Ke Liu <keliu@codeaurora.org>
Certain Qualcomm chips mux the output of some GPIOs using the TLMM_SPARE
register. Add support for a device tree property which can be used to
specify a mask and value to write into this register so that the VSEL GPIO
can be toggled successfully on affected devices. When the appropriate bits
in the TLMM_SPARE register are written, the physical output of the GPIO can
be controlled normally via GPIO control registers.
Change-Id: Ic8a0886886a44687931ab5cb8150383cd84db2f6
Signed-off-by: Ke Liu <keliu@codeaurora.org>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>