mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
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: Fenglin Wu <fenglinw@codeaurora.org>
This commit is contained in:
parent
e3ff6ae4a0
commit
327de86822
1 changed files with 7 additions and 0 deletions
|
|
@ -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++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue