3 Commits
0.0.1 ... 0.0.4

Author SHA1 Message Date
Oleg
0864cb67ef More debugging 2024-05-26 03:29:37 +03:00
Oleg
e365eba0dd Added debug Makefile option 2024-05-26 02:25:11 +03:00
Oleg
440a42d3fe Clamp PID_LOOP_COUNT 2024-05-26 02:10:18 +03:00
2 changed files with 12 additions and 1 deletions

View File

@@ -4,6 +4,10 @@ KDIR := /lib/modules/${KVERSION}/build
default:
$(MAKE) -C $(KDIR) M=$$PWD
debug:
$(MAKE) -C $(KDIR) M=$$PWD EXTRA_CFLAGS="-g -DDEBUG"
install: default
$(MAKE) -C $(KDIR) M=$$PWD modules_install
depmod -A

View File

@@ -499,6 +499,9 @@ static void pidff_playback_pid(struct pidff_device *pidff, int pid_id, int n)
} else {
pidff->effect_operation_status->value[0] =
pidff->operation_id[PID_EFFECT_START];
n = clamp(n, pidff->effect_operation[PID_LOOP_COUNT].field->logical_minimum,
pidff->effect_operation[PID_LOOP_COUNT].field->logical_maximum);
pidff->effect_operation[PID_LOOP_COUNT].value[0] = n;
}
@@ -562,7 +565,7 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect,
pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] =
pidff->pid_id[effect->id];
}
hid_dbg(pidff->hid, "Upload effect 0x%02x,", effect->type);
switch (effect->type) {
case FF_CONSTANT:
if (!old) {
@@ -1151,7 +1154,9 @@ static void pidff_reset(struct pidff_device *pidff)
struct hid_device *hid = pidff->hid;
int i = 0;
hid_dbg(hid, "%s: Resetting the device...", __func__);
pidff->device_control->value[0] = pidff->control_id[PID_RESET];
hid_dbg(hid, "%s: PID_RESET control_id: %02x", __func__, pidff->device_control->value[0]);
/* We reset twice as sometimes hid_wait_io isn't waiting long enough */
hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT);
hid_hw_wait(hid);
@@ -1160,6 +1165,7 @@ static void pidff_reset(struct pidff_device *pidff)
pidff->device_control->value[0] =
pidff->control_id[PID_ENABLE_ACTUATORS];
hid_dbg(hid, "%s: PID_ENABLE_ACTUATORS control_id: %02x", __func__, pidff->device_control->value[0]);
hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT);
hid_hw_wait(hid);
@@ -1181,6 +1187,7 @@ static void pidff_reset(struct pidff_device *pidff)
hid_hw_wait(hid);
}
}
hid_dbg(hid, "%s: Resetting device complete", __func__);
}
/*