Commit Graph

70 Commits

Author SHA1 Message Date
Manaf Meethalavalappu Pallikunhi 54a36422d8 msm: thermal: Maintain state in the mitigation device monitor
If KTM get a trip threshold trigger notification and if the
temperature stays the same as the recent trip threshold, KTM will
re-activate the recently triggered threshold, resulting in back to
back interrupts. To avoid this add support in KTM to maintain the
recently triggered threshold state and then re-active the threshold
based on the last threshold trip.
This state is updated for mitigation features like VDD MX retention,
CX phase control, VDD restriction, OCR monitor and external clients
like CPR low temperature monitor etc.

CRs-Fixed: 969112 972634
Change-Id: I44c0a93e1507a9f0b8a65e5c2ce5a98962bb335b
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2016-04-14 03:14:08 -07:00
Tirupathi Reddy 103d3f3b8e regulator: cpr-regulator: Update CPR de-aging algorithm
Configure vdd-supply to PWM mode for CPR de-aging measurements.
Also, perform multiple aging measurements and then average the
results in order to determine the final aging adjustment value.

Also, during CPR aging measurements for some power-domains it may
not be required to bypass the sensors. Handle this case by making
the sensor-bypass property optional.

CRs-Fixed: 913916
Change-Id: Ifb8447f1afe379c7108dca4e96d733dd256703e7
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-10-20 14:20:52 +05:30
Anirudh Ghayal 31eccc3394 regulator: cpr-regulator: Enable/disable closed-loop CPR on temperature
Add logic to enable/disable closed-loop CPR based on TSENS temperature.
Use the thermal sensor interface which allows monitoring TSENS
temperature thresholds and notifies when the configured threshold is hit.

Use the notification callbacks to disable/enable CPR and force open-loop
voltage.

CRs-Fixed: 903646
Change-Id: Id131f7570740dce4445ce1849ae0551d6207c737
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2015-09-14 19:45:21 +05:30
Ravindranath Thiyagarajan 8d74a3c011 regulator: cpr-regulator: Add CPR de-aging support
CPR aging sensors detect the performance degradation
resulting from silicon aging. The CPR de-aging algorithm
detects the aging degradation of the device by reading
aging sensor data and generating necessary voltage guard band
to maintain SoC performance. Limit the generated voltage
guard band to a pre-defined threshold.

Change-Id: Iea6123c1b42856bb123d3e1c79f60401882aa8ba
Signed-off-by: Ravindranath Thiyagarajan <rthiyaga@codeaurora.org>
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-09-03 00:12:53 -07:00
Abhijeet Dharmapurikar 3a51deb29e regulator: cpr-regulator: Add support for Voltage Sensors
Voltage sensor regulators need to be notified when the corner of apc
rail changes. Voltage Sensor regulator needs to be disabled prior
to changing the apc corner and needs to be notified of the ceiling
and floor voltage before enabling it again.

Change-Id: I0156480f6bfaf10397578caded2c15a298f20f95
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2015-08-13 14:32:16 +05:30
Ravindranath Thiyagarajan 43ce3e853e regulator: cpr-regulator: Add a per cpr corner to mem-acc corner map
Define an array to map the CPR corner to MEM ACC corner. This allows
finer ACC configuration for individual corners. This is an optional
mapping provided through the device node. If not specified, the
fuse-corners are mapped as acc corners.

Change-Id: I260d4a906e0b16bacc9e724dd910c0afbe97925c
Signed-off-by: Ravindranath Thiyagarajan <rthiyaga@codeaurora.org>
2015-08-07 18:37:50 -07:00
Tirupathi Reddy 6f7ae40807 regulator: cpr-regulator: specify a list_corner_voltage callback function
Define a list_corner_voltage callback function for the
cpr-regulator driver so that consumers can determine the CPR
ceiling voltage for each voltage corner.

Change-Id: Ic80ade45228fe8d452a4aad41e94ef44444b6124
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-06-30 16:45:25 +05:30
Tirupathi Reddy 2d48eb9d78 regulator: cpr-regulator: Make rbcpr clk selection optional
Some targets don't need rbcpr clk selection.

