Backport of upstream patch series [1]. When fixing the CAN clock frequency, fb12797ab1fe ("can: kvaser_usb: get CAN clock frequency from device"), I introduced a regression. For Leaf devices based on M32C, the firmware expects bittiming parameters calculated for 16MHz clock. Regardless of the actual clock frequency. This regression affects M32C based Leaf devices with non-16MHz clock. Also correct the bittiming constants in kvaser_usb_leaf.c, where the limits are different depending on which firmware/device being used. [1] https://lore.kernel.org/linux-can/20220603083820.800246-1-extja@xxxxxxxxxx/ Jimmy Assarsson (3): can: kvaser_usb: replace run-time checks with struct kvaser_usb_driver_info can: kvaser_usb: kvaser_usb_leaf: fix CAN clock frequency regression can: kvaser_usb: kvaser_usb_leaf: fix bittiming limits drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 25 +- .../net/can/usb/kvaser_usb/kvaser_usb_core.c | 286 ++++++++++-------- .../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 4 +- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 119 ++++---- 4 files changed, 244 insertions(+), 190 deletions(-) -- 2.36.1