pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan1_1>;
trx-en-gpio = <&max7310_b 5 GPIO_ACTIVE_HIGH>;
- trx-stby-gpio = <&max7310_b 3 GPIO_ACTIVE_HIGH>;
+ trx-stby-gpio = <&max7310_b 4 GPIO_ACTIVE_HIGH>;
+ trx-wakeup-gpio = <&max7310_b 7 GPIO_ACTIVE_HIGH>;
status = "okay";
};
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan2_1>;
trx-en-gpio = <&max7310_b 5 GPIO_ACTIVE_HIGH>;
- trx-stby-gpio = <&max7310_b 3 GPIO_ACTIVE_HIGH>;
+ trx-stby-gpio = <&max7310_b 4 GPIO_ACTIVE_HIGH>;
+ trx-wakeup-gpio = <&max7310_b 7 GPIO_ACTIVE_HIGH>;
status = "okay";
};
struct device_node *np;
enum of_gpio_flags en_flags, stby_flags;
bool canfd_en = false;
+ int wakeup_gpio;
np = of_find_node_by_path("/soc/aips-bus@02000000/can@02090000");
if (!np)
return -ENODEV;
+
+ /* Wakeup transceiver first in case it's in sleep mode by default */
+ wakeup_gpio = of_get_named_gpio(np, "trx-wakeup-gpio", 0);
+ if (gpio_is_valid(wakeup_gpio) &&
+ !gpio_request_one(wakeup_gpio, GPIOF_OUT_INIT_HIGH, "flexcan-trx-wakeup")) {
+ gpio_set_value_cansleep(wakeup_gpio, 0);
+ gpio_set_value_cansleep(wakeup_gpio, 1);
+ }
+
flexcan_en_gpio = of_get_named_gpio_flags(np, "trx-en-gpio", 0, &en_flags);
flexcan_stby_gpio = of_get_named_gpio_flags(np, "trx-stby-gpio", 0, &stby_flags);
+
if (gpio_is_valid(flexcan_en_gpio) && gpio_is_valid(flexcan_stby_gpio) &&
!gpio_request_one(flexcan_en_gpio, GPIOF_DIR_OUT, "flexcan-trx-en") &&
!gpio_request_one(flexcan_stby_gpio, GPIOF_DIR_OUT, "flexcan-trx-stby")) {
platform_device_register(&imx6sx_cpufreq_pdev);
}
- if (of_machine_is_compatible("fsl,imx6sx-sdb"))
+ if (of_machine_is_compatible("fsl,imx6sx-sdb") ||
+ of_machine_is_compatible("fsl,imx6sx-sabreauto"))
imx6sx_arm2_flexcan_fixup();
imx6sx_cpuidle_init();