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

Commit b09f20aa authored by Fenglin Wu's avatar Fenglin Wu Committed by Fenglin Wu
Browse files

input: qcom-hv-haptics: use OL_TLRA if getting CL_TLRA failed



If getting close-loop TLRA failed in driver probe, such as if there
is no valid value in SDAM register for CAL_TLRA_CL_STS because of the
bootloader had not run the frequency calibration successfully. Use
open-loop TLRA to program the hardware so the vibrator can still be
functional but just lose some efficiency because of unadjusted
frequency.

Change-Id: I8b8dd0906aa6b3fa882e2044cdbe579c746714a3
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent e51738b0
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2721,15 +2721,15 @@ static int haptics_hw_init(struct haptics_chip *chip)
		return rc;

	/* get calibrated close loop period */
	rc = haptics_get_closeloop_lra_period(chip, true);
	if (rc < 0)
		return rc;

	/* Config T_LRA */
	t_lra_us = chip->config.t_lra_us;
	if (chip->config.cl_t_lra_us != 0)
	rc = haptics_get_closeloop_lra_period(chip, true);
	if (!rc && chip->config.cl_t_lra_us != 0)
		t_lra_us = chip->config.cl_t_lra_us;
	else
		dev_warn(chip->dev, "get closeloop LRA period failed, rc=%d\n",
				rc);

	/* Config T_LRA */
	rc = haptics_config_openloop_lra_period(chip, t_lra_us);
	if (rc < 0)
		return rc;