pandora/video: use gpiolib
authornotaz <notasas@gmail.com>
Sat, 2 Jul 2016 13:41:30 +0000 (16:41 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 3 Jul 2016 00:10:27 +0000 (03:10 +0300)
also setting gpio164 low was wrong, it should actually be high to avoid
problems...

board/pandora/video.c

index fdf2a58..633cb93 100644 (file)
@@ -4,6 +4,7 @@
 #include <twl4030.h>
 #include <asm/arch/dss.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/gpio.h>
 
 #ifdef CONFIG_LCD
 #include "logo.h"
@@ -103,11 +104,9 @@ static void lcd_init(void)
 
        /* make sure LCD nreset is driven low (GPIO157)
         * (we are called before misc_init_r() which normally handles this stuff) */
-       writel(0x20000000, 0x49056090);
-       writel(readl(0x49056034) & ~0x20000000, 0x49056034);
-       /* also GPIO164 (some audible noise otherwise) */
-       writel(0x10, 0x49058094);
-       writel(readl(0x49058034) & ~0x10, 0x49058034);
+       gpio_direction_output(157, 0);
+       /* also GPIO164 should be high (some audible noise otherwise) */
+       gpio_direction_output(164, 1);
 
        lcd_spi_init();
 
@@ -126,7 +125,7 @@ static void lcd_init(void)
        /* Clear frame buffer */
        memset((void *)gd->fb_base, 0, 800*480*2);
 
-       writel(0x20000000, 0x49056094); /* Bring LCD out of reset (157) */
+       gpio_direction_output(157, 1);
        udelay(2000); /* Need to wait at least 1ms after reset to start sending signals */
 
        dss_lcd_init((uint)gd->fb_base);