Change-Id: I5e23f581fb8ef714cb0c22809a3dd4e1fb214966
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-06-12 23:51:49 +05:30
Tirupathi Reddy 04cf646617 regulator: cpr-regulator: Specify the floor-to-ceiling max range
Compute the per-corner floor voltage limits from per-corner
ceiling voltages with an offset specified by device-tree property.
Assign the per-corner floor voltage as a max of the original per-corner
floor voltage and the calculated floor voltage.

CRs-Fixed: 849156
Change-Id: Ib9c1892e548770ef669419d74ecf8311f5a2cb33
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-06-05 13:46:05 +05:30
Subbaraman Narayanamurthy 70dccb5244 regulator: cpr-regulator: improve handling of incorrect target quotients
Currently, if the fused target quotient of a fuse corner (SVS)
is less than the target quotient of the previous fuse corner
(SVS2), then CPR closed loop operation is disabled permanently.
However, it would be good to adjust the target quotients before
doing the conditional check above so that the adjustments will
be applied before the decision is made.

Disable CPR closed-loop operation only if the ring oscillators
(RO) are same between the adjacent fuse corners so that
closed-loop operation is allowed for the targets that have
different RO.

In addition, when the aforementioned condition exists, set the
scaling factor for that fuse corner to zero so that it does not
end up as a huge unsigned integer value.

Also, if the CPR regulator device uses the quotient offset for
the quotient interpolation and it ends up using the same RO for
the adjacent fuse corners, then fall back to using target
quotient based linear interpolation instead of the quotient
offset based one. This ensures that the interpolation is
performed correctly in the scenario above.

CRs-Fixed: 841986
Change-Id: I05880858bf5279545734e20e6d76298e24dec6ce
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2015-05-22 10:47:09 -07:00
David Collins 25823f396d regulator: cpr-regulator: fix race condition in CPU hotplug callback
Fix a race condition which occurs when setting the voltage corner
of a cpr-regulator device from both the regulator framework and
the CPU hotplug paths simultaneously.  This issue was introduced
by this change: 48ba32f0eb -
"regulator: cpr-regulator: add online CPUs based voltage
adjustment support"

This race condition can cause crashes due to undervolting on
boards which define per-online-core target quotient or initial
voltage adjustments when the following events occur:

    0. Initial state: regulator at corner X
        (i.e. cpr_vreg->corner = X)
    1. cpr_regulator_set_voltage() called from the regulator
        framework path for corner Y where Y > X
    2. cpr_regulator_cpu_callback() is executed and reads
        cpr_vreg->corner finding its value equal to X
    3. cpr_regulator_cpu_callback() calls
        cpr_regulator_set_voltage() to set corner X (this is
        blocked waiting on the mutex)
    4. cpr_regulator_set_voltage() call from the regulator
        framework path finishes setting corner Y and releases the mutex
    5. cpr_regulator_set_voltage() call from hotplug path begins
        switching to corner X
    6. cpr_regulator_set_voltage() call from hotplug path
        finishes switching to corner X
    7. The voltage for corner X is insufficient for the processor
        frequency which requested corner Y leading to a crash
        (likely from an L2 cache bit flip)

Correct this race condition by taking the mutex lock before
accessing any cpr_vreg struct members in
cpr_regulator_cpu_callback().

Change-Id: I019f0246f068be8eeabe8b24dc5e7bd67ef5d2dd
Signed-off-by: David Collins <collinsd@codeaurora.org>
2015-05-13 13:54:38 -07:00
Linux Build Service Account 99ec73f070 Merge "regulator: cpr-regulator: Use a different multiplier for quotient offsets" 2015-04-23 06:58:49 -07:00
Tirupathi Reddy b31276da9f regulator: cpr-regulator: Use a different multiplier for quotient offsets
A common multiplier is being used for decoding both target quotients and
quotient offset values. Some targets need different multiplier values
for decoding the target quotients and quotient offset values. Define a new
device property to pass the multiplier values for decoding quotient offset
values of each fuse corner.

Change-Id: I4dd4ecaeafda3c04c26cd2db17367d36bc553303
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-04-21 12:44:05 +05:30
Tirupathi Reddy 5be47d1b59 regulator: cpr-regulator: Fix CPR initialization code for invalid quotients
Allow normal CPR driver initialization even when the fused CPR
target quotients are invalid so that necessary data structures
are allocated and initialized.  The device is allowed to run
using open-loop voltages with CPR disabled in this case.

