Skip to contentSkip to conversation

sh: Use sh7722 GPIO on Migo-R board

PATCH In review Magnus Damm 1 participant 1 message Sep 27, 2008 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 sh: Use sh7722 GPIO on Migo-R board

From: Magnus Damm <[email protected]>

This patch enables the GPIO code on Migo-R and converts the code from register based pinmux configuration to GPIO based pin by pin setup. While at it 2 LEDs are added and exported to user space.

---

 arch/sh/boards/Kconfig               |    1 
 arch/sh/boards/mach-migor/lcd_qvga.c |    6 -
 arch/sh/boards/mach-migor/setup.c    |  185 +++++++++++++++++++++-------------
 3 files changed, 124 insertions(+), 68 deletions(-)
arch/sh/boards/Kconfig +1 -0
@@ -162,6 +162,7 @@ config SH_SH7785LCR_29BIT_PHYSMAPS
 config SH_MIGOR
 	bool "Migo-R"
 	depends on CPU_SUBTYPE_SH7722
+	select ARCH_REQUIRE_GPIOLIB
 	help
 	  Select Migo-R if configuring for the SH7722 Migo-R platform
           by Renesas System Solutions Asia Pte. Ltd.
arch/sh/boards/mach-migor/lcd_qvga.c +4 -2
@@ -17,8 +17,10 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/gpio.h>
 #include <asm/sh_mobile_lcdc.h>
 #include <asm/migor.h>
+#include <asm/sh7722.h>
 
 /* LCD Module is a PH240320T according to board schematics. This module
  * is made up of a 240x320 LCD hooked up to a R61505U (or HX8347-A01?)
@@ -30,9 +32,9 @@
 
 static void reset_lcd_module(void)
 {
-	ctrl_outb(ctrl_inb(PORT_PHDR) & ~0x04, PORT_PHDR);
+	gpio_set_value(GPIO_PTH2, 0);
 	mdelay(2);
-	ctrl_outb(ctrl_inb(PORT_PHDR) | 0x04, PORT_PHDR);
+	gpio_set_value(GPIO_PTH2, 1);
 	mdelay(1);
 }
 
arch/sh/boards/mach-migor/setup.c +119 -66

236 lines not on this page · raw message