/* * Initialize the IOMUX Alternative Functions of the Freescale Kinetis MCU */ void __init kinetis_iomux_init(void) { int platform; int lcdtype; /* * Configure IOs depending on the board we're running on, and * the configuration options we're using. * Let's control platform strictly: if some of it does not need to * play with iomux, it must be present in switch below (otherwise, * the warning message will be printed-out) */ platform = kinetis_platform_get(); lcdtype = kinetis_lcdtype_get(); /* * LCD signals */ if (lcdtype == LCD_TWR_LCD_RGB || (lcdtype == LCD_FUT_TWR_NL8048 && (platform == PLATFORM_KINETIS_K70_SOM || platform == PLATFORM_KINETIS_TWR_K70F120M))) { kinetis_gpio_config_table( twr_lcd_rgb_iomux, ARRAY_SIZE(twr_lcd_rgb_iomux)); } else if (lcdtype == LCD_EA_LCD_004 && platform == PLATFORM_KINETIS_K70_SOM) { kinetis_gpio_config_table( k70som_ealcd004_iomux, ARRAY_SIZE(k70som_ealcd004_iomux)); } else if (lcdtype == LCD_EA_LCD_004 && platform == PLATFORM_KINETIS_TWR_K70F120M) { pr_err("%s: Configuration of TWR-K70F120M with EA-LCD-004 " "is not supported yet.", __func__); } else { pr_err("%s: unsupported platform (%d) or type of LCD (%d)\n", __func__, platform, lcdtype); } /* * Signals other than LCD */ switch (platform) { case PLATFORM_KINETIS_TWR_K70F120M: kinetis_gpio_config_table( twrk70f120m_iomux, ARRAY_SIZE(twrk70f120m_iomux)); break; case PLATFORM_KINETIS_K70_SOM: case PLATFORM_KINETIS_K61_SOM: kinetis_gpio_config_table( k70som_iomux, ARRAY_SIZE(k70som_iomux)); break; default: break; } }
/* * Configure all necessary GPIO pins */ static void gpio_init(void) { /* * Configure GPIO pins using the `twr_k70f120m_gpio[]` table */ kinetis_gpio_config_table( twr_k70f120m_gpio, ARRAY_SIZE(twr_k70f120m_gpio)); }
/* * Configure all necessary GPIO pins */ static void gpio_init(void) { /* * Configure GPIO pins using the `k70_som_gpio[]` table */ kinetis_gpio_config_table( k70_som_gpio, ARRAY_SIZE(k70_som_gpio)); }