From c7730dddaccb75b7cb129278c19561e2c395f7f1 Mon Sep 17 00:00:00 2001 From: Dong Aisheng Date: Thu, 19 Jun 2014 19:15:34 +0800 Subject: [PATCH] ENGR00319455-2 imx6sx: enable can transceiver by default for canfd Switch on the transceiver by default for board with canfd enabled since canfd driver does not handle it. Two CAN instances share the same switch. Signed-off-by: Dong Aisheng (cherry picked from commit 608315ee05eb013e858309d28200167498d7a27d) --- arch/arm/mach-imx/mach-imx6sx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c index d40e2e4293b6..ccbf323b5ce9 100644 --- a/arch/arm/mach-imx/mach-imx6sx.c +++ b/arch/arm/mach-imx/mach-imx6sx.c @@ -55,6 +55,7 @@ static void imx6sx_arm2_flexcan1_switch(int enable) static int __init imx6sx_arm2_flexcan_fixup(void) { struct device_node *np; + bool canfd_en = false; np = of_find_node_by_path("/soc/aips-bus@02000000/can@02090000"); if (!np) @@ -70,6 +71,21 @@ static int __init imx6sx_arm2_flexcan_fixup(void) flexcan_pdata[1].transceiver_switch = imx6sx_arm2_flexcan1_switch; } + /* + * Switch on the transceiver by default for board with canfd enabled + * since canfd driver does not handle it. + * Two CAN instances share the same switch. + */ + for_each_node_by_name(np, "canfd") { + if (of_device_is_available(np)) { + canfd_en = true; + break; + } + } + + if (of_machine_is_compatible("fsl,imx6sx-sdb") && canfd_en) + imx6sx_arm2_flexcan0_switch(1); + return 0; } -- 2.39.5