summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAlexandr Shadchin <shadchin@cvs.openbsd.org>2012-07-13 12:33:09 +0000
committerAlexandr Shadchin <shadchin@cvs.openbsd.org>2012-07-13 12:33:09 +0000
commitf66d679b5b221ffd587520d77c4d071fafa74e9c (patch)
tree64dd6883e3e6166a7c4b3a08bc02566bae91cea8 /sys/dev
parentb1e16317d3f5d41dc96034cfcb77f29527f08ad0 (diff)
Add support compose LED on a usb keyboard
ok mpi@, from Alexander Polakov <polachok at gmail dot com>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/hidkbd.c6
-rw-r--r--sys/dev/usb/hidkbdsc.h3
-rw-r--r--sys/dev/usb/ukbd.c5
3 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/usb/hidkbd.c b/sys/dev/usb/hidkbd.c
index d02a5b49cb2..fe0f81bf171 100644
--- a/sys/dev/usb/hidkbd.c
+++ b/sys/dev/usb/hidkbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hidkbd.c,v 1.6 2012/07/07 09:25:45 mlarkin Exp $ */
+/* $OpenBSD: hidkbd.c,v 1.7 2012/07/13 12:33:08 shadchin Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -488,6 +488,8 @@ hidkbd_set_leds(struct hidkbd *kbd, int leds, uint8_t *report)
*report |= 1 << kbd->sc_numloc.pos;
if ((leds & WSKBD_LED_CAPS) && kbd->sc_capsloc.size == 1)
*report |= 1 << kbd->sc_capsloc.pos;
+ if ((leds & WSKBD_LED_COMPOSE) && kbd->sc_compose.size == 1)
+ *report |= 1 << kbd->sc_compose.pos;
return 1;
}
@@ -639,6 +641,8 @@ hidkbd_parse_desc(struct hidkbd *kbd, int id, void *desc, int dlen)
id, hid_output, &kbd->sc_capsloc, NULL);
hid_locate(desc, dlen, HID_USAGE2(HUP_LEDS, HUD_LED_SCROLL_LOCK),
id, hid_output, &kbd->sc_scroloc, NULL);
+ hid_locate(desc, dlen, HID_USAGE2(HUP_LEDS, HUD_LED_COMPOSE),
+ id, hid_output, &kbd->sc_compose, NULL);
return (NULL);
}
diff --git a/sys/dev/usb/hidkbdsc.h b/sys/dev/usb/hidkbdsc.h
index 6a993aa1856..3156886e633 100644
--- a/sys/dev/usb/hidkbdsc.h
+++ b/sys/dev/usb/hidkbdsc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hidkbdsc.h,v 1.3 2012/07/07 09:25:45 mlarkin Exp $ */
+/* $OpenBSD: hidkbdsc.h,v 1.4 2012/07/13 12:33:08 shadchin Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -63,6 +63,7 @@ struct hidkbd {
struct hid_location sc_numloc;
struct hid_location sc_capsloc;
struct hid_location sc_scroloc;
+ struct hid_location sc_compose;
int sc_leds;
/* state information */
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 2a995860874..9e086ee4120 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ukbd.c,v 1.57 2012/01/29 11:04:19 mpi Exp $ */
+/* $OpenBSD: ukbd.c,v 1.58 2012/07/13 12:33:08 shadchin Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -288,7 +288,8 @@ ukbd_attach(struct device *parent, struct device *self, void *aux)
}
/* Flash the leds; no real purpose, just shows we're alive. */
- ukbd_set_leds(sc, WSKBD_LED_SCROLL | WSKBD_LED_NUM | WSKBD_LED_CAPS);
+ ukbd_set_leds(sc, WSKBD_LED_SCROLL | WSKBD_LED_NUM |
+ WSKBD_LED_CAPS | WSKBD_LED_COMPOSE);
usbd_delay_ms(uha->parent->sc_udev, 400);
ukbd_set_leds(sc, 0);