input: qcom-hv-haptics: add LRA impedance detection support
Add support for detecting LRA impedance. The detection is done using
following procedure: set ISC to 250 mA and Vmax to 10 V, then sweep
the duty cycle using binary approach based on the SC_FAULT status until
reaching to the last step. The impedance can be only detected between
a range and the resolution depends on the sweeping steps. Currently,
total number of steps used for calculating LRA impedance using
approximation is 5 which can achieve an accuracy of 1.25 Ohms.
This detection is only available for PM8350B 2.0 chip and it can be
triggered using command:
echo 1 > /sys/class/qcom-haptics/lra_calibration
After that, the result can be read out using command:
cat /sys/class/qcom-haptics/lra_impedance
Change-Id: I7edc00ecdb019ccf7ca5af459dec8105834706f5
Signed-off-by:
Fenglin Wu <fenglinw@codeaurora.org>
Loading
Please register or sign in to comment