]> git.baikalelectronics.ru Git - kernel.git/commit
can: kvaser_usb: get CAN clock frequency from device
authorJimmy Assarsson <extja@kvaser.com>
Wed, 8 Dec 2021 15:21:22 +0000 (16:21 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 9 Dec 2021 08:01:43 +0000 (09:01 +0100)
commitfb12797ab1fef480ad8a32a30984844444eeb00d
tree74c472ed5bb1dbe7ee4b7f311e3279268c0999a1
parent36aea60fc892ce73f96d45dc7eb239c7c4c1fa69
can: kvaser_usb: get CAN clock frequency from device

The CAN clock frequency is used when calculating the CAN bittiming
parameters. When wrong clock frequency is used, the device may end up
with wrong bittiming parameters, depending on user requested bittiming
parameters.

To avoid this, get the CAN clock frequency from the device. Various
existing Kvaser Leaf products use different CAN clocks.

Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices")
Link: https://lore.kernel.org/all/20211208152122.250852-2-extja@kvaser.com
Cc: stable@vger.kernel.org
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c