summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-02-12 01:42:32 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-02-12 01:42:32 +0000
commit9522e3f66c4ebad1dc0187e47cd187d2f1c4abab (patch)
treea34c861b9998ba7ba49dfc356bfe8e6612100dac
parent9376da877edaa8e0675c894acc429fd65b095d7b (diff)
Move values related to device identification data to hilreg.h, with better
names.
-rw-r--r--sys/dev/hil/hilkbd.c13
-rw-r--r--sys/dev/hil/hilreg.h13
2 files changed, 17 insertions, 9 deletions
diff --git a/sys/dev/hil/hilkbd.c b/sys/dev/hil/hilkbd.c
index 8a58fe7a9fd..1bc6996e16f 100644
--- a/sys/dev/hil/hilkbd.c
+++ b/sys/dev/hil/hilkbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hilkbd.c,v 1.1 2003/02/11 19:39:30 miod Exp $ */
+/* $OpenBSD: hilkbd.c,v 1.2 2003/02/12 01:42:31 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -56,9 +56,6 @@ struct hilkbd_softc {
struct device *sc_wskbddev;
};
-#define HILKBD_LEDS 0xf0 /* keyboard has leds */
-#define HILKBD_NLEDS 0x70 /* keyboard led mask */
-
int hilkbdprobe(struct device *, void *, void *);
void hilkbdattach(struct device *, struct device *, void *);
@@ -144,11 +141,11 @@ hilkbdattach(struct device *parent, struct device *self, void *aux)
printf(", layout %x", layoutcode);
/*
- * Interpret the extended id information, if any
+ * Interpret the identification bytes, if any
*/
- if (ha->ha_infolen > 2) {
- if (ha->ha_info[2] & HILKBD_LEDS) {
- sc->sc_numleds = (ha->ha_info[2] & HILKBD_NLEDS) >> 4;
+ if (ha->ha_infolen > 2 && (ha->ha_info[1] & HIL_IOB) != 0) {
+ if (ha->ha_info[2] & HILIOB_PROMPT) {
+ sc->sc_numleds = (ha->ha_info[2] & HILIOB_PMASK) >> 4;
printf(", %d leds", sc->sc_numleds);
}
}
diff --git a/sys/dev/hil/hilreg.h b/sys/dev/hil/hilreg.h
index 2eff975ac6a..0ce222ab6ca 100644
--- a/sys/dev/hil/hilreg.h
+++ b/sys/dev/hil/hilreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hilreg.h,v 1.1 2003/02/11 19:39:30 miod Exp $ */
+/* $OpenBSD: hilreg.h,v 1.2 2003/02/12 01:42:31 miod Exp $ */
/* $NetBSD: hilreg.h,v 1.6 1997/02/02 09:39:21 thorpej Exp $ */
/*
@@ -147,3 +147,14 @@
#define ar_format(x) ~((x - 10) / 10)
#define KBD_ARD 400 /* initial delay in msec (10 - 2560) */
#define KBD_ARR 60 /* rate (10 - 2550 msec, 2551 == off) */
+
+/* Device information bits */
+#define HIL_ABSOLUTE 0x40 /* absolute positioning data */
+#define HIL_16_BITS 0x20 /* 16 bit position accuracy */
+#define HIL_IOB 0x10 /* I/O description byte follows */
+#define HIL_AXMASK 0x03 /* Number of axes supported */
+
+#define HILIOB_PROMPT 0x80 /* prompt and acknowledge (leds) supported */
+#define HILIOB_PMASK 0x70 /* number of prompt & acknowledge supported */
+#define HILIOB_PIO 0x08 /* proximity in/out (pressure) supported */
+#define HILIOB_BMASK 0x07 /* number of buttons supported */