mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "input: qcom-hv-haptics: set Vmax before toggling HAPTICS_EN in FIFO play"
This commit is contained in:
commit
4caf20dcb0
1 changed files with 20 additions and 15 deletions
|
|
@ -891,7 +891,12 @@ static int haptics_get_status_data(struct haptics_chip *chip,
|
|||
mod_sel_val[0] = sel & 0xff;
|
||||
mod_sel_val[1] = (sel >> 8) & 0xff;
|
||||
rc = haptics_write(chip, chip->cfg_addr_base,
|
||||
HAP_CFG_MOD_STATUS_SEL_REG, mod_sel_val, 2);
|
||||
HAP_CFG_MOD_STATUS_XT_V2_REG, &mod_sel_val[1], 1);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = haptics_write(chip, chip->cfg_addr_base,
|
||||
HAP_CFG_MOD_STATUS_SEL_REG, mod_sel_val, 1);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
|
|
@ -2072,22 +2077,11 @@ static int haptics_load_predefined_effect(struct haptics_chip *chip,
|
|||
return -EINVAL;
|
||||
|
||||
play->effect = effect;
|
||||
if (play->pattern_src == FIFO) {
|
||||
/* Toggle HAPTICS_EN for a clear start point of FIFO playing */
|
||||
rc = haptics_toggle_module_enable(chip);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Clamp VMAX for different vibration strength */
|
||||
rc = haptics_set_vmax_mv(chip, play->vmax_mv);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = haptics_enable_autores(chip, !play->effect->auto_res_disable);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
play->pattern_src = play->effect->src;
|
||||
if (play->pattern_src != PATTERN1 &&
|
||||
play->pattern_src != PATTERN2 &&
|
||||
|
|
@ -2097,6 +2091,17 @@ static int haptics_load_predefined_effect(struct haptics_chip *chip,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (play->pattern_src == FIFO) {
|
||||
/* Toggle HAPTICS_EN for a clear start point of FIFO playing */
|
||||
rc = haptics_toggle_module_enable(chip);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = haptics_enable_autores(chip, !play->effect->auto_res_disable);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
play->brake = play->effect->brake;
|
||||
/* Config brake settings if it's necessary */
|
||||
if (play->brake) {
|
||||
|
|
@ -2260,12 +2265,12 @@ static int haptics_load_custom_effect(struct haptics_chip *chip,
|
|||
play->effect = chip->custom_effect;
|
||||
play->brake = NULL;
|
||||
play->vmax_mv = (magnitude * chip->custom_effect->vmax_mv) / 0x7fff;
|
||||
/* Toggle HAPTICS_EN for a clear start point of FIFO playing */
|
||||
rc = haptics_toggle_module_enable(chip);
|
||||
rc = haptics_set_vmax_mv(chip, play->vmax_mv);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
rc = haptics_set_vmax_mv(chip, play->vmax_mv);
|
||||
/* Toggle HAPTICS_EN for a clear start point of FIFO playing */
|
||||
rc = haptics_toggle_module_enable(chip);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue