diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2014-03-12 11:13:09 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2014-03-12 11:13:09 +0100 |
commit | 7e13a0bde7b236661129af988be7e017d8acb755 (patch) | |
tree | a50f488ca57e135853517adf5816dfefb4bb2212 | |
parent | 21282797d4edf4cc56b3d93e7575a99e1bb0514d (diff) |
board-apalis_imx6: add CAN
-rw-r--r-- | arch/arm/mach-mx6/board-apalis_imx6.c | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/arch/arm/mach-mx6/board-apalis_imx6.c b/arch/arm/mach-mx6/board-apalis_imx6.c index 96f00e594628..5a93d55c15ff 100644 --- a/arch/arm/mach-mx6/board-apalis_imx6.c +++ b/arch/arm/mach-mx6/board-apalis_imx6.c @@ -810,34 +810,25 @@ static struct ahci_platform_data sata_data = { .exit = exit_sata, }; -#ifdef TODO static struct gpio flexcan_gpios[] = { - { GP_CAN1_ERR, GPIOF_DIR_IN, "flexcan1-err" }, - { GP_CAN1_EN, GPIOF_OUT_INIT_LOW, "flexcan1-en" }, - { GP_CAN1_STBY, GPIOF_OUT_INIT_LOW, "flexcan1-stby" }, }; +#if 0 /* example which controls a CAN tranceiver */ static void flexcan0_mc33902_switch(int enable) { gpio_set_value(GP_CAN1_EN, enable); gpio_set_value(GP_CAN1_STBY, enable); } +#endif -static void flexcan0_tja1040_switch(int enable) -{ - gpio_set_value(GP_CAN1_STBY, enable ^ 1); -} - -static const struct flexcan_platform_data - flexcan0_mc33902_pdata __initconst = { - .transceiver_switch = flexcan0_mc33902_switch, +/* on the eval board the tranceivers are always on */ +static const struct flexcan_platform_data flexcan0_pdata __initconst = { + .transceiver_switch = NULL, }; -static const struct flexcan_platform_data - flexcan0_tja1040_pdata __initconst = { - .transceiver_switch = flexcan0_tja1040_switch, +static const struct flexcan_platform_data flexcan1_pdata __initconst = { + .transceiver_switch = NULL, }; -#endif static struct viv_gpu_platform_data imx6_gpu_pdata __initdata = { .reserved_mem_size = SZ_128M, @@ -1525,27 +1516,16 @@ static void __init board_init(void) imx6q_add_hdmi_soc(); imx6q_add_hdmi_soc_dai(); -#ifdef TODO - ret = gpio_request_array(flexcan_gpios, - ARRAY_SIZE(flexcan_gpios)); + ret = gpio_request_array(flexcan_gpios, ARRAY_SIZE(flexcan_gpios)); if (ret) { pr_err("failed to request flexcan1-gpios: %d\n", ret); } else { - int ret = gpio_get_value(GP_CAN1_ERR); - if (ret == 0) { - imx6q_add_flexcan0(&flexcan0_tja1040_pdata); - pr_info("Flexcan NXP tja1040\n"); - } else if (ret == 1) { - IOMUX_SETUP(mc33902_flexcan_pads); - imx6q_add_flexcan0(&flexcan0_mc33902_pdata); - pr_info("Flexcan Freescale mc33902\n"); - } else { - pr_info("Flexcan gpio_get_value CAN1_ERR failed\n"); - } + imx6q_add_flexcan0(&flexcan0_pdata); + pr_info("Flexcan 0\n"); + imx6q_add_flexcan1(&flexcan1_pdata); + pr_info("Flexcan 1\n"); } -#else - (void) ret; -#endif + clko2 = clk_get(NULL, "clko2_clk"); if (IS_ERR(clko2)) pr_err("can't get CLKO2 clock.\n"); |