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

Commit 8af9552f authored by Mohan Pallaka's avatar Mohan Pallaka
Browse files

msm: qpnp-haptic: update play sequence for QWD mode



Haptic auto resonance mode QWD (Quarter Wave Drive) requires
auto resonance to be disabled before getting played. And it has
be enabled back after waiting for 20ms to provide correct
resonance to the motor.

Change-Id: Iacd1ab311500cc4d87ff76de2d74dda45c18997d
Signed-off-by: default avatarMohan Pallaka <mpallaka@codeaurora.org>
parent d9642cc2
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -61,9 +61,14 @@ Optional properties when qcom,actuator-type is "lra"
			"qwd" : quarter wave drive method
			"max-qwd" : Maximum QWD
			"zxd-eop" : ZXD + End of pattern (This is the Default)
 - qcom,lra-high-z : High Z configuration for auto resonance. Possible string values are
			"none", "opt1", "opt2" and "opt3" (default)
 - qcom,lra-res-cal-period : Auto resonance calibration period. The values range from
			4 to 32(default)

Example:
		qcom,haptic@c000 {
			status = "disabled";
			compatible = "qcom,qpnp-haptic";
			reg = <0xc000 0x100>;
			interrupts = <0x3 0xc0 0x0>,
@@ -84,5 +89,7 @@ Example:
			qcom,wave-samples = [3e 3e 3e 3e 3e 3e 3e 3e];
			qcom,wave-rep-cnt = <1>;
			qcom,wave-samp-rep-cnt = <1>;
			qcom,lra-auto-res-mode = "zxd";
			qcom,lra-high-z = "opt1";
			qcom,lra-auto-res-mode = "qwd";
			qcom,lra-res-cal-period = <4>;
		};
+8 −5
Original line number Diff line number Diff line
@@ -1487,23 +1487,26 @@ static int qpnp_hap_set(struct qpnp_hap *hap, int on)
	} else if (hap->play_mode == QPNP_HAP_BUFFER ||
			hap->play_mode == QPNP_HAP_DIRECT) {
		if (on) {
			if (hap->correct_lra_drive_freq ||
				hap->auto_res_mode == QPNP_HAP_AUTO_RES_QWD)
				qpnp_hap_auto_res_enable(hap, 0);

			rc = qpnp_hap_mod_enable(hap, on);
			if (rc < 0)
				return rc;

			if (hap->correct_lra_drive_freq)
				qpnp_hap_auto_res_enable(hap, 0);

			rc = qpnp_hap_play(hap, on);

			if (hap->correct_lra_drive_freq) {
			if (hap->correct_lra_drive_freq ||
				hap->auto_res_mode == QPNP_HAP_AUTO_RES_QWD) {
				usleep_range(AUTO_RES_ENABLE_TIMEOUT,
					(AUTO_RES_ENABLE_TIMEOUT + 1));

				rc = qpnp_hap_auto_res_enable(hap, 1);
				if (rc < 0)
					return rc;

			}
			if (hap->correct_lra_drive_freq) {
				/*
				 * Start timer to poll Auto Resonance error bit
				 */