Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] macintosh/adbhid.c: adb buttons support for aluminium PowerBook G4

This patch adds support for the special adb buttons of the aluminium
PowerBook G4.

Signed-off-by: Andreas Jaggi <andreas.jaggi@waterwave.ch>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andreas Jaggi and committed by
Linus Torvalds
146a4b3b 616299af

+45
+40
drivers/macintosh/adbhid.c
··· 555 555 #endif /* CONFIG_PMAC_BACKLIGHT */ 556 556 input_report_key(&adbhid[id]->input, KEY_BRIGHTNESSUP, down); 557 557 break; 558 + 559 + case 0xc: /* videomode switch */ 560 + input_report_key(&adbhid[id]->input, KEY_SWITCHVIDEOMODE, down); 561 + break; 562 + 563 + case 0xd: /* keyboard illumination toggle */ 564 + input_report_key(&adbhid[id]->input, KEY_KBDILLUMTOGGLE, down); 565 + break; 566 + 567 + case 0xe: /* keyboard illumination decrease */ 568 + input_report_key(&adbhid[id]->input, KEY_KBDILLUMDOWN, down); 569 + break; 570 + 571 + case 0xf: 572 + switch (data[1]) { 573 + case 0x8f: 574 + case 0x0f: 575 + /* keyboard illumination increase */ 576 + input_report_key(&adbhid[id]->input, KEY_KBDILLUMUP, down); 577 + break; 578 + 579 + case 0x7f: 580 + case 0xff: 581 + /* keypad overlay toogle */ 582 + break; 583 + 584 + default: 585 + printk(KERN_INFO "Unhandled ADB_MISC event %02x, %02x, %02x, %02x\n", 586 + data[0], data[1], data[2], data[3]); 587 + break; 588 + } 589 + break; 590 + default: 591 + printk(KERN_INFO "Unhandled ADB_MISC event %02x, %02x, %02x, %02x\n", 592 + data[0], data[1], data[2], data[3]); 593 + break; 558 594 } 559 595 } 560 596 break; ··· 811 775 set_bit(KEY_BRIGHTNESSUP, adbhid[id]->input.keybit); 812 776 set_bit(KEY_BRIGHTNESSDOWN, adbhid[id]->input.keybit); 813 777 set_bit(KEY_EJECTCD, adbhid[id]->input.keybit); 778 + set_bit(KEY_SWITCHVIDEOMODE, adbhid[id]->input.keybit); 779 + set_bit(KEY_KBDILLUMTOGGLE, adbhid[id]->input.keybit); 780 + set_bit(KEY_KBDILLUMDOWN, adbhid[id]->input.keybit); 781 + set_bit(KEY_KBDILLUMUP, adbhid[id]->input.keybit); 814 782 break; 815 783 } 816 784 if (adbhid[id]->name[0])
+5
include/linux/input.h
··· 328 328 #define KEY_BRIGHTNESSUP 225 329 329 #define KEY_MEDIA 226 330 330 331 + #define KEY_SWITCHVIDEOMODE 227 332 + #define KEY_KBDILLUMTOGGLE 228 333 + #define KEY_KBDILLUMDOWN 229 334 + #define KEY_KBDILLUMUP 230 335 + 331 336 #define KEY_UNKNOWN 240 332 337 333 338 #define BTN_MISC 0x100