[pkg-fso-commits] [SCM] linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko branch, andy-tracking, updated. upstream/20090303.gitb9de904e-144-gd7ac922

Nelson Castillo arhuaco at freaks-unidos.net
Thu Jun 11 09:55:13 UTC 2009


The following commit has been merged in the andy-tracking branch:
commit 6fbbacd00b2e6e09583b0f88aed39a7a6cfb6c81
Author: Paul Fertser <fercerpav at gmail.com>
Date:   Mon Jun 8 23:46:53 2009 +0400

    GTA0[12]: make headset button report PLAY pressed on press
    
    As discussed on the ML, currently headset button reports "KEY_PAUSE
    released" on press and "pressed" on release. For "pause" semantics it makes
    sense but if someone thinks of that as of just another button, it'd be good
    to have "pressed/released" events consistent with button press/release.
    
    Luca Capello <luca at pca.it> suggested to change the button event to KEY_PLAY
    and to invert the state to make it more consistent.
    
    This trivial patch inverts button events for GTA03 KEY_PLUS and KEY_MINUS,
    i'm not sure how undesirable that is. I can prepare an alternative that
    preserves current behaviour on GTA03 per request.
    
    Signed-off-by: Paul Fertser <fercerpav at gmail.com>

diff --git a/drivers/input/keyboard/neo1973kbd.c b/drivers/input/keyboard/neo1973kbd.c
index a95dd58..8756ae6 100644
--- a/drivers/input/keyboard/neo1973kbd.c
+++ b/drivers/input/keyboard/neo1973kbd.c
@@ -75,7 +75,7 @@ static struct neo1973kbd_key keys[] = {
 	[NEO1973_KEY_HOLD] = {
 		.name = "Neo1973 HOLD button",
 		.isr = neo1973kbd_default_key_irq,
-		.input_key = KEY_PAUSE,
+		.input_key = KEY_PLAY,
 	},
 	[NEO1973_KEY_JACK] = {
 		.name = "Neo1973 Headphone jack",
@@ -161,7 +161,7 @@ static irqreturn_t neo1973kbd_default_key_irq(int irq, void *dev_id)
 			continue;
 
 		input_report_key(kbd->input, keys[n].input_key,
-				  gpio_get_value(kbd->pdev->resource[n].start));
+				  !gpio_get_value(kbd->pdev->resource[n].start));
 		input_sync(kbd->input);
 	}
 
@@ -346,7 +346,7 @@ static int neo1973kbd_probe(struct platform_device *pdev)
 	input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_SW);
 	set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
 	set_bit(KEY_PHONE, input_dev->keybit);
-	set_bit(KEY_PAUSE, input_dev->keybit);
+	set_bit(KEY_PLAY, input_dev->keybit);
 
 	rc = input_register_device(neo1973kbd->input);
 	if (rc)

-- 
linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko



More information about the pkg-fso-commits mailing list