dlkm: aw8624: fixed abnormal vibrator issue

In some scenario, vibrator may can not stop immediately
because stop command was returned. use 5ms delay
to replace it and make sure short vibrator can work well.

Change-Id: I82720f0d031c7306e1b5f806aa5a380ccccb8eec
Signed-off-by: Weilong Wu <wuwl10@motorola.com>
Reviewed-on: https://gerrit.mot.com/1436810
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Weilong Wu 2019-10-15 15:08:36 +08:00
commit 499088dfa7

View file

@ -1550,6 +1550,7 @@ static ssize_t aw8624_duration_store(struct device *dev,
if (rc < 0)
return rc;
pr_debug("%s: value=%d\n", __FUNCTION__, val);
/* setting 0 on duration is NOP for now */
if (val <= 0)
return count;
@ -1590,7 +1591,8 @@ static ssize_t aw8624_activate_store(struct device *dev,
pr_debug("%s: value=%d\n", __FUNCTION__, val);
if (val == 0)
return count;
msleep(5);
mutex_lock(&aw8624->lock);
hrtimer_cancel(&aw8624->timer);
aw8624->state = val;