On 03/06/2018 03:20 PM, Bartosz Gołaszewski wrote:
This depends on your controller doesn't it? The driver will perform
its write operation (e.g. register write) and the controller may or
may not generate a signal.
But it's a simple wired loopback. The only way for the input pin to
generate an interrupt would be if the value on that pin changed.
I think the only thing that makes sense is that it's a pending interrupt
from a previous test.
Yes, it's very possible. How do I flush that queue?
Read events in a loop as long as poll() doesn't return timeout.
Isn't that something that gpiod_line_request_both_edges_events() should
do for me?
Anyway, I tried this:
/* Flush all pending events */
timeout.tv_sec = 1;
do {
printf("Flushing ...\n");
ret = gpiod_line_event_wait(input, &timeout);
if (ret < 0) {
printf("Error: could not flush pending events (errno=%i)\n", errno);
return ret;
}
} while (ret == 1);
but it loops forever. gpiod_line_event_wait() always returns with 1.
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html