From 93681feaba9425ea494bca55209ff1b4a8cfd44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Thu, 13 Oct 2022 18:33:35 +0200 Subject: [PATCH] drivers: can: sja1000: configure PHY from devicetree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The phys property was not considered during initialization of the driver config, so that the transceiver was not enabled properly in case it has an enable/standby pin. Signed-off-by: Martin Jäger --- drivers/can/can_sja1000.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/can/can_sja1000.h b/drivers/can/can_sja1000.h index 8aee06e1eb8..900c5a198d9 100644 --- a/drivers/can/can_sja1000.h +++ b/drivers/can/can_sja1000.h @@ -83,8 +83,9 @@ struct can_sja1000_config { .phase_seg1 = DT_PROP_OR(node_id, phase_seg1, 0), \ .phase_seg2 = DT_PROP_OR(node_id, phase_seg2, 0), \ .sample_point = DT_PROP_OR(node_id, sample_point, 0), \ - .max_bitrate = DT_CAN_TRANSCEIVER_MAX_BITRATE(node_id, 1000000), .ocr = _ocr, \ - .cdr = _cdr, .custom = _custom, \ + .max_bitrate = DT_CAN_TRANSCEIVER_MAX_BITRATE(node_id, 1000000), \ + .phy = DEVICE_DT_GET_OR_NULL(DT_PHANDLE(node_id, phys)), \ + .ocr = _ocr, .cdr = _cdr, .custom = _custom, \ } #define CAN_SJA1000_DT_CONFIG_INST_GET(inst, _custom, _read_reg, _write_reg, _ocr, _cdr) \