CRs-Fixed: 823331
Change-Id: Iff1bf978290571df8e757c6eaf8b168e2be8972c
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-04-17 13:06:24 -07:00
Anirudh Ghayal 0917487e97 regulator: cpr-regulator: Notify the current APC corner to RPM
Use the RPM regulator interface to notify the APC
operating corner. This can be used by RPM to implement
logic requiring APPS corner details.

Change-Id: Idef66468e9e42ab1d5e27db346f1e2b606d07dc9
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2015-04-12 09:54:27 -07:00
Tirupathi Reddy 82e266e398 regulator: cpr-regulator: Add support for per-corner VDD_MX mapping
On some targets, intermediate corners are defined for VDD_MX.
The MX to APC corner mapping should support the newly introduced
MX corners. Add a new enum to select this method of determining
vmin for VDD_MX. Use the existing qcom,vdd-mx-corner-map property
to pass the per-corner VDD_MX mapping. The length of vdd-mx-corner
map depends on the selection of vdd-mx method.

Change-Id: I7f345b6cfcc51124c39270d9484eb1240e3e906d
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-04-10 17:49:06 +05:30
David Collins 48ba32f0eb regulator: cpr-regulator: add online CPUs based voltage adjustment support
Add support to adjust the CPR target quotients and/or the CPR initial
voltages (a.k.a open loop voltages) per corner based on the number of
online CPUs. This will help in saving power when the cores are
hot-plugged.

CRs-Fixed: 773979
Change-Id: I474ceed824cfb0cde172feb27bc20c185a4f854d
Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Signed-off-by: Ke Liu <keliu@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2015-02-24 17:57:32 -08:00
Linux Build Service Account 804bc29cef Merge "regulator: cpr-regulator: Add minimum difference allowed for quotients" 2015-01-17 20:28:28 -08:00
Tirupathi Reddy c9018aabb5 regulator: cpr-regulator: Add minimum difference allowed for quotients
Sometimes after power-optimization adjustments to the fused quotients
the values may end up in a non-increasing order (NOM > TURBO) or
may get very close to each other. In the former case the driver
disables CPR. To avoid this, add support for specifying a minimum quotient
difference between 2 fuse corners. If this difference is not met add a
configurable quotient offset to the fuse corner quotient.

Example:
	cpr-fuse-min-quot-diff = <0 0 40>;
	cpr-min-quot-diff-adjustment = <0 0 104>;

	CPR log snippet:
		Corner[2] adjusted quotient = 1275
		Corner[3] adjusted quotient = 1261

	After adjustment applied:
		Corner[3] revised adjusted quotient = 1379

Change-Id: Iec8b9a703a0018620f6d1d23326e6a32c3bf88d0
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
2015-01-13 19:13:16 +05:30
Ke Liu 5432bdbb6a regulator: cpr-regulator: add debugfs support for cpr voltage limits
Add support for checking the corresponding value for cpr ceiling, floor
and max_ceiling for the currently operating virtual corner.

CRs-Fixed: 773272
Change-Id: Ic1c42c0253ed6d6c84ce2cad26492d4e46f1ff83
Signed-off-by: Ke Liu <keliu@codeaurora.org>
2015-01-08 15:13:03 -08:00
Subbaraman Narayanamurthy be9c367109 regulator: cpr-regulator: support CPR closed loop based on the fuse version
In some SoCs, CPR closed loop should not be enabled for certain
CPR fusing revisions. Currently, there is no support to disable the
closed loop operation based on the fuse version. Add support for that
through qcom,cpr-allowed property.

The above property is tied with qcom,cpr-fuse-version-map property
so that this can be supported well for a particular fuse revision or
PVS bin or speed bin.

Change-Id: I7d315d0d739d60d755f2d3c40f4568c3c5f42bc9
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2014-12-31 10:07:41 -08:00
Subbaraman Narayanamurthy 48f93b0780 regulator: cpr-regulator: Add support for fuse based quotient offset
In some SOCs, quotient offsets per fuse corner can be programmed
in the fuse so that the software can make use of them without the
need to calculate them. Add support to read those quotient offsets
which are defined per fuse corner and use them to obtain the
quotient scaling factors, so that the quotient for a particular
frequency can be calculated.

