From: Andreas Jaggi This patch adds support for the special adb buttons of the aluminium PowerBook G4. Signed-off-by: Andreas Jaggi Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton --- drivers/macintosh/adbhid.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/linux/input.h | 5 +++++ 2 files changed, 45 insertions(+) diff -puN drivers/macintosh/adbhid.c~macintosh-adbhidc-adb-buttons-support-for drivers/macintosh/adbhid.c --- 25/drivers/macintosh/adbhid.c~macintosh-adbhidc-adb-buttons-support-for 2005-01-21 19:20:34.000000000 -0800 +++ 25-akpm/drivers/macintosh/adbhid.c 2005-04-25 19:33:07.726620288 -0700 @@ -555,6 +555,42 @@ adbhid_buttons_input(unsigned char *data #endif /* CONFIG_PMAC_BACKLIGHT */ input_report_key(&adbhid[id]->input, KEY_BRIGHTNESSUP, down); break; + + case 0xc: /* videomode switch */ + input_report_key(&adbhid[id]->input, KEY_SWITCHVIDEOMODE, down); + break; + + case 0xd: /* keyboard illumination toggle */ + input_report_key(&adbhid[id]->input, KEY_KBDILLUMTOGGLE, down); + break; + + case 0xe: /* keyboard illumination decrease */ + input_report_key(&adbhid[id]->input, KEY_KBDILLUMDOWN, down); + break; + + case 0xf: + switch (data[1]) { + case 0x8f: + case 0x0f: + /* keyboard illumination increase */ + input_report_key(&adbhid[id]->input, KEY_KBDILLUMUP, down); + break; + + case 0x7f: + case 0xff: + /* keypad overlay toogle */ + break; + + default: + printk(KERN_INFO "Unhandled ADB_MISC event %02x, %02x, %02x, %02x\n", + data[0], data[1], data[2], data[3]); + break; + } + break; + default: + printk(KERN_INFO "Unhandled ADB_MISC event %02x, %02x, %02x, %02x\n", + data[0], data[1], data[2], data[3]); + break; } } break; @@ -775,6 +811,10 @@ adbhid_input_register(int id, int defaul set_bit(KEY_BRIGHTNESSUP, adbhid[id]->input.keybit); set_bit(KEY_BRIGHTNESSDOWN, adbhid[id]->input.keybit); set_bit(KEY_EJECTCD, adbhid[id]->input.keybit); + set_bit(KEY_SWITCHVIDEOMODE, adbhid[id]->input.keybit); + set_bit(KEY_KBDILLUMTOGGLE, adbhid[id]->input.keybit); + set_bit(KEY_KBDILLUMDOWN, adbhid[id]->input.keybit); + set_bit(KEY_KBDILLUMUP, adbhid[id]->input.keybit); break; } if (adbhid[id]->name[0]) diff -puN include/linux/input.h~macintosh-adbhidc-adb-buttons-support-for include/linux/input.h --- 25/include/linux/input.h~macintosh-adbhidc-adb-buttons-support-for 2005-04-25 16:43:12.119588152 -0700 +++ 25-akpm/include/linux/input.h 2005-04-25 19:33:07.727620136 -0700 @@ -328,6 +328,11 @@ struct input_absinfo { #define KEY_BRIGHTNESSUP 225 #define KEY_MEDIA 226 +#define KEY_SWITCHVIDEOMODE 227 +#define KEY_KBDILLUMTOGGLE 228 +#define KEY_KBDILLUMDOWN 229 +#define KEY_KBDILLUMUP 230 + #define KEY_UNKNOWN 240 #define BTN_MISC 0x100 _