Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb only build gdium Fn support with options GDIUM_K...



details:   https://anonhg.NetBSD.org/src/rev/85ff52d8b0b4
branches:  trunk
changeset: 770938:85ff52d8b0b4
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Nov 03 02:41:29 2011 +0000

description:
only build gdium Fn support with options GDIUM_KEYBOARD_HACK

diffstat:

 sys/dev/usb/files.usb |   4 +++-
 sys/dev/usb/ukbd.c    |  17 ++++++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)

diffs (118 lines):

diff -r 83b2567415b0 -r 85ff52d8b0b4 sys/dev/usb/files.usb
--- a/sys/dev/usb/files.usb     Thu Nov 03 00:29:00 2011 +0000
+++ b/sys/dev/usb/files.usb     Thu Nov 03 02:41:29 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.usb,v 1.115 2011/10/02 16:30:58 jmcneill Exp $
+#      $NetBSD: files.usb,v 1.116 2011/11/03 02:41:29 macallan Exp $
 #
 # Config file and device description for machine-independent USB code.
 # Included by ports that need it.  Ports that use it must provide
@@ -79,6 +79,8 @@
 
 # Keyboards
 defparam       UKBD_LAYOUT
+# Gdium's Fn key needs software translation
+defflag                opt_ukbd.h      GDIUM_KEYBOARD_HACK
 device ukbd: hid, wskbddev
 attach ukbd at uhidbus
 file   dev/usb/ukbd.c                  ukbd                    needs-flag
diff -r 83b2567415b0 -r 85ff52d8b0b4 sys/dev/usb/ukbd.c
--- a/sys/dev/usb/ukbd.c        Thu Nov 03 00:29:00 2011 +0000
+++ b/sys/dev/usb/ukbd.c        Thu Nov 03 02:41:29 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ukbd.c,v 1.112 2011/11/02 08:49:08 macallan Exp $        */
+/*      $NetBSD: ukbd.c,v 1.113 2011/11/03 02:41:29 macallan Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.112 2011/11/02 08:49:08 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.113 2011/11/03 02:41:29 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,6 +66,7 @@
 #include <dev/wscons/wsksymvar.h>
 
 #ifdef _KERNEL_OPT
+#include "opt_ukbd.h"
 #include "opt_ukbd_layout.h"
 #include "opt_wsdisplay_compat.h"
 #include "opt_ddb.h"
@@ -145,6 +146,7 @@
        { 0x00, 0x00 }
 };
 
+#ifdef GDIUM_KEYBOARD_HACK
 Static const struct ukbd_keycodetrans trtab_gdium_fn[] = {     
 #ifdef notyet
                { 58, 0 },      /* F1 -> toggle camera */
@@ -169,6 +171,7 @@
                { 81, 78 },     /* down -> page down */
                { 82, 75 }      /* up -> page up */
 };
+#endif
 
 #if defined(__NetBSD__) && defined(WSDISPLAY_COMPAT_RAWKBD)
 #define NN 0                   /* no translation */
@@ -423,9 +426,11 @@
        if (qflags & UQ_APPLE_ISO)
                sc->sc_flags |= FLAG_APPLE_FIX_ISO;
 
+#ifdef GDIUM_KEYBOARD_HACK
        if (uha->uaa->vendor == USB_VENDOR_CYPRESS &&
            uha->uaa->product == USB_PRODUCT_CYPRESS_LPRDK)
                sc->sc_flags = FLAG_GDIUM_FN;
+#endif
 
 #ifdef DIAGNOSTIC
        aprint_normal(": %d modifier keys, %d key codes", sc->sc_nmod,
@@ -654,12 +659,14 @@
                else
                        sc->sc_flags &= ~FLAG_FN_PRESSED;
        }
-       
+
+#ifdef GDIUM_KEYBOARD_HACK
        if (sc->sc_flags & FLAG_GDIUM_FN) {
                if (sc->sc_flags & FLAG_FN_PRESSED) {
                        ukbd_translate_keycodes(sc, ud, trtab_gdium_fn);
                }
        }
+#endif
 
        if ((sc->sc_flags & FLAG_DEBOUNCE) && !(sc->sc_flags & FLAG_POLLING)) {
                /*
@@ -758,12 +765,14 @@
                                if (key == ud->keycode[j])
                                        goto rfound;
                        DPRINTFN(3,("ukbd_intr: relse key=0x%02x\n", key));
+#ifdef GDIUM_KEYBOARD_HACK
                        if (sc->sc_flags & FLAG_GDIUM_FN) {
                                if (key == 0x82) {
                                        sc->sc_flags &= ~FLAG_FN_PRESSED;
                                        goto rfound;
                                }
                        }
+#endif
                        ADDKEY(key | RELEASE);
                rfound:
                        ;
@@ -778,12 +787,14 @@
                                if (key == sc->sc_odata.keycode[j])
                                        goto pfound;
                        DPRINTFN(2,("ukbd_intr: press key=0x%02x\n", key));
+#ifdef GDIUM_KEYBOARD_HACK
                        if (sc->sc_flags & FLAG_GDIUM_FN) {
                                if (key == 0x82) {
                                        sc->sc_flags |= FLAG_FN_PRESSED;
                                        goto pfound;
                                }
                        }
+#endif
                        ADDKEY(key | PRESS);
                pfound:
                        ;



Home | Main Index | Thread Index | Old Index