Hello William, On 06.11.20 13:42, William Breathitt Gray wrote: > On Thu, Nov 05, 2020 at 07:46:14PM +0100, Ahmad Fatoum wrote: >> It doesn't look like the counter device API is yet made to support such >> an input capture mode (latching a counter value on an external event, e.g. >> to timestamp incoming rising edges to measure jitter between pulses). > > Regarding the Counter subsystem, I'm developing a Counter character > device API that supports timestamps for counter devices: > https://lore.kernel.org/linux-arm-kernel/157d1edf-feec-33b5-7ad5-94f99316ca6e@xxxxxxxxxxxxxx/T/ Any chance we could have a "raw" timestamp as well like the network stack offers (cf. SOF_TIMESTAMPING_{RAW,SYS}_HARDWARE)? The API currently only exposes a ktime (i.e. CLOCK_MONOTONIC), which the raw timer count can't be readily converted to. For our use case of measuring jitter, the raw value is sufficient. > My aim is to get this functionality picked up for the Linux 5.11 merge > window. I have one more revision at least that should be ready in a > couple weeks -- I'll CC you for that patchset to keep you in the loop; > I force-push periodically to my personal repo when as I develop, so you > can take a look at the current state of this next revision if you're > curious: > https://gitlab.com/vilhelmgray/iio/-/tree/counter_chrdev_v6 Great. Looking forward to see this merged. Thanks, Ahmad > > Sincerely, > > William Breathitt Gray > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |