Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33d114be authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "HID: qvr: wait event interruptible timeout change"

parents fb30e893 3c3495b5
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@
#include "hid-qvr.h"
#include "hid-trace.h"

#define WAIT_EVENT_INT_TOUT 20
#define TIME_OUT_START_STOP_MS 500
#define TIME_OUT_READ_WRITE_MS 20

#define QVR_START_IMU		_IO('q', 1)
#define QVR_STOP_IMU		_IO('q', 2)
@@ -134,7 +135,7 @@ static int read_calibration_len(void)

	ret = wait_event_interruptible_timeout(wq,
		sensor->calib_data_len != -1,
		msecs_to_jiffies(WAIT_EVENT_INT_TOUT));
		msecs_to_jiffies(TIME_OUT_READ_WRITE_MS));
	if (ret == 0) {
		kfree(hid_buf);
		return -ETIME;
@@ -179,7 +180,7 @@ static uint8_t *read_calibration_data(void)
			HID_REQ_SET_REPORT);
		ret = wait_event_interruptible_timeout(wq,
			sensor->calib_data_recv == 1,
			msecs_to_jiffies(WAIT_EVENT_INT_TOUT));
			msecs_to_jiffies(TIME_OUT_READ_WRITE_MS));
		if (ret == 0) {
			pr_err("%s:get calibration data timeout\n", __func__);
			kfree(hid_buf);
@@ -227,7 +228,7 @@ static int control_imu_stream(bool status)
		HID_FEATURE_REPORT,
		HID_REQ_SET_REPORT);
	ret = wait_event_interruptible_timeout(wq, sensor->ext_ack == 1,
		msecs_to_jiffies(WAIT_EVENT_INT_TOUT));
		msecs_to_jiffies(TIME_OUT_START_STOP_MS));
	if (!ret && status) {
		pr_debug("qvr: falling back - start IMU stream failed\n");
		hid_buf[0] = QVR_HID_REPORT_ID_CAL;