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

Commit 4c7a270e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: qpnp-haptic: wait for 5 cycles before BUSY check"

parents eecaae5c 5921180c
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@
#define QPNP_HAP_TIMEOUT_MS_MAX		15000
#define QPNP_HAP_STR_SIZE		20
#define QPNP_HAP_MAX_RETRIES		5
#define QPNP_HAP_CYCLS			5

/* haptic debug register set */
static u8 qpnp_hap_dbg_regs[] = {
@@ -281,10 +282,12 @@ static int qpnp_hap_mod_enable(struct qpnp_hap *hap, int on)

			dev_dbg(&hap->spmi->dev, "HAP_STATUS=0x%x\n", val);

			/* wait for 4 cycles of play rate */
			if (val & QPNP_HAP_STATUS_BUSY)
				usleep(4 * hap->wave_play_rate_us);
			else
			/* wait for QPNP_HAP_CYCLS cycles of play rate */
			if (val & QPNP_HAP_STATUS_BUSY) {
				usleep(QPNP_HAP_CYCLS * hap->wave_play_rate_us);
				if (hap->play_mode == QPNP_HAP_DIRECT)
					break;
			} else
				break;
		}