title: how to wake up system from sleep using gpio-keys interrupt
body: <p><strong>UPDATE :</strong> I changed the keyboard layout file (gpio-keys.kl) to the following:</p>
  
  <pre><code>key 115   POWER     WAKE
  key 114   POWER     WAKE
  </code></pre>
  
  <p>As seen, I now registered the volume buttons as <strong>POWER</strong> keys in Android and it wakes up the system. However, I wish to have any generic gpio-key wake up the system. The fact that changing the key layout file as above works tells me that perhaps the issue is on the Android side and not the Linux kernel side. Not sure. Perhaps there are files in Android (policy files, etc.) where I can provide a wake capability to the gpio-key of choice, much the same way as the <strong>POWER</strong> key has this wake capability. </p>
  
  <p>Please let me know your thoughts.</p>
  
  <p><strong>ORIGINAL :</strong>
  As for some background, my hardware is a Samsung Galaxy S2-i777, which runs on an <strong>Exynos4210 SoC</strong> (ARM-based processor). OS is <strong>LineageOS 14.1</strong>. I'm trying to wake up my system from sleep using a <strong>gpio-keys</strong> interrupt but I have been unsuccessful. </p>
  
  <p>I've configured gpio-keys in my board file (no device tree as old kernel version). A snippet of where I defined my gpio-keys is below:</p>
  
  <pre><code>struct gpio_keys_button u1_buttons[] = {
  {
      .code = KEY_VOLUMEUP,
      .gpio = GPIO_VOL_UP,
      .active_low = 1,
      .type = EV_KEY,
      .wakeup = 1,
      .isr_hook = sec_debug_check_crash_key,
      .debounce_interval = 10,
  },  
  };
  </code></pre>
  
  <p>I omitted registered platform section, etc. but can show if necessary. As seen above, I set the boolean property <strong>wakeup</strong> to 1 to enable my gpio <strong>GPIO_VOL_UP</strong> to act as a wakeup source. Also as seen, it is my volume buttons that I want to use as my gpio-keys.
  I also modified my key layout file (gpio-keys.kl) as seen below:</p>
  
  <pre><code>key 115   VOLUME_UP       WAKE
  key 114   VOLUME_DOWN     WAKE
  </code></pre>
  
  <p>When I check my local terminal in <strong>LineageOS</strong>, I see that my <strong>gpio-keys</strong> are defined as <strong>wakeup_sources</strong> and <strong>wakeup</strong> is enabled. I also see that my volume buttons are generating interrupts (cat /proc/interrupts). </p>
  
  <p>When my system goes to sleep, the volume buttons (gpio-keys) do not wake up my system. Only thing that wakes up my system is the power button (which appears to be a gpio-key as well). </p>
  
  <p>What do you think the issue might be? What are the general steps necessary to waking up the system using gpio-keys interrupts? Even if it is not specific to my hardware, perhaps a general layout of these steps or certain considerations will help me since I might be missing something. Thanks!</p>