From 8ab81b02dd2c7cb8d43f2be36b85d82da0a12c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Tue, 14 Jun 2022 11:55:36 +0200 Subject: [PATCH] drivers: can: stm32: enable can1 clock also for can2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For devices with more than one CAN peripherals, CAN1 is the master and its clock has to be enabled also if only CAN2 is used. Signed-off-by: Martin Jäger --- drivers/can/can_stm32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/can/can_stm32.c b/drivers/can/can_stm32.c index 01539fca662..5e518a0bdb9 100644 --- a/drivers/can/can_stm32.c +++ b/drivers/can/can_stm32.c @@ -1248,7 +1248,9 @@ static const struct can_stm32_config can_stm32_cfg_2 = { .ts2 = DT_PROP_OR(DT_NODELABEL(can2), phase_seg2, 0), .one_shot = DT_PROP(DT_NODELABEL(can2), one_shot), .pclken = { - .enr = DT_CLOCKS_CELL(DT_NODELABEL(can2), bits), + /* can1 (master) clock must be enabled for can2 as well */ + .enr = DT_CLOCKS_CELL(DT_NODELABEL(can1), bits) | + DT_CLOCKS_CELL(DT_NODELABEL(can2), bits), .bus = DT_CLOCKS_CELL(DT_NODELABEL(can2), bus), }, .config_irq = config_can_2_irq,