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

Commit 327de868 authored by Fenglin Wu's avatar Fenglin Wu
Browse files

input: qcom-hv-haptics: update drive waveform data format



Use 2's complement data format for driving pattern waveform because
the pattern/FIFO samples used in the driver are all having unsigned
data type.

Change-Id: Ib0f7c1c7fe272068177237821debbd3cc1ad4ec8
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent e3ff6ae4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@
#define DEFAULT_VMAX_MV				5000

#define HAP_CFG_DRV_WF_SEL_REG			0x49
#define DRV_WF_FMT_BIT				BIT(4)
#define DRV_WF_SEL_MASK				GENMASK(1, 0)

#define HAP_CFG_AUTO_SHUTDOWN_CFG_REG		0x4A
@@ -1881,6 +1882,12 @@ static int haptics_hw_init(struct haptics_chip *chip)
	if (rc < 0)
		return rc;

	/* Config to use 2's complement values for sample data */
	rc = haptics_masked_write(chip, chip->cfg_addr_base,
			HAP_CFG_DRV_WF_SEL_REG, DRV_WF_FMT_BIT, 0);
	if (rc < 0)
		return rc;

	/* preload effect */
	if (config->preload_effect != -EINVAL) {
		for (i = 0; i < chip->effects_count; i++)