As per msm8953 design, APM state machine could take more
than 200us for mode switching. Increase SW timeout constraint
value to 500us.
Also, update the mask used to check APM switch status.
CRs-Fixed: 992695
Change-Id: Ie0f8733fb5b39172fb14547292cbd05689a50230
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
The commit 639277b6c73c ("regulator: spm-regulator: Add additional
settling delay for FTS2.5 SMPS") incorrectly changed the usage
of 'uV' variable. The local 'uV' variable holds the correct voltage
level to be scaled up/down. Use it instead of vreg->uV.
CRs-Fixed: 1036738
Change-Id: I52540237a4db79c149409c6017ffc750b5abddd2
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Based on characterization add 70us settling delay on the voltage UP
to account for warm-up time and ramp-up delays for 0-10% and 90-100%
of the voltage value.
On the voltage ramp-down side add the stepper slew-rate delay and
and an additional 70us margin to avoid voltage updates while the
stepper is in progress. This could lead to voltage over/undershoot
due to buck-internal synchronization failure.
CRs-Fixed: 1036738
Change-Id: Id4230be9c4c981758bbf6860bab1f487a3b57f85
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
To accommodate speed bin 2 and fuse revisions associated with it
increase the fuse combo count from 16 to 24. At present, this is
needed for msm8996proAU SOC.
Change-Id: I8555162eab2c6bfead2e0762f28525e0aa56cf10
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
To accommodate speed bin 2 and fuse revisions associated with it
increase the fuse combo count from 16 to 24. At present, this is
needed for msm8996proAU SOC.
Change-Id: Ie781ffda433d491a38695caa5e55ec1ec7ff9b4a
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Temp_adj_en instantaneously reduces the voltage and quotient
when temperature enters into corresponding band which may cause
an aggressive reduction in voltage. Avoid this by not configuring
temp_adj_en bit, this only reduces the quotient and allows CPR to
react to the reduced quotient. Use temp_adj_en bit only when both
temperature based and core count based adjustments are desired.
CRs-Fixed: 1051076
Change-Id: Ia42dbdd095e51bf9b9b7e865c104dcbe8f4219da
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Use scaled gate count (GCNT) for aging measurements to reduce
the noise effect on aging data. The amount of scaling depends
on the noise effect observed in characterization results. Use
a selected scaling factor value to derive the gate count (GCNT)
used for aging measurements.
CRs-Fixed: 1025832
Change-Id: I0eb3fb08d51ddca5cd4c08e26bc83eb9f66fd3ed
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Fix the kw issues in jpeg set driver data and in jpegdma modules.
CRs-Fixed: 2017767
Change-Id: I601245553b8148c9f257d55c42367b0b8612db92
Signed-off-by: Krupal Divvela <kdivvela@codeaurora.org>
Check the validity of pointer before dereference and initialize
uninitialized variables.
Change-Id: Ifad4dd9668db91a18b493e0c7276bf6c193fb680
Signed-off-by: Venu Yeshala <vyeshala@codeaurora.org>
video frame event notification is changed so that events will be raised
for all frames both predicted and non predicted frames and invalidate
pts and dts values for predicted frames. This change is specific to
IoT targets in which only non predicted frames will be decoded
and rendered for performance improvement.
CR's-Fixed: 2005724
Change-Id: I08f648a89eb043938fcc7d3d81e83c3599a2f160
Signed-off-by: Udaya Bhaskara Reddy Mallavarapu <udaym@codeaurora.org>
pwm_free() is called in the driver incorrectly when trying to disable PWM
channel while changing the configuration. pwm_free() checks PWMF_REQUESTED
flag before calling disable() hook. The driver doesn't call pwm_request()
but only calls of_pwm_get() at the probe to get the flag once. The Flag
will be cleared when pwm_free() is called for the first time and calling it
afterwards will simply bailout not calling disable().
Replace pwm_free() with pwm_disable(), this won't cause any issue because
the PWM channel is considered statically allocated to the led devices from
hardware perspective and no need to free it in the driver.
While at it, free the PWM device if any errors when getting PWM
configuration.
CRs-Fixed: 2014600
Change-Id: I373d2a1ac83232ce94933c287b4ebe3f23519c83
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Fix the order of parameters passed into read/write APIs to make
it more readable. While at it, add a pr_fmt() to the driver to
get better log information. Also, change all dev_* APIs to pr_*
APIs for better logging.
Change-Id: Ib19f48ddbaeeb3af483ac472dabb44558a6b9e43
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently MISC_TRIM_ERROR_RC19P2_CLK register is hardcoded to
read the trim error in 19.2 MHz RC clock. However, this can be
located differently in some PMICs. Add support to read it from
misc device as this register cannot be directly accessed from
haptics driver.
Specify the MISC peripheral and the clock trim error register in
haptics for pmi8998 and pm660 so that haptics initial drive code
can be adjusted based on error code properly.
Change-Id: I04d8dbac0f943c65272531647c54d3c1495331e7
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
clock_debug_mux is required for the 'measure' functionality of the clock,
register using the clk_register_debug for the same.
Change-Id: I95b64ddd3ef3d869cf3b8ad2b4210ea78ba8f5fa
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Common Clock Framework(CCF) already has a clock ops hook `debug_init` which
could be used for the debugfs clock measure functionality. Remove the APIs
from the CCF and update the 'debug_init' clock ops to the clock types which
require the measure functionality.
Change-Id: I0c01f72a9d1d1caa1b1ab73a800401c2cbc3216c
Signed-off-by: Taniya Das <tdas@codeaurora.org>
The 'measure' functionality is a debug feature which allows the user of
clocks to allow measuring the frequency of a given clock using the ring
oscillator.
Move 'measure' code to a new clk-debug file to support the functionality.
Change-Id: I229721f17d232a4ff69b5cf416b43d22fee5b72e
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Update the diag header with latest log, message
and event information to match the list maintained
by the peripherals.
CRs-Fixed: 2020864
Change-Id: Icbed01bb4f90fb7d72fe7517ee6964d799f1d48e
Signed-off-by: Chris Lew <clew@codeaurora.org>
As per the hardware documentation, configure S2 reset type for
KPDPWR_RESIN PON configuration to DVDD_HARD_RESET. Since KPDPWR
S1/S2 timer and S2 reset type is configured by bootloader for
the internal devices, HLOS doesn't need to configure it again.
Hence remove it.
CRs-Fixed: 2017642
Change-Id: I000953dba1fd138c1dbcbb94e15f95ac78a07acd
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Change the initcall level of qpnp-misc driver from module_init()
to subsys_initcall() so that the misc devices can be available
earlier. This helps the clients to access the registers under
misc peripheral sooner without a probe deferral.
Change-Id: Ie5df2cb9cf6842c59ec6f00ac9123994111f207b
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
While in DRP the legacy cable detection may fail. When a legacy cable is
detected the legacy input current limits are enforced by hardware.
Always assume a legacy cable since the legacy cable detection will
fail in some cases. Manually enforce the legacy input current limits to
ensure USB stability and compliance. As a side effect, non-legacy 22k
ohm and 10k ohm Rp adapters will be current limited to legacy standards.
To realize this:
- Set a limit of 100mA as soon as type-c is connected and remove that
limit once PD is confirmed.
- If PD is not confirmed:
- SDP: Use 100mA vote until USB PHY updates it to 500/900mA
- CDP: Use 1.5A vote
- DCP: Use 1.5A vote
- HVDCP: Use 3A vote
Change-Id: I049a7ee2099acd9e58df1b9417847daec4854af5
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
While in DRP the legacy cable detection may fail. Legacy cable
detection is essential to preventing CC OV damage.
Always assume a legacy cable since the legacy cable detection will fail
in some cases. As a side effect, non-legacy HVDCP adapters will stay at
5V if they have a 10k ohm Rp.
To realize this:
- Remove disallowing PD based on the legacy bit being set. That bit set
or unset is not reliable and it is safe to try PD.
- Remove the workaround which tries to fix legacy cable being set
incorrectly at boot. That bit set or unset is not reliable.
Change-Id: I37879866592f63906a7c688f51c309b4e2fee48d
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Currently to override the ICL the self-clearing ICL override bit is
used. The problem with this bit is that it is self-clearing and a
separate register needs to be read to get the override status.
Furthermore, the hardware will automatically clear this bit on USB
removal.
A new ICL override bit was added in PMI hardware revision 2.0. This bit
is not self-clearing, and can be set prior to USB insertion. Use this
new bit.
Change-Id: I30a601b6aacba3c404ebdfb82e529504a694a048
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Currently AICL will be rerun whenever PD requests a voltage increase.
While this works in most cases it can become problematic if PD requests
the same voltage twice, and the ICL may fall to ICL_MIN.
Since the voltage requests originate in the userspace it would be less
error prone to allow the userspace to rerun AICL instead. Do it.
Change-Id: Id190564e28bcffd72a1de70fa1327fce3e40299e
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
When APSD_START_ON_CC_BIT is set both VBUS and CC must be attached
before APSD runs. This eliminates all issues related to slow plugin.
Unfortunately this means that if CC is re-asserted anytime after APSD
finishes, then it will rerun again.
Fix this by disabling APSD_START_ON_CC_BIT right after CC is asserted,
and enable it after USB removal.
Change-Id: I27d3727647635b78392b925f0881dc3a4ef41623
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
A client vote can be enabled or disabled. Add an API which allows
consumers to check the enable/disable status of a client vote.
Change-Id: Ic4e9224c19e63fb88216da0cb775994e3e87c1f7
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Update mdp caps to enable concurrent write back feature
along with the QoS settings required.
Change-Id: Ie8368fb327e908a549877b06da0fed5917fc3788
Signed-off-by: Sravanthi Kollukuduru <skolluku@codeaurora.org>
Some panels have low escape clock requirements based on which the
host escape clock should be configured. Add support to configure
host escape clock based on the panel escape clock. By default, the
host would be configured for an escape clock of 19.2MHz.
Change-Id: If791ffb4d49dd97424366042ee35bd4ecda5c185
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
Enable the laser sensor on the msm8998.
CRs-fixed: 1051771
Change-Id: Ie929092504ceb40bff283817e98b6cb0c4c05714
Signed-off-by: Wei Ding <weiding@codeaurora.org>
Laser sensor is connected using CCI interface.
Add support to configure and enable laser
sensor driver.
CRs-fixed: 1051771
Change-Id: Ia9eab96862b1c2a657d40272867f015a0a91e0ed
Signed-off-by: Bikas Gurung <bgurung@codeaurora.org>
Switching to micro-USB mode in PBS might cause charger FSM
to stuck, update the micro-usb mode switch sequence to reset
FSM and move charger FSM into micro-USB mode.
CRs-Fixed: 2017880
Change-Id: I6e4484e9a83494f81dad0d9cdbd815b62d67c9af
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
In the current implementation before triggering BTA,
DSI SW waits for extra time to skip display blanking period.
Add an additional check for active line count to ensure that
BTA is always triggered during display active region only.
Change-Id: Ife67f5a38fa9e8df6f8431e9d2b0179c207adeb2
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
ESD feature is enabled on the nt35597 truly panel on sdm660 to
check the panel status periodically.
Change-Id: Id354c900a784b1bf239595fd31a244c064066987
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
For some panels, escape clock needs to be updated for checking
the panel status periodically. Update the panel init sequence
to increase the escape clock.
Change-Id: I4a154d30e829c80587b3207ddc754aace927ab1c
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
DP sink specifies the maximum per-lane link rate and the maximum lane
count that it supports as part of its capabilities. This would limit
the maximum data transfer rate that can be supported on the link. Use
this information to filter the list of EDID modes to include only the
ones that can be supported with the maximum possible link rate.
CRs-Fixed: 2018514
Change-Id: I4bc3a339935a49081bd45cb778737116d99ee7c2
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Incorporate the 2016-10-31 updates to the internal regulatory
database for South Korea.
Change-Id: I310bb8609c2298832e976e38ebe6b816c6faa5d0
CRs-Fixed: 2020241
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
Increase the strength of camera mclk0 on msm8998 HDK.
Change-Id: I9804d26265f074e1696f9b324ac8973100bb0a0e
Signed-off-by: Wei Ding <weiding@codeaurora.org>
Do asynchronous driver probing of TZ log driver to improve
the device boot-up time.
Change-Id: Ic972be12f820787db1a5bc957b109461354875fb
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
The frequency value that is calculated in Hz can be of a large value to
cause unsigned integer overflow. DCVSh though fetches the final
frequency value in HZ in a unsigned long variable, the intermediate
variable used in the estimation is unsigned integer. This will result in
a wrong frequency value being reported to userspace and clients.
Fix the overflow by using a unsigned long datatype for the frequency
computation.
Change-Id: I4bba53b9f5bd243c4aaaf67a831ce77ef231b38f
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
On MSM there is NOC time-out in case the 11AD device wake-up
latency exceeds 6.7ms.
In order to guarantee fast wake-up in 11AD BL, set USAGE_8
bit 0, which prevents deep sleep in BL.
In addition, to shorten the wake-up time in operational FW,
mark the FW to set T_POWER_ON to 0, by setting BIT 1 of USAGE_8
register.
Change-Id: Ic1084f0ba1a226723818f7e4a7b1d81ce30bb31f
Signed-off-by: Maya Erez <merez@codeaurora.org>