Hi, Linus Walleij <linus.walleij@xxxxxxxxxx> writes: > On Tue, Dec 5, 2017 at 10:20 AM, Felipe Balbi > <felipe.balbi@xxxxxxxxxxxxxxx> wrote: >> [Me]: > >>> I was thinking about it already when implementing it but it fell >>> out of my mind. I'm putting in on my TODO. (CC to bartosz >>> who might be interested, he's using these ABIs quite a bit.) >> >> fair enough. In that case, it'll probably be easier to implement >> HW-based timestamping with something like below: > > Indeed. > > IIO has a per-device sysfs file for setting up > the POSIX timestamping named current_timestamp_clock. > This was added by Gregor Boire in commit > bc2b7dab629a > > The supported timestamps are: > realtime > monotonic > monotonic_raw > realtime_coarse > monotonic_coarse > boottime > tai > > I could really need some help here... :/ > > It feels like "monotonic" could very well be what you're > looking for but I don't know the POSIX definition of these. > Maybe we need to add one more for "device specific"? > > What I want to do is factor most of that commit out into > lib/ and reuse for timestamping in GPIO so we can > have coherent timestamps across GPIO and IIO. > > OK OK O need to get to it and stop talking... > > I guess it should be set per-gpiochip rather than > per-gpio-desc though, but that makes most sense anyways. Well, it may be that not every pin on a gpiochip supports HW-backed timestamping. Just speculating here, that's why I made it per-gpio_desc on the example. -- balbi
Attachment:
signature.asc
Description: PGP signature