In addition, add support to adjust target quotient offset based
on the values read from device tree.

Change-Id: I63c3376ea43eaff276bdeb0fdd7000c024abd46e
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2014-12-05 11:25:18 -08:00
Anirudh Ghayal b0392e0c05 regulator: cpr-regulator: Add a DT property for min. quotient difference
There are targets where the minimum target quotient difference between the
highest and (highest - 1) fuse corner may be lower than 50. Add an optional
property to allow passing this value as platform data. If the property
is not present use a default value of 50.

Change-Id: I72901d82743e6fb0915a7e53cefbd4861d0ca3db
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2014-11-27 11:52:47 +05:30
Fenglin Wu f38a3fadca regulator: cpr-regulator: Add wildcard for matching some fuse bits values
Add wildcard 0xffffffff for matching arbitrary speed bin and PVS version
values in qcom,cpr-speed-bin-max-corners,
qcom,cpr-voltage-ceiling-override and qcom,cpr-voltage-floor-override
properties.

Change-Id: I69505c9e1b397d1fa01ee4cf47cc178a77ddf02b
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2014-11-19 16:01:27 +05:30
Anirudh Ghayal dcf4a3a9c2 regulator: cpr-regulator: Add virtual-corner voltage/quotient adjustment
Add support to adjust the target quotient and init-voltage per virtual
corner. The adjustment values are specified via DT properties.
This allows finer granularity for quotient/voltage adjustments.

Change-Id: I3deffb070a0156acf9ceaa138357ae208a86df59
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2014-11-19 16:01:13 +05:30
David Collins 624bba6037 regulator: cpr-regulator: add support for per-RO CPR step quotient
Add support for using a different CPR step quotient value for
each possible ring oscillator (RO).  This ensures that equivalent
CPR dynamic voltage margins can be achieved on a given chip
regardless of which RO is used.

Also clear all RBCPR_GCNT_TARGET registers before switching
voltage corners so that only the expected RO is used.  This is
needed in order to support different RO's for each fuse corner.

Change-Id: If28d30c0f979669f46936f4e064119a69834d1e1
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-11-12 15:08:28 -08:00
David Collins e92cc16641 regulator: cpr-regulator: add support for initial voltage adjustment
Add support for initial voltage adjustment that is decided based
upon the values read out of a combination of fuse parameters.
This allows for precise control of initial voltages in order to
compensate for differences in characterization procedures used
along with specific CPR fuse revision and ring oscillator select
values.

Change-Id: I108931f2abe4186307c397e229e0fe34bf2761c6
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-11-06 15:16:11 -08:00
David Collins ba9d2d1968 regulator: cpr-regulator: add support for fine grained quotient adjustment
Add support for quotient adjustment that is decided based upon
the values read out of a combination of fuse parameters.  The
existing quotient adjustment only allows for a single set of
values that is applied to all chips.

Change-Id: Ic6e4c28db3da7ea49a161273f66d0602f9711ac1
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-11-06 15:02:53 -08:00
David Collins 859a4d882d regulator: cpr-regulator: add support for reading CPR fuse revision
Add support in the cpr-regulator driver for reading the CPR
fusing revision fuse parameter.  The location of this parameter
is defined using the qcom,cpr-fuse-revision device tree property.
The fusing revision value can be used on some chips in order to
determine what kind of adjustments are required.

Change-Id: I7355c41503bbc67c5114f56060920251397abc41
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-11-03 15:42:42 -08:00
David Collins 94e4b7b488 regulator: cpr-regulator: add support for fuse bit remapping
On certain targets some fuse parameters are split between
non-contiguous fuse rows.  The various device tree fuse
specification properties cannot handle such a layout.  Therefore,
add support for a pair of device tree properties which can be
used to remap arbitrary combinations of fuse bits into a single
contiguous range of virtual fuse rows.  These remapped fuse rows
can then be referenced by all other device tree fuse properties.

Change-Id: I9adba2547e91f124fa02f9c199b591166e2f9147
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-10-23 18:33:37 -07:00
David Collins 3d3905421a regulator: cpr-regulator: add support for redundant initial voltage fuses
Add support for a second set of per-fuse-corner initial voltage
fuses parameters which are utilized when a given chip is
configured to use redundant fuses.

