summaryrefslogtreecommitdiff
path: root/meta/packages/linux/linux-openmoko/tweak_power_button.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/linux/linux-openmoko/tweak_power_button.patch')
-rw-r--r--meta/packages/linux/linux-openmoko/tweak_power_button.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-openmoko/tweak_power_button.patch b/meta/packages/linux/linux-openmoko/tweak_power_button.patch
new file mode 100644
index 000000000..192936575
--- /dev/null
+++ b/meta/packages/linux/linux-openmoko/tweak_power_button.patch
@@ -0,0 +1,32 @@
+Index: linux-2.6.22/drivers/i2c/chips/pcf50606.c
+===================================================================
+--- linux-2.6.22.orig/drivers/i2c/chips/pcf50606.c 2008-02-20 12:05:27.000000000 +0000
++++ linux-2.6.22/drivers/i2c/chips/pcf50606.c 2008-02-20 12:15:24.000000000 +0000
+@@ -564,7 +564,8 @@
+ /* ONKEY falling edge (start of button press) */
+ DEBUGPC("ONKEYF ");
+ pcf->flags |= PCF50606_F_PWR_PRESSED;
+- input_report_key(pcf->input_dev, KEY_POWER, 1);
++ input_report_key(pcf->input_dev, KEY_SUSPEND, 1);
++ input_event(pcf->input_dev, EV_PWR, KEY_SUSPEND, 1);
+ }
+ if (int1 & PCF50606_INT1_ONKEY1S) {
+ /* ONKEY pressed for more than 1 second */
+@@ -582,7 +583,7 @@
+ DEBUGPC("ONKEYR ");
+ pcf->flags &= ~PCF50606_F_PWR_PRESSED;
+ pcf->onkey_seconds = -1;
+- input_report_key(pcf->input_dev, KEY_POWER, 0);
++ input_report_key(pcf->input_dev, KEY_SUSPEND, 0);
+ /* disable SECOND interrupt in case RTC didn't
+ * request it */
+ if (!(pcf->flags & PCF50606_F_RTC_SECOND))
+@@ -1622,7 +1623,7 @@
+ data->input_dev->cdev.dev = &new_client->dev;
+
+ data->input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_PWR);
+- set_bit(KEY_POWER, data->input_dev->keybit);
++ set_bit(KEY_SUSPEND, data->input_dev->keybit);
+ set_bit(KEY_POWER2, data->input_dev->keybit);
+ set_bit(KEY_BATTERY, data->input_dev->keybit);
+