Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 785be08a authored by Abinaya P's avatar Abinaya P Committed by Matt Wagantall
Browse files

msm: qpnp-haptic: correct variation in resonant frequency in LRA



PMI8994 and PMI8950 support two type of actuators : Linear Resonant
Actuator(LRA) and Eccentric Rotating Mass(ERM). The LRA actuator is
driven by PMIC Internal RC Clock of 19.2 MHz and its drive code is
based on the formula:
LRA drive period code = (19.2 x 10^6) / (96 * LRA drive frequency)
Where, LRA drive frequency is obtained from the actual actuator
datasheet. Under normal operating conditions, this LRA drive frequency
is not constant and may vary due to a number of reasons like aging,
temperature or device orientation. PMI8994 and PMI8950 haptics
software driver uses auto-resonance detection to correct any drifts
in the frequency and ensures optimum driving strength across varying
operating conditions. Add an optional DT property to enable support
for that.

Also PMI8994 and PMI8950 use internal RC clock of 19.2 MHz which may
have a variation as high as +/-16%. This could be due to manufacturing
process limitations. This frequency variation of RC clock is stored
inside TRIM_ERROR_RC19P2_CLK in the MISC module. The haptics driver
scales the LRA drive period code based on the value found read from
this register. However, currently this register is present only on
PMI8950. Add an optional DT property which indicates the presence
of this register in MISC module or not.

Change-Id: I42365aa54d236797191dfb2a481580f508b60a14
Signed-off-by: default avatarAbinaya P <abinayap@codeaurora.org>
Signed-off-by: default avatarHimanshu Aggarwal <haggarwa@codeaurora.org>
parent a15f7c7c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment