]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00319455-2 imx6sx: enable can transceiver by default for canfd
authorDong Aisheng <b29396@freescale.com>
Thu, 19 Jun 2014 11:15:34 +0000 (19:15 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:17:30 +0000 (21:17 -0600)
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 <b29396@freescale.com>
(cherry picked from commit 608315ee05eb013e858309d28200167498d7a27d)

arch/arm/mach-imx/mach-imx6sx.c

index d40e2e4293b6e3dbd3d6c499c60ed90bfc68178a..ccbf323b5ce95eba59f9ed04dde244a827d2405b 100644 (file)
@@ -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;
 }