iPAQ h5550 keys patch

Dmitriy Korovkin <[email protected]> Sat, 13 Jan 2007 23:07:02 +0300
Newsgroups gmane.comp.handhelds.opie.devel
Message-ID <[email protected]>
Hi Erik,
Once you are concerned about keys in iPAQ, here is the patch that solved
the problem for me.
It makes side buttons vol+ and vol- work as up and down. This is quite
convenient. When I read a book, it's good. opie-player and volume plugin
works fine with up and down buttons too.
Regards,

-- 
Dmitriy

_______________________________________________

http://opie.handhelds.org/cgi-bin/moin.cgi/DeveloperWikiIndex

Opie-devel mailing list
[email protected]
https://handhelds.org/mailman/listinfo/opie-devel
h3600_ts.patch (text/plain, 745 B)
Index: h3600_ts.c
===================================================================
RCS file: /cvs/linux/kernel/drivers/char/h3600_ts.c,v
retrieving revision 1.76
diff -u -r1.76 h3600_ts.c
--- h3600_ts.c	27 Nov 2003 02:21:29 -0000	1.76
+++ h3600_ts.c	13 Jan 2007 19:58:16 -0000
@@ -142,7 +142,9 @@
         H3600_SCANCODE_DOWN,     /* 9 -> down */
 	H3600_SCANCODE_ACTION,   /* 10 -> action button (synthesized, not from Atmel) */
 	H3600_SCANCODE_SUSPEND,  /* 11 -> power button (synthesized, not from Atmel)  */
-	0, 0, 0, 0               /* pad out to 16 total bytes */
+        H3600_SCANCODE_UP,       /* 12 -> up */
+        H3600_SCANCODE_DOWN,     /* 13 -> down */
+				0, 0               /* pad out to 16 total bytes */
 };
 
 enum {
h5400_asic_io.patch (text/plain, 962 B)
Index: h5400_asic_io.c
===================================================================
RCS file: /cvs/linux/kernel/arch/arm/mach-pxa/h5400_asic_io.c,v
retrieving revision 1.38
diff -u -r1.38 h5400_asic_io.c
--- h5400_asic_io.c	7 Feb 2006 18:38:13 -0000	1.38
+++ h5400_asic_io.c	13 Jan 2007 19:55:57 -0000
@@ -62,8 +62,8 @@
 #define PERROR(format,arg...) printk(KERN_ERR __FILE__ ":%s - " format "\n", __FUNCTION__, ## arg)
 
 #define ADC_DATA_MASK	0x3ff
+#define MAX_BITS_IN_BUTTONS 14
 
-
 /***********************************************************************************
  *   ADC support (stolen from the H3900 code)
  ***********************************************************************************/
@@ -554,7 +554,7 @@
 
 	d = keys ^ oldkeys;
 	
-	for (i = 0; i < 11; i++) {
+	for (i = 0; i < MAX_BITS_IN_BUTTONS; i++) {
 		if (d & (1 << i)) {
 			unsigned char down = (keys & (1 << i)) ? 1 : 0;
 			h3600_hal_keypress (H3600_MAKEKEY (i, down));