Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45543
b: refs/heads/master
c: d4ae650
h: refs/heads/master
i:
  45541: 55737b5
  45539: 21c161d
  45535: dcdbb71
v: v3
  • Loading branch information
Simon Budig authored and Jiri Kosina committed Jan 21, 2007
1 parent 2f0cd46 commit 6657293
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 641266fdaa3c137c632f8ad2e4124248bafe7a98
refs/heads/master: d4ae650a904612ffb7edd3f28b69b022988d2466
4 changes: 4 additions & 0 deletions trunk/drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,10 @@ static void hid_output_field(struct hid_field *field, __u8 *data)
unsigned size = field->report_size;
unsigned n;

/* make sure the unused bits in the last byte are zeros */
if (count > 0 && size > 0)
data[(count*size-1)/8] = 0;

for (n = 0; n < count; n++) {
if (field->logical_minimum < 0) /* signed values */
implement(data, offset + n * size, size, s32ton(field->value[n], size));
Expand Down
19 changes: 16 additions & 3 deletions trunk/drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,22 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
break;

case HID_UP_LED:
if (((usage->hid - 1) & 0xffff) >= LED_MAX)
goto ignore;
map_led((usage->hid - 1) & 0xffff);

switch (usage->hid & 0xffff) { /* HID-Value: */
case 0x01: map_led (LED_NUML); break; /* "Num Lock" */
case 0x02: map_led (LED_CAPSL); break; /* "Caps Lock" */
case 0x03: map_led (LED_SCROLLL); break; /* "Scroll Lock" */
case 0x04: map_led (LED_COMPOSE); break; /* "Compose" */
case 0x05: map_led (LED_KANA); break; /* "Kana" */
case 0x27: map_led (LED_SLEEP); break; /* "Stand-By" */
case 0x4c: map_led (LED_SUSPEND); break; /* "System Suspend" */
case 0x09: map_led (LED_MUTE); break; /* "Mute" */
case 0x4b: map_led (LED_MISC); break; /* "Generic Indicator" */
case 0x19: map_led (LED_MAIL); break; /* "Message Waiting" */
case 0x4d: map_led (LED_CHARGING); break; /* "External Power Connected" */

default: goto ignore;
}
break;

case HID_UP_DIGITIZER:
Expand Down

0 comments on commit 6657293

Please sign in to comment.