[Pommed-commits] r458 - in trunk: . pommed

jblache at alioth.debian.org jblache at alioth.debian.org
Fri May 9 13:33:56 UTC 2008


Author: jblache
Date: 2008-05-09 13:33:55 +0000 (Fri, 09 May 2008)
New Revision: 458

Modified:
   trunk/ChangeLog
   trunk/pommed/evdev.c
   trunk/pommed/evdev.h
Log:
Add more IDs for external Apple keyboards.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-04-28 16:58:44 UTC (rev 457)
+++ trunk/ChangeLog	2008-05-09 13:33:55 UTC (rev 458)
@@ -2,6 +2,7 @@
 --------------------
 
 version 1.18:
+	- pommed: add more IDs for Apple external keyboards
 
 version 1.17:
 	- pommed: handle path change for the applesmc led interface

Modified: trunk/pommed/evdev.c
===================================================================
--- trunk/pommed/evdev.c	2008-04-28 16:58:44 UTC (rev 457)
+++ trunk/pommed/evdev.c	2008-05-09 13:33:55 UTC (rev 458)
@@ -719,9 +719,9 @@
 }
 #endif /* !__powerpc__ */
 
-/* External Apple USB keyboards */
+/* Apple external USB keyboard, white */
 int
-evdev_is_extkbd(unsigned short *id)
+evdev_is_extkbd_white(unsigned short *id)
 {
   unsigned short product = id[ID_PRODUCT];
 
@@ -731,10 +731,9 @@
   if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE)
     return 0;
 
-  if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_WHITE)
-      || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU))
+  if (product == USB_PRODUCT_ID_APPLE_EXTKBD_WHITE)
     {
-      logdebug(" -> External Apple USB keyboard\n");
+      logdebug(" -> External Apple USB keyboard (white)\n");
 
       kbd_set_fnmode();
 
@@ -744,6 +743,65 @@
   return 0;
 }
 
+/* Apple external USB keyboard, aluminium */
+int
+evdev_is_extkbd_alu(unsigned short *id)
+{
+  unsigned short product = id[ID_PRODUCT];
+
+  if (id[ID_BUS] != BUS_USB)
+    return 0;
+
+  if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE)
+    return 0;
+
+  if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ANSI)
+      || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ISO)
+      || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_JIS))
+    {
+      logdebug(" -> External Apple USB keyboard (aluminium)\n");
+
+      kbd_set_fnmode();
+
+      return 1;
+    }
+
+  return 0;
+}
+
+/* Apple external wireless keyboard, aluminium */
+int
+evdev_is_extkbd_alu_wl(unsigned short *id)
+{
+  unsigned short product = id[ID_PRODUCT];
+
+  if (id[ID_BUS] != BUS_USB)
+    return 0;
+
+  if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE)
+    return 0;
+
+  if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ANSI)
+      || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ISO)
+      || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_JIS))
+    {
+      logdebug(" -> External Apple wireless keyboard (aluminium)\n");
+
+      kbd_set_fnmode();
+
+      return 1;
+    }
+
+  return 0;
+}
+
+/* Any external Apple USB keyboard */
+int
+evdev_is_extkbd(unsigned short *id)
+{
+  return (evdev_is_extkbd_white(id) || evdev_is_extkbd_alu(id) || evdev_is_extkbd_alu_wl(id));
+}
+
 /* Mouseemu virtual keyboard */
 static int
 evdev_is_mouseemu(unsigned short *id)

Modified: trunk/pommed/evdev.h
===================================================================
--- trunk/pommed/evdev.h	2008-04-28 16:58:44 UTC (rev 457)
+++ trunk/pommed/evdev.h	2008-05-09 13:33:55 UTC (rev 458)
@@ -58,11 +58,19 @@
 #define USB_PRODUCT_ID_WELLSPRING2_JIS    0x0232
 
 
-/* Apple USB keyboards, external */
+/* Apple external USB keyboard, white */
 #define USB_PRODUCT_ID_APPLE_EXTKBD_WHITE   0x020c
-#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU     0x0221
 
+/* Apple external USB keyboard, aluminium */
+#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ANSI 0x0220
+#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ISO  0x0221
+#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_JIS  0x0222
 
+/* Apple external wireless keyboard, aluminium */
+#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ANSI 0x022c
+#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ISO  0x022d
+#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_JIS  0x022e
+
 /* Apple Remote IR Receiver */
 #define USB_PRODUCT_ID_APPLEIR        0x8240
 #define USB_PRODUCT_ID_APPLEIR_2      0x8242




More information about the Pommed-commits mailing list