]> www.infradead.org Git - users/jedix/linux-maple.git/commit
can: kvaser_usb: leaf: Add hardware timestamp support to usbcan devices
authorJimmy Assarsson <extja@kvaser.com>
Mon, 1 Jul 2024 15:49:33 +0000 (17:49 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 5 Aug 2024 15:39:02 +0000 (17:39 +0200)
commit0aa639d3b3b9a90fd7ee198de58f368bf4add580
tree1a5c5be23955fe33cb293703cc3863e1c53531ef
parentc644c9698d8dcd1a09934976d1d0720925f7bd78
can: kvaser_usb: leaf: Add hardware timestamp support to usbcan devices

Add hardware timestamp support for all usbcan based devices (M16C).
The usbcan firmware is slightly different compared to the other Kvaser USB
interfaces:
  - The timestamp is provided by a 32-bit counter, with 10us resolution.
    Hence, the hardware timestamp will wrap after less than 12 hours.
  - Each Rx CAN or Tx ACK command only contains the 16-bits LSB of the
    timestamp counter.
  - The 16-bits MSB are sent in an asynchronous event (command), if any
    change occurred in the MSB since the last event.

Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/all/20240701154936.92633-13-extja@kvaser.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c