Change-Id: I173eb87b11824cc18296fde2089a662e6834b274
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-10-23 18:33:27 -07:00
David Collins 3d32f8968c regulator: cpr-regulator: fix reading of >= 32 bit fuse parameters
The bit mask values calculated in the cpr_read_efuse_param()
function are not correct because the constant '1' is not
automatically promoted to unsigned long long int.  Therefore,
add explicit ULL suffixes to the constants so that the mask
values are calculated correctly.

Change-Id: Ic5e7ff02b5910b075d717fc4e0b5e81bd59ef810
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-10-22 13:27:56 -07:00
Linux Build Service Account 3384eda6c3 Merge "regulator: cpr-regulator: change CPR debug message level for OPP table" 2014-10-17 03:11:32 -07:00
Fenglin Wu 7febe37686 regulator: cpr-regulator: change CPR debug message level for OPP table
Change the CPR debug message level from error to debug if filling the
OPP table failed. This is to avoid logging the error messages on the
platforms which do not have pm_opp enabled.

Change-Id: I430ae7a38ae41ade8e7b94346f6fda77e8f5cb9c
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2014-10-16 14:31:45 +08:00
David Collins 31a41c69fd regulator: cpr-regulator: add support for CPR ceiling voltage reduction
Add support for a pair of device tree properties which specify
if the CPR ceiling voltage may be reduced to either the per-fuse-
corner initial voltage fuse value or the per-virtual-corner
interpolated initial voltage value (i.e. the open-loop voltage).

These properties can be used to save power on targets where the
closed-loop settled CPR voltage never needs to exceed the
open-loop initial voltage.

Change-Id: I359b6d8e0c98f4b7f00f7bd90efc72c2aa3865a7
Signed-off-by: David Collins <collinsd@codeaurora.org>
2014-10-13 18:22:30 -07:00
Linux Build Service Account 6d856ad7a7 Merge "regulator: cpr-regulator: reduce the minimum allowed quotient difference" 2014-10-12 11:50:38 -07:00
Fenglin Wu 3df0a8ff99 regulator: cpr-regulator: add support for all possible quotient scaling
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>
2014-10-08 14:21:48 -07:00
David Collins 378a8065c5 regulator: cpr-regulator: correctly round open-loop voltage values
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>
2014-10-08 13:33:48 -07:00
David Collins 21e8ae1775 regulator: cpr-regulator: fill OPP table with corner to open-loop voltage
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>
2014-10-06 16:11:30 -06:00
David Collins c647178223 regulator: cpr-regulator: reduce the minimum allowed quotient difference
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>
2014-10-03 14:55:05 -07:00
David Collins 73919a5f21 regulator: cpr-regulator: add support for per-virtual-corner voltage limits
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>
2014-09-26 13:44:55 -07:00
David Collins 1a279f0c66 regulator: cpr-regulator: log up and down threshold values
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>
2014-09-11 15:36:24 -07:00
Vikram Mulukutla 4f6308620c drivers: regulator: cpr-regulator: Add support for the new scm_call2 API
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>
2014-08-22 15:33:12 -07:00
David Collins ed37f85190 regulator: cpr-regulator: fix of_property_read_bool() usage
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>
2014-08-04 17:07:04 -07:00
David Collins b577004d38 regulator: cpr-regulator: remove unnecessary pointer checks in callbacks
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>
2014-07-29 17:16:40 -07:00
David Collins 93192a1b84 regulator: cpr-regulator: use debug log level for ISR unknown flag message
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>
2014-07-22 14:46:50 -07:00
David Collins ae00a3088e regulator: cpr-regulator: disable all debug printing by default
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>
2014-07-17 12:58:17 -07:00
David Collins 35924314ed regulator: cpr-regulator: define quotient scaling usage without speed bin
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>
2014-07-17 12:58:15 -07:00
David Collins 02e36442ca regulator: cpr-regulator: print regulator name in all log messages
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>
2014-07-08 11:51:42 -07:00
Linux Build Service Account 5f790c5663 Merge "regulator: cpr-regulator: do not enable CPR if vreg_enable is false" 2014-07-03 21:10:09 -07:00