aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Kleine-Budde <[email protected]>2022-05-23 17:18:33 +0200
committerMarc Kleine-Budde <[email protected]>2022-07-04 11:42:59 +0200
commit5b12933de4e76ec164031c18ce8e0904abf530d7 (patch)
treed905337c4d496aadfca86557e8f48ddd868ec1b7
parent562fed945ea482833667f85496eeda766d511386 (diff)
can: m_can: m_can_chip_config(): actually enable internal timestamping
In commit df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") the timestamping in the m_can core should be enabled. In peripheral mode, the RX'ed CAN frames, TX compete frames and error events are sorted by the timestamp. The above mentioned commit however forgot to enable the timestamping. Add the missing bits to enable the timestamp counter to the write of the Timestamp Counter Configuration register. Link: https://lore.kernel.org/all/[email protected] Fixes: df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") Cc: <[email protected]> # 5.13 Cc: Torin Cooper-Bennun <[email protected]> Reviewed-by: Chandrasekar Ramakrishnan <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
-rw-r--r--drivers/net/can/m_can/m_can.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 5d0c82d8b9a9..03a22d493cf6 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1351,7 +1351,9 @@ static void m_can_chip_config(struct net_device *dev)
/* enable internal timestamp generation, with a prescalar of 16. The
* prescalar is applied to the nominal bit timing
*/
- m_can_write(cdev, M_CAN_TSCC, FIELD_PREP(TSCC_TCP_MASK, 0xf));
+ m_can_write(cdev, M_CAN_TSCC,
+ FIELD_PREP(TSCC_TCP_MASK, 0xf) |
+ FIELD_PREP(TSCC_TSS_MASK, TSCC_TSS_INTERNAL));
m_can_config_endisable(cdev, false);