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

留言

  1. 您好 請問您有買gps8000使用在此開發板嗎?
    想跟您請教如何放anddroid在此開發板上 謝謝您!

    回覆刪除

張貼留言

這個網誌中的熱門文章

有趣的邏輯問題:是誰在說謊

Web 技術中的 Session 是什麼?

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

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

Reverse SSH Tunnel 反向打洞實錄