mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
input: qcom-hv-haptics: set Vmax before toggling HAPTICS_EN in FIFO play
Currently, HAPTICS_EN bit is toggled whenever a FIFO pattern is played followed by setting Vmax. However, this would issue a SWR_VMAX handshake and then follow a SPMI_VMAX handshake in HW if haptics effect is played over SWR bus in the background. This back to back Vmax handshake would potentially cause the HW not responding and no vibration being played. To address this, set the Vmax before toggling HAPTICS_EN bit to avoid back to back Vmax handshakes when SWR and FIFO are played concurrently. Change-Id: I0b8924ab7f369db446458fe2510a0da01519a978 Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
This commit is contained in:
parent
e9a98dc14c
commit
156f44c6bd
|
|
@ -1943,22 +1943,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 == DIRECT_PLAY ||
|
||||
play->pattern_src == SWR) {
|
||||
|
|
@ -1967,6 +1956,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) {
|
||||
|
|
@ -2149,12 +2149,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 New Issue
Block a user