diff options
author | Pedro Perez de Heredia <pedro.perez@digi.com> | 2012-02-18 19:23:57 +0100 |
---|---|---|
committer | Pedro Perez de Heredia <pedro.perez@digi.com> | 2012-02-18 20:44:24 +0100 |
commit | 031314888262cf6b0a5a32f3193ddf022b6ab8a0 (patch) | |
tree | eec27522f51089d98cb5920820e349ba9940d38a | |
parent | f8e87995d1baaf51983188a065d7fc9245376df2 (diff) |
ccxmx53: add support for early user leds (mainly for debugging)
Signed-off-by: Pedro Perez de Heredia <pedro.perez@digi.com>
-rw-r--r-- | arch/arm/mach-mx5/devices_ccwmx53.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-mx5/devices_ccwmx53.h | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/devices_ccwmx53.c b/arch/arm/mach-mx5/devices_ccwmx53.c index 0c7089e57d04..22161d76874b 100644 --- a/arch/arm/mach-mx5/devices_ccwmx53.c +++ b/arch/arm/mach-mx5/devices_ccwmx53.c @@ -71,6 +71,34 @@ extern void ccwmx53_gpio_spi_chipselect_active(int cspi_mode, int status, extern void ccwmx53_gpio_spi_chipselect_inactive(int cspi_mode, int status, int chipselect); +void ccxmx53_user_led(int led, int val) +{ +#if defined(CONFIG_HAS_EARLY_USER_LEDS) + __iomem void *base; + u32 reg, mask; + + if (led == 1) { + /* USER LED1 GPIO 5, 20 */ + mask = 1 << 20; + base = ioremap(GPIO5_BASE_ADDR - MX53_OFFSET, SZ_4K); + } else if (led == 2) { + /* USER LED2 GPIO 7, 12 */ + mask = 1 << 12; + base = ioremap(GPIO7_BASE_ADDR - MX53_OFFSET, SZ_4K); + } else + return; + + reg = __raw_readl(base); + if (val) + reg |= mask; + else + reg &= ~mask; + + __raw_writel(reg, base); + iounmap(base); +#endif /* CONFIG_HAS_EARLY_USER_LEDS */ +} + /* Only SD2 has connected WP and CD */ #define ESDHC2_WP_GPIO MX53_GPIO(1,2) #define ESDHC2_CD_GPIO MX53_GPIO(1,4) diff --git a/arch/arm/mach-mx5/devices_ccwmx53.h b/arch/arm/mach-mx5/devices_ccwmx53.h index 028134493374..88e3b3dca34c 100644 --- a/arch/arm/mach-mx5/devices_ccwmx53.h +++ b/arch/arm/mach-mx5/devices_ccwmx53.h @@ -43,6 +43,7 @@ void gpio_smsc911x_active(void); void gpio_sdhc_active(int interface); void gpio_fec_active(void); void gpio_can_active(int interface); +void ccxmx53_user_led(int led, int val); /* framebuffer settings */ #if defined(CONFIG_CCXMX5X_DISP0) && defined(CONFIG_CCXMX5X_DISP1) |