Add GPIO Keys support for Devkit8000

Using Android on Devkit8000, we have problem of getting back to previous screen. The touchscreen can only be used to decide whether you select item or not, so a BACK button would be needed absolutely for Android. Devkit8000 board has four buttons on the corner, we can set one of it as Back functionality.



First step, add a option to kernel config file to enable GPIO keyboard device:
CONFIG_KEYBOARD_GPIO=y

Second step, set USER_KEY as ESC Keycode for back functionality:
diff --git a/arch/arm/mach-omap2/board-omap3devkit8000.c b/arch/arm/mach-omap2/board-omap3devkit8000.c
index e86d254..ec17311 100644
--- a/arch/arm/mach-omap2/board-omap3devkit8000.c
+++ b/arch/arm/mach-omap2/board-omap3devkit8000.c
@@ -462,9 +462,11 @@ static struct platform_device leds_gpio = {
 
 static struct gpio_keys_button gpio_buttons[] = {
  {
-  .code   = BTN_EXTRA,
+//  .code   = BTN_EXTRA,
+  .code   = KEY_ESC,
   .gpio   = 26,
   .desc   = "user",
+  .active_low  = 1,
   .wakeup   = 1,
  },
 }

Here is the full patch you can download directly:
http://people.linux.org.tw/~fred/patches/devkit8000-gpiokey-android-kernel.patch

這個網誌中的熱門文章

Web 技術中的 Session 是什麼?

NodeJS 與 MongoDB 的邂逅

淺談 USB 通訊架構之定義(一)

淺談 USB 通訊架構之定義(二)

JavaScript 好用的 async 異步函數!