fixup! (CR) drv8424_mmi: motor slippage recovery

Fixing missed condition for running in no sensors mode

Mot-CRs-fixed: (CR)

Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Change-Id: I2b7bb40a38c432f301d4b1a3a3742bb0d26cfafb
Reviewed-on: https://gerrit.mot.com/2371667
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Konstantin Makariev 2022-08-25 14:51:28 -05:00 • committed by Konstantin Makariev
commit 6b1eef402a

View file

@ -1154,6 +1154,11 @@ static enum hrtimer_restart motor_timeout_timer_action(struct hrtimer *h)
int destination = atomic_read(&md->destination);
enum hrtimer_restart ret = HRTIMER_NORESTART;
if (md->sensors_off) {
dev_warn(md->dev, "time out in no sensors mode!\n");
goto exit;
}
if (POSITION_RANGE_CHK(original) &&
POSITION_RANGE_CHK(destination)) {
LOGD("Timeout: position=%s, detection=%s\n",
@ -1180,7 +1185,7 @@ static enum hrtimer_restart motor_timeout_timer_action(struct hrtimer *h)
LOGD("Timeout position detection\n");
}
moto_drv8424_cmd_push(md, CMD_TIMEOUT, INT_50MS);
exit:
return ret;
}
@ -2088,8 +2093,10 @@ static ssize_t motor_sensor_data_store(struct device *dev, struct device_attribu
*/
if (md->sensor_data[0] == UNINITIALIZED) {
inited = true;
md->time_out = MOTOR_DETECT_EXPIRE;
moto_drv8424_cmd_push(md, CMD_TIMER_START, 0);
if (!md->sensors_off) {
md->time_out = MOTOR_DETECT_EXPIRE;
moto_drv8424_cmd_push(md, CMD_TIMER_START, 0);
}
}
}
/* store necessary sensor info */