msm: qpnp-haptic: add additional checks to avoid division by zero.
While calculating the +/-30% variation from the resonant frequency for auto resonance search algorithm, division by zero is happening causing device crash. Add additional checks to avoid such crashes. Also, RATE_CFG1 and RATE_CFG2 registers should be updated with values from AUTO_RES_LO and AUTO_RES_HI registers respectively only if the frequency variation is +/-25% of the resonant freqeuncy. Add code change for the same. CRs-Fixed: 1024697 Change-Id: I2a68cb61331ce4e68857031a4c0c14fded77a0e5 Signed-off-by:Abinaya P <abinayap@codeaurora.org> Signed-off-by:
Himanshu Aggarwal <haggarwa@codeaurora.org>
Loading
Please register or sign in to comment