linux/drivers/macintosh/adbhid.c
<<
>>
Prefs
   1/*
   2 * drivers/macintosh/adbhid.c
   3 *
   4 * ADB HID driver for Power Macintosh computers.
   5 *
   6 * Adapted from drivers/macintosh/mac_keyb.c by Franz Sirl.
   7 * drivers/macintosh/mac_keyb.c was Copyright (C) 1996 Paul Mackerras
   8 * with considerable contributions from Ben Herrenschmidt and others.
   9 *
  10 * Copyright (C) 2000 Franz Sirl.
  11 *
  12 * Adapted to ADB changes and support for more devices by
  13 * Benjamin Herrenschmidt. Adapted from code in MkLinux
  14 * and reworked.
  15 * 
  16 * Supported devices:
  17 *
  18 * - Standard 1 button mouse
  19 * - All standard Apple Extended protocol (handler ID 4)
  20 * - mouseman and trackman mice & trackballs 
  21 * - PowerBook Trackpad (default setup: enable tapping)
  22 * - MicroSpeed mouse & trackball (needs testing)
  23 * - CH Products Trackball Pro (needs testing)
  24 * - Contour Design (Contour Mouse)
  25 * - Hunter digital (NoHandsMouse)
  26 * - Kensignton TurboMouse 5 (needs testing)
  27 * - Mouse Systems A3 mice and trackballs <aidan@kublai.com>
  28 * - MacAlly 2-buttons mouse (needs testing) <pochini@denise.shiny.it>
  29 *
  30 * To do:
  31 *
  32 * Improve Kensington support.
  33 * Split mouse/kbd
  34 * Move to syfs
  35 */
  36
  37#include <linux/module.h>
  38#include <linux/slab.h>
  39#include <linux/init.h>
  40#include <linux/notifier.h>
  41#include <linux/input.h>
  42
  43#include <linux/adb.h>
  44#include <linux/cuda.h>
  45#include <linux/pmu.h>
  46
  47#include <asm/machdep.h>
  48#ifdef CONFIG_PPC_PMAC
  49#include <asm/backlight.h>
  50#include <asm/pmac_feature.h>
  51#endif
  52
  53MODULE_AUTHOR("Franz Sirl <Franz.Sirl-kernel@lauterbach.com>");
  54
  55static int restore_capslock_events;
  56module_param(restore_capslock_events, int, 0644);
  57MODULE_PARM_DESC(restore_capslock_events,
  58        "Produce keypress events for capslock on both keyup and keydown.");
  59
  60#define KEYB_KEYREG     0       /* register # for key up/down data */
  61#define KEYB_LEDREG     2       /* register # for leds on ADB keyboard */
  62#define MOUSE_DATAREG   0       /* reg# for movement/button codes from mouse */
  63
  64static int adb_message_handler(struct notifier_block *, unsigned long, void *);
  65static struct notifier_block adbhid_adb_notifier = {
  66        .notifier_call  = adb_message_handler,
  67};
  68
  69/* Some special keys */
  70#define ADB_KEY_DEL             0x33
  71#define ADB_KEY_CMD             0x37
  72#define ADB_KEY_CAPSLOCK        0x39
  73#define ADB_KEY_FN              0x3f
  74#define ADB_KEY_FWDEL           0x75
  75#define ADB_KEY_POWER_OLD       0x7e
  76#define ADB_KEY_POWER           0x7f
  77
  78static const u16 adb_to_linux_keycodes[128] = {
  79        /* 0x00 */ KEY_A,               /*  30 */
  80        /* 0x01 */ KEY_S,               /*  31 */
  81        /* 0x02 */ KEY_D,               /*  32 */
  82        /* 0x03 */ KEY_F,               /*  33 */
  83        /* 0x04 */ KEY_H,               /*  35 */
  84        /* 0x05 */ KEY_G,               /*  34 */
  85        /* 0x06 */ KEY_Z,               /*  44 */
  86        /* 0x07 */ KEY_X,               /*  45 */
  87        /* 0x08 */ KEY_C,               /*  46 */
  88        /* 0x09 */ KEY_V,               /*  47 */
  89        /* 0x0a */ KEY_102ND,           /*  86 */
  90        /* 0x0b */ KEY_B,               /*  48 */
  91        /* 0x0c */ KEY_Q,               /*  16 */
  92        /* 0x0d */ KEY_W,               /*  17 */
  93        /* 0x0e */ KEY_E,               /*  18 */
  94        /* 0x0f */ KEY_R,               /*  19 */
  95        /* 0x10 */ KEY_Y,               /*  21 */
  96        /* 0x11 */ KEY_T,               /*  20 */
  97        /* 0x12 */ KEY_1,               /*   2 */
  98        /* 0x13 */ KEY_2,               /*   3 */
  99        /* 0x14 */ KEY_3,               /*   4 */
 100        /* 0x15 */ KEY_4,               /*   5 */
 101        /* 0x16 */ KEY_6,               /*   7 */
 102        /* 0x17 */ KEY_5,               /*   6 */
 103        /* 0x18 */ KEY_EQUAL,           /*  13 */
 104        /* 0x19 */ KEY_9,               /*  10 */
 105        /* 0x1a */ KEY_7,               /*   8 */
 106        /* 0x1b */ KEY_MINUS,           /*  12 */
 107        /* 0x1c */ KEY_8,               /*   9 */
 108        /* 0x1d */ KEY_0,               /*  11 */
 109        /* 0x1e */ KEY_RIGHTBRACE,      /*  27 */
 110        /* 0x1f */ KEY_O,               /*  24 */
 111        /* 0x20 */ KEY_U,               /*  22 */
 112        /* 0x21 */ KEY_LEFTBRACE,       /*  26 */
 113        /* 0x22 */ KEY_I,               /*  23 */
 114        /* 0x23 */ KEY_P,               /*  25 */
 115        /* 0x24 */ KEY_ENTER,           /*  28 */
 116        /* 0x25 */ KEY_L,               /*  38 */
 117        /* 0x26 */ KEY_J,               /*  36 */
 118        /* 0x27 */ KEY_APOSTROPHE,      /*  40 */
 119        /* 0x28 */ KEY_K,               /*  37 */
 120        /* 0x29 */ KEY_SEMICOLON,       /*  39 */
 121        /* 0x2a */ KEY_BACKSLASH,       /*  43 */
 122        /* 0x2b */ KEY_COMMA,           /*  51 */
 123        /* 0x2c */ KEY_SLASH,           /*  53 */
 124        /* 0x2d */ KEY_N,               /*  49 */
 125        /* 0x2e */ KEY_M,               /*  50 */
 126        /* 0x2f */ KEY_DOT,             /*  52 */
 127        /* 0x30 */ KEY_TAB,             /*  15 */
 128        /* 0x31 */ KEY_SPACE,           /*  57 */
 129        /* 0x32 */ KEY_GRAVE,           /*  41 */
 130        /* 0x33 */ KEY_BACKSPACE,       /*  14 */
 131        /* 0x34 */ KEY_KPENTER,         /*  96 */
 132        /* 0x35 */ KEY_ESC,             /*   1 */
 133        /* 0x36 */ KEY_LEFTCTRL,        /*  29 */
 134        /* 0x37 */ KEY_LEFTMETA,        /* 125 */
 135        /* 0x38 */ KEY_LEFTSHIFT,       /*  42 */
 136        /* 0x39 */ KEY_CAPSLOCK,        /*  58 */
 137        /* 0x3a */ KEY_LEFTALT,         /*  56 */
 138        /* 0x3b */ KEY_LEFT,            /* 105 */
 139        /* 0x3c */ KEY_RIGHT,           /* 106 */
 140        /* 0x3d */ KEY_DOWN,            /* 108 */
 141        /* 0x3e */ KEY_UP,              /* 103 */
 142        /* 0x3f */ KEY_FN,              /* 0x1d0 */
 143        /* 0x40 */ 0,
 144        /* 0x41 */ KEY_KPDOT,           /*  83 */
 145        /* 0x42 */ 0,
 146        /* 0x43 */ KEY_KPASTERISK,      /*  55 */
 147        /* 0x44 */ 0,
 148        /* 0x45 */ KEY_KPPLUS,          /*  78 */
 149        /* 0x46 */ 0,
 150        /* 0x47 */ KEY_NUMLOCK,         /*  69 */
 151        /* 0x48 */ 0,
 152        /* 0x49 */ 0,
 153        /* 0x4a */ 0,
 154        /* 0x4b */ KEY_KPSLASH,         /*  98 */
 155        /* 0x4c */ KEY_KPENTER,         /*  96 */
 156        /* 0x4d */ 0,
 157        /* 0x4e */ KEY_KPMINUS,         /*  74 */
 158        /* 0x4f */ 0,
 159        /* 0x50 */ 0,
 160        /* 0x51 */ KEY_KPEQUAL,         /* 117 */
 161        /* 0x52 */ KEY_KP0,             /*  82 */
 162        /* 0x53 */ KEY_KP1,             /*  79 */
 163        /* 0x54 */ KEY_KP2,             /*  80 */
 164        /* 0x55 */ KEY_KP3,             /*  81 */
 165        /* 0x56 */ KEY_KP4,             /*  75 */
 166        /* 0x57 */ KEY_KP5,             /*  76 */
 167        /* 0x58 */ KEY_KP6,             /*  77 */
 168        /* 0x59 */ KEY_KP7,             /*  71 */
 169        /* 0x5a */ 0,
 170        /* 0x5b */ KEY_KP8,             /*  72 */
 171        /* 0x5c */ KEY_KP9,             /*  73 */
 172        /* 0x5d */ KEY_YEN,             /* 124 */
 173        /* 0x5e */ KEY_RO,              /*  89 */
 174        /* 0x5f */ KEY_KPCOMMA,         /* 121 */
 175        /* 0x60 */ KEY_F5,              /*  63 */
 176        /* 0x61 */ KEY_F6,              /*  64 */
 177        /* 0x62 */ KEY_F7,              /*  65 */
 178        /* 0x63 */ KEY_F3,              /*  61 */
 179        /* 0x64 */ KEY_F8,              /*  66 */
 180        /* 0x65 */ KEY_F9,              /*  67 */
 181        /* 0x66 */ KEY_HANJA,           /* 123 */
 182        /* 0x67 */ KEY_F11,             /*  87 */
 183        /* 0x68 */ KEY_HANGEUL,         /* 122 */
 184        /* 0x69 */ KEY_SYSRQ,           /*  99 */
 185        /* 0x6a */ 0,
 186        /* 0x6b */ KEY_SCROLLLOCK,      /*  70 */
 187        /* 0x6c */ 0,
 188        /* 0x6d */ KEY_F10,             /*  68 */
 189        /* 0x6e */ KEY_COMPOSE,         /* 127 */
 190        /* 0x6f */ KEY_F12,             /*  88 */
 191        /* 0x70 */ 0,
 192        /* 0x71 */ KEY_PAUSE,           /* 119 */
 193        /* 0x72 */ KEY_INSERT,          /* 110 */
 194        /* 0x73 */ KEY_HOME,            /* 102 */
 195        /* 0x74 */ KEY_PAGEUP,          /* 104 */
 196        /* 0x75 */ KEY_DELETE,          /* 111 */
 197        /* 0x76 */ KEY_F4,              /*  62 */
 198        /* 0x77 */ KEY_END,             /* 107 */
 199        /* 0x78 */ KEY_F2,              /*  60 */
 200        /* 0x79 */ KEY_PAGEDOWN,        /* 109 */
 201        /* 0x7a */ KEY_F1,              /*  59 */
 202        /* 0x7b */ KEY_RIGHTSHIFT,      /*  54 */
 203        /* 0x7c */ KEY_RIGHTALT,        /* 100 */
 204        /* 0x7d */ KEY_RIGHTCTRL,       /*  97 */
 205        /* 0x7e */ KEY_RIGHTMETA,       /* 126 */
 206        /* 0x7f */ KEY_POWER,           /* 116 */
 207};
 208
 209struct adbhid {
 210        struct input_dev *input;
 211        int id;
 212        int default_id;
 213        int original_handler_id;
 214        int current_handler_id;
 215        int mouse_kind;
 216        u16 *keycode;
 217        char name[64];
 218        char phys[32];
 219        int flags;
 220};
 221
 222#define FLAG_FN_KEY_PRESSED             0x00000001
 223#define FLAG_POWER_FROM_FN              0x00000002
 224#define FLAG_EMU_FWDEL_DOWN             0x00000004
 225#define FLAG_CAPSLOCK_TRANSLATE         0x00000008
 226#define FLAG_CAPSLOCK_DOWN              0x00000010
 227#define FLAG_CAPSLOCK_IGNORE_NEXT       0x00000020
 228#define FLAG_POWER_KEY_PRESSED          0x00000040
 229
 230static struct adbhid *adbhid[16];
 231
 232static void adbhid_probe(void);
 233
 234static void adbhid_input_keycode(int, int, int);
 235
 236static void init_trackpad(int id);
 237static void init_trackball(int id);
 238static void init_turbomouse(int id);
 239static void init_microspeed(int id);
 240static void init_ms_a3(int id);
 241
 242static struct adb_ids keyboard_ids;
 243static struct adb_ids mouse_ids;
 244static struct adb_ids buttons_ids;
 245
 246/* Kind of keyboard, see Apple technote 1152  */
 247#define ADB_KEYBOARD_UNKNOWN    0
 248#define ADB_KEYBOARD_ANSI       0x0100
 249#define ADB_KEYBOARD_ISO        0x0200
 250#define ADB_KEYBOARD_JIS        0x0300
 251
 252/* Kind of mouse  */
 253#define ADBMOUSE_STANDARD_100   0       /* Standard 100cpi mouse (handler 1) */
 254#define ADBMOUSE_STANDARD_200   1       /* Standard 200cpi mouse (handler 2) */
 255#define ADBMOUSE_EXTENDED       2       /* Apple Extended mouse (handler 4) */
 256#define ADBMOUSE_TRACKBALL      3       /* TrackBall (handler 4) */
 257#define ADBMOUSE_TRACKPAD       4       /* Apple's PowerBook trackpad (handler 4) */
 258#define ADBMOUSE_TURBOMOUSE5    5       /* Turbomouse 5 (previously req. mousehack) */
 259#define ADBMOUSE_MICROSPEED     6       /* Microspeed mouse (&trackball ?), MacPoint */
 260#define ADBMOUSE_TRACKBALLPRO   7       /* Trackball Pro (special buttons) */
 261#define ADBMOUSE_MS_A3          8       /* Mouse systems A3 trackball (handler 3) */
 262#define ADBMOUSE_MACALLY2       9       /* MacAlly 2-button mouse */
 263
 264static void
 265adbhid_keyboard_input(unsigned char *data, int nb, int apoll)
 266{
 267        int id = (data[0] >> 4) & 0x0f;
 268
 269        if (!adbhid[id]) {
 270                printk(KERN_ERR "ADB HID on ID %d not yet registered, packet %#02x, %#02x, %#02x, %#02x\n",
 271                       id, data[0], data[1], data[2], data[3]);
 272                return;
 273        }
 274
 275        /* first check this is from register 0 */
 276        if (nb != 3 || (data[0] & 3) != KEYB_KEYREG)
 277                return;         /* ignore it */
 278        adbhid_input_keycode(id, data[1], 0);
 279        if (!(data[2] == 0xff || (data[2] == 0x7f && data[1] == 0x7f)))
 280                adbhid_input_keycode(id, data[2], 0);
 281}
 282
 283static void
 284adbhid_input_keycode(int id, int scancode, int repeat)
 285{
 286        struct adbhid *ahid = adbhid[id];
 287        int keycode, up_flag, key;
 288
 289        keycode = scancode & 0x7f;
 290        up_flag = scancode & 0x80;
 291
 292        if (restore_capslock_events) {
 293                if (keycode == ADB_KEY_CAPSLOCK && !up_flag) {
 294                        /* Key pressed, turning on the CapsLock LED.
 295                         * The next 0xff will be interpreted as a release. */
 296                        if (ahid->flags & FLAG_CAPSLOCK_IGNORE_NEXT) {
 297                                /* Throw away this key event if it happens
 298                                 * just after resume. */
 299                                ahid->flags &= ~FLAG_CAPSLOCK_IGNORE_NEXT;
 300                                return;
 301                        } else {
 302                                ahid->flags |= FLAG_CAPSLOCK_TRANSLATE
 303                                        | FLAG_CAPSLOCK_DOWN;
 304                        }
 305                } else if (scancode == 0xff &&
 306                           !(ahid->flags & FLAG_POWER_KEY_PRESSED)) {
 307                        /* Scancode 0xff usually signifies that the capslock
 308                         * key was either pressed or released, or that the
 309                         * power button was released. */
 310                        if (ahid->flags & FLAG_CAPSLOCK_TRANSLATE) {
 311                                keycode = ADB_KEY_CAPSLOCK;
 312                                if (ahid->flags & FLAG_CAPSLOCK_DOWN) {
 313                                        /* Key released */
 314                                        up_flag = 1;
 315                                        ahid->flags &= ~FLAG_CAPSLOCK_DOWN;
 316                                } else {
 317                                        /* Key pressed */
 318                                        up_flag = 0;
 319                                        ahid->flags &= ~FLAG_CAPSLOCK_TRANSLATE;
 320                                }
 321                        } else {
 322                                printk(KERN_INFO "Spurious caps lock event "
 323                                                 "(scancode 0xff).\n");
 324                        }
 325                }
 326        }
 327
 328        switch (keycode) {
 329        case ADB_KEY_CAPSLOCK:
 330                if (!restore_capslock_events) {
 331                        /* Generate down/up events for CapsLock every time. */
 332                        input_report_key(ahid->input, KEY_CAPSLOCK, 1);
 333                        input_sync(ahid->input);
 334                        input_report_key(ahid->input, KEY_CAPSLOCK, 0);
 335                        input_sync(ahid->input);
 336                        return;
 337                }
 338                break;
 339#ifdef CONFIG_PPC_PMAC
 340        case ADB_KEY_POWER_OLD: /* Power key on PBook 3400 needs remapping */
 341                switch(pmac_call_feature(PMAC_FTR_GET_MB_INFO,
 342                        NULL, PMAC_MB_INFO_MODEL, 0)) {
 343                case PMAC_TYPE_COMET:
 344                case PMAC_TYPE_HOOPER:
 345                case PMAC_TYPE_KANGA:
 346                        keycode = ADB_KEY_POWER;
 347                }
 348                break;
 349        case ADB_KEY_POWER:
 350                /* Keep track of the power key state */
 351                if (up_flag)
 352                        ahid->flags &= ~FLAG_POWER_KEY_PRESSED;
 353                else
 354                        ahid->flags |= FLAG_POWER_KEY_PRESSED;
 355
 356                /* Fn + Command will produce a bogus "power" keycode */
 357                if (ahid->flags & FLAG_FN_KEY_PRESSED) {
 358                        keycode = ADB_KEY_CMD;
 359                        if (up_flag)
 360                                ahid->flags &= ~FLAG_POWER_FROM_FN;
 361                        else
 362                                ahid->flags |= FLAG_POWER_FROM_FN;
 363                } else if (ahid->flags & FLAG_POWER_FROM_FN) {
 364                        keycode = ADB_KEY_CMD;
 365                        ahid->flags &= ~FLAG_POWER_FROM_FN;
 366                }
 367                break;
 368        case ADB_KEY_FN:
 369                /* Keep track of the Fn key state */
 370                if (up_flag) {
 371                        ahid->flags &= ~FLAG_FN_KEY_PRESSED;
 372                        /* Emulate Fn+delete = forward delete */
 373                        if (ahid->flags & FLAG_EMU_FWDEL_DOWN) {
 374                                ahid->flags &= ~FLAG_EMU_FWDEL_DOWN;
 375                                keycode = ADB_KEY_FWDEL;
 376                                break;
 377                        }
 378                } else
 379                        ahid->flags |= FLAG_FN_KEY_PRESSED;
 380                break;
 381        case ADB_KEY_DEL:
 382                /* Emulate Fn+delete = forward delete */
 383                if (ahid->flags & FLAG_FN_KEY_PRESSED) {
 384                        keycode = ADB_KEY_FWDEL;
 385                        if (up_flag)
 386                                ahid->flags &= ~FLAG_EMU_FWDEL_DOWN;
 387                        else
 388                                ahid->flags |= FLAG_EMU_FWDEL_DOWN;
 389                }
 390                break;
 391#endif /* CONFIG_PPC_PMAC */
 392        }
 393
 394        key = adbhid[id]->keycode[keycode];
 395        if (key) {
 396                input_report_key(adbhid[id]->input, key, !up_flag);
 397                input_sync(adbhid[id]->input);
 398        } else
 399                printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode,
 400                       up_flag ? "released" : "pressed");
 401
 402}
 403
 404static void
 405adbhid_mouse_input(unsigned char *data, int nb, int autopoll)
 406{
 407        int id = (data[0] >> 4) & 0x0f;
 408
 409        if (!adbhid[id]) {
 410                printk(KERN_ERR "ADB HID on ID %d not yet registered\n", id);
 411                return;
 412        }
 413
 414  /*
 415    Handler 1 -- 100cpi original Apple mouse protocol.
 416    Handler 2 -- 200cpi original Apple mouse protocol.
 417
 418    For Apple's standard one-button mouse protocol the data array will
 419    contain the following values:
 420
 421                BITS    COMMENTS
 422    data[0] = dddd 1100 ADB command: Talk, register 0, for device dddd.
 423    data[1] = bxxx xxxx First button and x-axis motion.
 424    data[2] = byyy yyyy Second button and y-axis motion.
 425
 426    Handler 4 -- Apple Extended mouse protocol.
 427
 428    For Apple's 3-button mouse protocol the data array will contain the
 429    following values:
 430
 431                BITS    COMMENTS
 432    data[0] = dddd 1100 ADB command: Talk, register 0, for device dddd.
 433    data[1] = bxxx xxxx Left button and x-axis motion.
 434    data[2] = byyy yyyy Second button and y-axis motion.
 435    data[3] = byyy bxxx Third button and fourth button.  Y is additional
 436              high bits of y-axis motion.  XY is additional
 437              high bits of x-axis motion.
 438
 439    MacAlly 2-button mouse protocol.
 440
 441    For MacAlly 2-button mouse protocol the data array will contain the
 442    following values:
 443
 444                BITS    COMMENTS
 445    data[0] = dddd 1100 ADB command: Talk, register 0, for device dddd.
 446    data[1] = bxxx xxxx Left button and x-axis motion.
 447    data[2] = byyy yyyy Right button and y-axis motion.
 448    data[3] = ???? ???? unknown
 449    data[4] = ???? ???? unknown
 450
 451  */
 452
 453        /* If it's a trackpad, we alias the second button to the first.
 454           NOTE: Apple sends an ADB flush command to the trackpad when
 455                 the first (the real) button is released. We could do
 456                 this here using async flush requests.
 457        */
 458        switch (adbhid[id]->mouse_kind)
 459        {
 460            case ADBMOUSE_TRACKPAD:
 461                data[1] = (data[1] & 0x7f) | ((data[1] & data[2]) & 0x80);
 462                data[2] = data[2] | 0x80;
 463                break;
 464            case ADBMOUSE_MICROSPEED:
 465                data[1] = (data[1] & 0x7f) | ((data[3] & 0x01) << 7);
 466                data[2] = (data[2] & 0x7f) | ((data[3] & 0x02) << 6);
 467                data[3] = (data[3] & 0x77) | ((data[3] & 0x04) << 5)
 468                        | (data[3] & 0x08);
 469                break;
 470            case ADBMOUSE_TRACKBALLPRO:
 471                data[1] = (data[1] & 0x7f) | (((data[3] & 0x04) << 5)
 472                        & ((data[3] & 0x08) << 4));
 473                data[2] = (data[2] & 0x7f) | ((data[3] & 0x01) << 7);
 474                data[3] = (data[3] & 0x77) | ((data[3] & 0x02) << 6);
 475                break;
 476            case ADBMOUSE_MS_A3:
 477                data[1] = (data[1] & 0x7f) | ((data[3] & 0x01) << 7);
 478                data[2] = (data[2] & 0x7f) | ((data[3] & 0x02) << 6);
 479                data[3] = ((data[3] & 0x04) << 5);
 480                break;
 481            case ADBMOUSE_MACALLY2:
 482                data[3] = (data[2] & 0x80) ? 0x80 : 0x00;
 483                data[2] |= 0x80;  /* Right button is mapped as button 3 */
 484                nb=4;
 485                break;
 486        }
 487
 488        input_report_key(adbhid[id]->input, BTN_LEFT,   !((data[1] >> 7) & 1));
 489        input_report_key(adbhid[id]->input, BTN_MIDDLE, !((data[2] >> 7) & 1));
 490
 491        if (nb >= 4 && adbhid[id]->mouse_kind != ADBMOUSE_TRACKPAD)
 492                input_report_key(adbhid[id]->input, BTN_RIGHT,  !((data[3] >> 7) & 1));
 493
 494        input_report_rel(adbhid[id]->input, REL_X,
 495                         ((data[2]&0x7f) < 64 ? (data[2]&0x7f) : (data[2]&0x7f)-128 ));
 496        input_report_rel(adbhid[id]->input, REL_Y,
 497                         ((data[1]&0x7f) < 64 ? (data[1]&0x7f) : (data[1]&0x7f)-128 ));
 498
 499        input_sync(adbhid[id]->input);
 500}
 501
 502static void
 503adbhid_buttons_input(unsigned char *data, int nb, int autopoll)
 504{
 505        int id = (data[0] >> 4) & 0x0f;
 506
 507        if (!adbhid[id]) {
 508                printk(KERN_ERR "ADB HID on ID %d not yet registered\n", id);
 509                return;
 510        }
 511
 512        switch (adbhid[id]->original_handler_id) {
 513        default:
 514        case 0x02: /* Adjustable keyboard button device */
 515          {
 516                int down = (data[1] == (data[1] & 0xf));
 517
 518                switch (data[1] & 0x0f) {
 519                case 0x0:       /* microphone */
 520                        input_report_key(adbhid[id]->input, KEY_SOUND, down);
 521                        break;
 522
 523                case 0x1:       /* mute */
 524                        input_report_key(adbhid[id]->input, KEY_MUTE, down);
 525                        break;
 526
 527                case 0x2:       /* volume decrease */
 528                        input_report_key(adbhid[id]->input, KEY_VOLUMEDOWN, down);
 529                        break;
 530
 531                case 0x3:       /* volume increase */
 532                        input_report_key(adbhid[id]->input, KEY_VOLUMEUP, down);
 533                        break;
 534
 535                default:
 536                        printk(KERN_INFO "Unhandled ADB_MISC event %02x, %02x, %02x, %02x\n",
 537                               data[0], data[1], data[2], data[3]);
 538                        break;
 539                }
 540          }
 541          break;
 542
 543        case 0x1f: /* Powerbook button device */
 544          {
 545                int down = (data[1] == (data[1] & 0xf));
 546
 547                /*
 548                 * XXX: Where is the contrast control for the passive?
 549                 *  -- Cort
 550                 */
 551
 552                switch (data[1] & 0x0f) {
 553                case 0x8:       /* mute */
 554                        input_report_key(adbhid[id]->input, KEY_MUTE, down);
 555                        break;
 556
 557                case 0x7:       /* volume decrease */
 558                        input_report_key(adbhid[id]->input, KEY_VOLUMEDOWN, down);
 559                        break;
 560
 561                case 0x6:       /* volume increase */
 562                        input_report_key(adbhid[id]->input, KEY_VOLUMEUP, down);
 563                        break;
 564
 565                case 0xb:       /* eject */
 566                        input_report_key(adbhid[id]->input, KEY_EJECTCD, down);
 567                        break;
 568
 569                case 0xa:       /* brightness decrease */
 570#ifdef CONFIG_PMAC_BACKLIGHT
 571                        if (down)
 572                                pmac_backlight_key_down();
 573#endif
 574                        input_report_key(adbhid[id]->input, KEY_BRIGHTNESSDOWN, down);
 575                        break;
 576
 577                case 0x9:       /* brightness increase */
 578#ifdef CONFIG_PMAC_BACKLIGHT
 579                        if (down)
 580                                pmac_backlight_key_up();
 581#endif
 582                        input_report_key(adbhid[id]->input, KEY_BRIGHTNESSUP, down);
 583                        break;
 584
 585                case 0xc:       /* videomode switch */
 586                        input_report_key(adbhid[id]->input, KEY_SWITCHVIDEOMODE, down);
 587                        break;
 588
 589                case 0xd:       /* keyboard illumination toggle */
 590                        input_report_key(adbhid[id]->input, KEY_KBDILLUMTOGGLE, down);
 591                        break;
 592
 593                case 0xe:       /* keyboard illumination decrease */
 594                        input_report_key(adbhid[id]->input, KEY_KBDILLUMDOWN, down);
 595                        break;
 596
 597                case 0xf:
 598                        switch (data[1]) {
 599                        case 0x8f:
 600                        case 0x0f:
 601                                /* keyboard illumination increase */
 602                                input_report_key(adbhid[id]->input, KEY_KBDILLUMUP, down);
 603                                break;
 604
 605                        case 0x7f:
 606                        case 0xff:
 607                                /* keypad overlay toogle */
 608                                break;
 609
 610                        default:
 611                                printk(KERN_INFO "Unhandled ADB_MISC event %02x, %02x, %02x, %02x\n",
 612                                       data[0], data[1], data[2], data[3]);
 613                                break;
 614                        }
 615                        break;
 616                default:
 617                        printk(KERN_INFO "Unhandled ADB_MISC event %02x, %02x, %02x, %02x\n",
 618                               data[0], data[1], data[2], data[3]);
 619                        break;
 620                }
 621          }
 622          break;
 623        }
 624
 625        input_sync(adbhid[id]->input);
 626}
 627
 628static struct adb_request led_request;
 629static int leds_pending[16];
 630static int leds_req_pending;
 631static int pending_devs[16];
 632static int pending_led_start;
 633static int pending_led_end;
 634static DEFINE_SPINLOCK(leds_lock);
 635
 636static void leds_done(struct adb_request *req)
 637{
 638        int leds = 0, device = 0, pending = 0;
 639        unsigned long flags;
 640
 641        spin_lock_irqsave(&leds_lock, flags);
 642
 643        if (pending_led_start != pending_led_end) {
 644                device = pending_devs[pending_led_start];
 645                leds = leds_pending[device] & 0xff;
 646                leds_pending[device] = 0;
 647                pending_led_start++;
 648                pending_led_start = (pending_led_start < 16) ? pending_led_start : 0;
 649                pending = leds_req_pending;
 650        } else
 651                leds_req_pending = 0;
 652        spin_unlock_irqrestore(&leds_lock, flags);
 653        if (pending)
 654                adb_request(&led_request, leds_done, 0, 3,
 655                            ADB_WRITEREG(device, KEYB_LEDREG), 0xff, ~leds);
 656}
 657
 658static void real_leds(unsigned char leds, int device)
 659{
 660        unsigned long flags;
 661
 662        spin_lock_irqsave(&leds_lock, flags);
 663        if (!leds_req_pending) {
 664                leds_req_pending = 1;
 665                spin_unlock_irqrestore(&leds_lock, flags);             
 666                adb_request(&led_request, leds_done, 0, 3,
 667                            ADB_WRITEREG(device, KEYB_LEDREG), 0xff, ~leds);
 668                return;
 669        } else {
 670                if (!(leds_pending[device] & 0x100)) {
 671                        pending_devs[pending_led_end] = device;
 672                        pending_led_end++;
 673                        pending_led_end = (pending_led_end < 16) ? pending_led_end : 0;
 674                }
 675                leds_pending[device] = leds | 0x100;
 676        }
 677        spin_unlock_irqrestore(&leds_lock, flags);             
 678}
 679
 680/*
 681 * Event callback from the input module. Events that change the state of
 682 * the hardware are processed here.
 683 */
 684static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 685{
 686        struct adbhid *adbhid = input_get_drvdata(dev);
 687        unsigned char leds;
 688
 689        switch (type) {
 690        case EV_LED:
 691                leds =  (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) |
 692                        (test_bit(LED_NUML,    dev->led) ? 1 : 0) |
 693                        (test_bit(LED_CAPSL,   dev->led) ? 2 : 0);
 694                real_leds(leds, adbhid->id);
 695                return 0;
 696        }
 697
 698        return -1;
 699}
 700
 701static void
 702adbhid_kbd_capslock_remember(void)
 703{
 704        struct adbhid *ahid;
 705        int i;
 706
 707        for (i = 1; i < 16; i++) {
 708                ahid = adbhid[i];
 709
 710                if (ahid && ahid->id == ADB_KEYBOARD)
 711                        if (ahid->flags & FLAG_CAPSLOCK_TRANSLATE)
 712                                ahid->flags |= FLAG_CAPSLOCK_IGNORE_NEXT;
 713        }
 714}
 715
 716static int
 717adb_message_handler(struct notifier_block *this, unsigned long code, void *x)
 718{
 719        switch (code) {
 720        case ADB_MSG_PRE_RESET:
 721        case ADB_MSG_POWERDOWN:
 722                /* Stop the repeat timer. Autopoll is already off at this point */
 723                {
 724                        int i;
 725                        for (i = 1; i < 16; i++) {
 726                                if (adbhid[i])
 727                                        del_timer_sync(&adbhid[i]->input->timer);
 728                        }
 729                }
 730
 731                /* Stop pending led requests */
 732                while (leds_req_pending)
 733                        adb_poll();
 734
 735                /* After resume, and if the capslock LED is on, the PMU will
 736                 * send a "capslock down" key event. This confuses the
 737                 * restore_capslock_events logic. Remember if the capslock
 738                 * LED was on before suspend so the unwanted key event can
 739                 * be ignored after resume. */
 740                if (restore_capslock_events)
 741                        adbhid_kbd_capslock_remember();
 742
 743                break;
 744
 745        case ADB_MSG_POST_RESET:
 746                adbhid_probe();
 747                break;
 748        }
 749        return NOTIFY_DONE;
 750}
 751
 752static int
 753adbhid_input_register(int id, int default_id, int original_handler_id,
 754                      int current_handler_id, int mouse_kind)
 755{
 756        struct adbhid *hid;
 757        struct input_dev *input_dev;
 758        int err;
 759        int i;
 760
 761        if (adbhid[id]) {
 762                printk(KERN_ERR "Trying to reregister ADB HID on ID %d\n", id);
 763                return -EEXIST;
 764        }
 765
 766        adbhid[id] = hid = kzalloc(sizeof(struct adbhid), GFP_KERNEL);
 767        input_dev = input_allocate_device();
 768        if (!hid || !input_dev) {
 769                err = -ENOMEM;
 770                goto fail;
 771        }
 772
 773        sprintf(hid->phys, "adb%d:%d.%02x/input", id, default_id, original_handler_id);
 774
 775        hid->input = input_dev;
 776        hid->id = default_id;
 777        hid->original_handler_id = original_handler_id;
 778        hid->current_handler_id = current_handler_id;
 779        hid->mouse_kind = mouse_kind;
 780        hid->flags = 0;
 781        input_set_drvdata(input_dev, hid);
 782        input_dev->name = hid->name;
 783        input_dev->phys = hid->phys;
 784        input_dev->id.bustype = BUS_ADB;
 785        input_dev->id.vendor = 0x0001;
 786        input_dev->id.product = (id << 12) | (default_id << 8) | original_handler_id;
 787        input_dev->id.version = 0x0100;
 788
 789        switch (default_id) {
 790        case ADB_KEYBOARD:
 791                hid->keycode = kmalloc(sizeof(adb_to_linux_keycodes), GFP_KERNEL);
 792                if (!hid->keycode) {
 793                        err = -ENOMEM;
 794                        goto fail;
 795                }
 796
 797                sprintf(hid->name, "ADB keyboard");
 798
 799                memcpy(hid->keycode, adb_to_linux_keycodes, sizeof(adb_to_linux_keycodes));
 800
 801                printk(KERN_INFO "Detected ADB keyboard, type ");
 802                switch (original_handler_id) {
 803                default:
 804                        printk("<unknown>.\n");
 805                        input_dev->id.version = ADB_KEYBOARD_UNKNOWN;
 806                        break;
 807
 808                case 0x01: case 0x02: case 0x03: case 0x06: case 0x08:
 809                case 0x0C: case 0x10: case 0x18: case 0x1B: case 0x1C:
 810                case 0xC0: case 0xC3: case 0xC6:
 811                        printk("ANSI.\n");
 812                        input_dev->id.version = ADB_KEYBOARD_ANSI;
 813                        break;
 814
 815                case 0x04: case 0x05: case 0x07: case 0x09: case 0x0D:
 816                case 0x11: case 0x14: case 0x19: case 0x1D: case 0xC1:
 817                case 0xC4: case 0xC7:
 818                        printk("ISO, swapping keys.\n");
 819                        input_dev->id.version = ADB_KEYBOARD_ISO;
 820                        i = hid->keycode[10];
 821                        hid->keycode[10] = hid->keycode[50];
 822                        hid->keycode[50] = i;
 823                        break;
 824
 825                case 0x12: case 0x15: case 0x16: case 0x17: case 0x1A:
 826                case 0x1E: case 0xC2: case 0xC5: case 0xC8: case 0xC9:
 827                        printk("JIS.\n");
 828                        input_dev->id.version = ADB_KEYBOARD_JIS;
 829                        break;
 830                }
 831
 832                for (i = 0; i < 128; i++)
 833                        if (hid->keycode[i])
 834                                set_bit(hid->keycode[i], input_dev->keybit);
 835
 836                input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) |
 837                        BIT_MASK(EV_REP);
 838                input_dev->ledbit[0] = BIT_MASK(LED_SCROLLL) |
 839                        BIT_MASK(LED_CAPSL) | BIT_MASK(LED_NUML);
 840                input_dev->event = adbhid_kbd_event;
 841                input_dev->keycodemax = KEY_FN;
 842                input_dev->keycodesize = sizeof(hid->keycode[0]);
 843                break;
 844
 845        case ADB_MOUSE:
 846                sprintf(hid->name, "ADB mouse");
 847
 848                input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
 849                input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
 850                        BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
 851                input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 852                break;
 853
 854        case ADB_MISC:
 855                switch (original_handler_id) {
);
 757        struct8BIT_tf(hid->name, "ADB mouse");
);
 758        int input_dev->id.[0] = BIT_MASK(EV_KEY) |  759        int inpMASK(EV_REP);
 760
BIT_it(hid-&s/maSOUN>(input_dev->keybit);
 761        if (hid-&it(hid-&s/maMUOCK_TRANSLATEs/maMUOC"Aass="sref">input_dev->keybit);
 762              8 hid-&it(hid-&s/maVOLUMEU;
input_dev->keybit);
 763              8 retu8n -hid-&it(hid-&s/maVOLUMEPOWERDOWN:
input_dev->keybit);
 764        }
 765
 766        BIT_tf(hid->name, "ADB mouse");
 767        BIT_ut_dev->id.[0] = BIT_MASK(EV_KEY) |  768        if (!<8 href86  BIT_MASK(EV_REP);
 769              8 BIT_tt(hid-&s/maMUOCK_TRANSLATEs/maMUOC"Aass="sref">input_dev->keybit);
 770              8 goto8BIT_tt(hid-&s/maVOLUMEU;
input_dev->keybit);
 771        }
hid-&it(hid-&s/maVOLUMEPOWERDOWN:
input_dev->keybit);
 772
hid-&it(hid-&s/maBs/macNESSU;
input_dev->keybit);
 773        hid-&it(hid-&s/maBs/macNESSPOWERDOWN:
input_dev->keybit);
 774
printkit(hid-&s/maEJECTC>(input_dev->keybit);
 775        inpit(hid-&s/maSWITCHVIDEOMODCK_TRANSLATEs/maSWITCHVIDEOMODC"Aass="sref">input_dev->keybit);
 776        BIT_tt(hid-&s/maKBDILLUMTOGG) | input_dev->keybit);
 777        BIT_tt(hid-&s/maKBDILLUMPOWERDOWN:
input_dev->keybit);
 778        inptt(hid-&s/maKBDILLUMU;
input_dev->keybit);
 779         780         781        hid->keyco, &quontos/adbhid.c#L831" id="L831" class="line" name="L778"> 782         783         784         785         786        sprin(KERN_INFO "Detected ADB keyboard, typeD on ID %\n");
 787        sprin -ENOMEM 788
fail;
 789        switch8( 790        case <8 href89ntosh/adbhid.c#L801" id="L801" class="line" name="L798"> 791              8 i->keycodes
hid->keycode[50];
 792              8 if (89ntosh/adbhid.c#L773" id="L773" class="line"8name="L798"> 793              8     89=input_dev" class="sref">inp -i37\n&quo_allocate_device();
KERut_dev) {
 794              8     8   goto hid-& - 795              8 }
fail;
 796
 797              8 hid-&fault_id << 8) | ADB_KEYBa> << 8) drivers/macintososh/adbhid.c#L8a href="+856" class="line" name="L798"> 798
 799              8  800
 801              9 printkut_dev->relbit

->
relbitREP_DELA 792 9 swit9h (printkut_dev->relbit

->
relbitREP_PERIOBa> << 8) REP_PERIOB&quo" cl66;cler resume, and if the ca+code layercacintosh 33 *acintosh/adbhid.c#L740" id="L740" class="line"9n3me="L809"> 793 9 defa9lt: 804 9 90ntosh/adbhid.c#L845" id="L845" class="line"9name="L809"> 805 9 9 806 9 90ntosh/adbhid.c#L797" id="L797" class="line"9name="L809"> 807 fail; printkut_devfret_allocate_device(); KERut_dev) { 808 9 case90+code=hid" class=sref">hid-> 809 9 case90x0C: case 0x10: case ss="sref">keycodfret50]; hid->namede) { 810 9 case90xC0: case 0xC3: case ss="sref">keycodfret50]; hid-> 811 9 91vers/macintosh/adbhid.c#L772" id="L772" class="line"9name="L819"> 812 9 91=input_dev" class="sref">inpass="lrelbithid =NUL) | 813 9 9 break; hid-& - 814 815 9 case91ntosh/adbhid.c#L836" id="L836" class="line"9name="L819"> 816 9 case90x11: static voidevent" class="sref">adbriversun37\n&quoprintkua href="+code=hid" clas/adbhid.c#L831" id="L831" class="line"9name="L819"> 817 9 case90xC4: h/adbhid.c#L8a href="+856" class="line"9name="L819"> 818 9 91=hid" class="sref">hid-&riversun37\n&quo_allocate_device(); hid-&ass="lrelbitinput = 819 9 91=hid" class="sref">hid-&dfret50]; hid-&ass="lrelbitinput) { 820 9 92=hid" class="sref">hid-&dfret50]; hid-&ass="lrelbit 821 9 92=input_set_drvdata" class="sass="lrelbithid =NUL) | 822 9 9 823 9 92ntosh/adbhid.c#L854" id="L854" class="line"9name="L829"> 824 825 9 case90x12: static sref">hid =u"> 816 href=u1ntosh/adbhid.c#L797" id="L797" class="line"9name="L829"> 826 9 case90x1E: vent" class="sref">adbriversre37\n&quoprintkua href="+code=hid" cla, 836gs="sref">printkfault_id, printkorgriginal_handler_id) { 827 9 9 printkcururrent_handler_id; printkm 828 9 9 829 9 9 break; hid-&ass="lrelbit 830 9 } hid-&ass="lrelbitinput = id.product = ( 831 id << 12) | (default_id << 8) | printkorgriginal_handler_id) { 832 9 for 9printkua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"9name="L839"> 833 9 9 if (adbriversre\n&quoprintkua href="+code=hid" clat;Aass="sref">inpfault_id, printkorgriginal_handler_id) { 834 9 9 printkm 835 836 9 837 9 9 adbriversre\n&quoprintkua href="+code=hid" clat;Aass="sref">inpfault_id, printkorgriginal_handler_id) { 838 9 printkm 839 9 9 printkua href="+code=hid" clah/adbhid.c#L795" id="L795" class="line"9name="L849"> 840 9 841 9 842 9 843 9 brea9; adbriversdevcleanup>->adbriversdevcleanupass="s="sref">printku"> 816 href=u1ntoshasref">hid-& xn&qa href="+code=ENxn&q clas/adbhid.c#L831" id="L831" class="line"9name="L849"> 844 845 case <9 href9"+code=ADB_MOU836gs="sref">printku href="+code=hid clah/adbhid.c#L795" id="L795" class="line"9name="L839"> 846 9 i = 0; i++) i++) 847 hid-&ass="lrelbithid-& xn&qa href="+code=ENxn&q cla&(1e=origins="sref">printkuhref="drivers/macint))h/adbhid.c#L833" id="L833" class="line"9name="L829"> 848 9 adbriversun37\n&quoprintkuhref="drivers/macint)h/adbhid.c#L795" id="L795" class="line"9name="L829"> 849 9 850 9 95ntosh/adbhid.c#L801" id="L801" class="line"9name="L859"> 851 9 852 9 brea9; adbde=bt50]; adbde=btass="voidh/adbhid.c#L833" id="L833" class="line"9name="L859"> 853 854 case <9 href9"+code=ADB_MISstruc6gs="sref">printkasssreque&qa href="+code=Easssreque&qtoshasref">hid-&reqa href="+code=Ereq clah/adbhid.c#L795" id="L795" class="line"9name="L859"> 855 9 swit95+code=ADB_MOU836gs="sref">printku href="+code=hid clat;Aass="sref">inpfault_id, printkorgriginal_handler_id) { printku"> 816 href=u1ntoshasref">hid-&37\a href="+code=Eregtosha=ash/adbhid.c#L788" id="L788" class="line"9name="L759"> 757 struct9 758 int hid-&asssre\n&quoprintk_MOUSE: printkm="dr/max_keycodes))m="dr/maxcint,avent" class="sref">adbm="dr/m> = adbm="dr/m> = cint)h/adbhid.c#L795" id="L795" class="line"9name="L849"> 759 int hid-&asssre\n&quoprintk_MOUADB_KEYBa> << 8) drivers/macintos, 0, &s="sref">printk>); ))>); adb>); = adb>); = cint)h/adbhid.c#L795" id="L795" class="line"9name="L769"> 760 hid-&asssre\n&quoprintk_MOUS/a>: printkbuttons/max_keycodes))buttons/maxcint,avent" class="sref">adbbuttons/m> = adbbuttons/m> = cint)h/adbhid.c#L795" id="L795" class="line"9name="L859"> 761 if ( 762 9 i = 0; i < 128; printk>); ))>); produnmax_keycodes))nmaxcintsref">i++) 763 9 retu9n -printkua href="+code=hid" clas="sref">hid =>); ))>); produua href="+code=hid" clans="sref">relbit 764 } 765 hid-&asssgeiginfox_keycodes))asssgeiginfoxass="s="sref">printkua href="+code=hid" clat;&s="sref">printkfault_id, printkorgriginal_handler_id) { 766 767 768 if (!<9 href96 printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos,a3,/adbhid.c#L797" id="L796" class="line"9name="L849"> 769 9 printkers/WRITEREG: printkua href="+code=hid" clat;Aass="sref">inpers/s/maREG: 770 9 goto97ntosh/adbhid.c#L801" id="L801" class="line"9name="L779"> 771 } ); 772 insns="sleft riv right shift,cintosh/adbhid.c#L740" id="L740" class="line"9name="L859"> 773 774 insns="sR modifi" i *acintosh/adbhid.c#L740" id="L740" class="line"9name="L769"> 775 hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;5)h/adbhid.c#L833" id="L833" class="line"9name="L769"> 776 BIT_("JIS.\n"); ); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"9name="L769"> 777 778 779 hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;3)h/adbhid.c#L833" id="L833" class="line"9name="L789"> 780 BIT_("JIS.\n"); ); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"9name="L789"> 781 782 BIT_("JIS.\n"); ); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"9name="L859"> 783 784 hid-&asssgeiginfox_keycodes))asssgeiginfoxass="s="sref">printkua href="+code=hid" clat;&s="sref">printkfault_id, printkcururrent_handler_id; 785 hid-&37\a href="+code=Eregtosha|_event" class="sref">adbriversre37\n&quoprintkua href="+code=hid" clat;Aass="sref">inpfault_id, printkorgriginal_handler_id) { 786 787 788 789 switch9(i = 0; i < 128; printkbuttons/max_keycodes))buttons/maxcintass="sref">produnmax_keycodes))nmaxcintsref">i++) 790 case <9 href99ref="drivers/macintosa36gs="sref">printkua href="+code=hid" clas="sref">hid =buttons/max_keycodes))buttons/maxcintass="sref">produua href="+code=hid" clans="sref">relbit 791 9 792 9 if (99 (printkasssgeiginfox_keycodes))asssgeiginfoxass="s="sref">printkua href="+code=hid" clat;&s="sref">printkfault_id, printkorgriginal_handler_id) { 793 9 99 -hid-&37\a href="+code=Eregtosha|_event" class="sref">adbriversre37\n&quoprintkua href="+code=hid" clat;Aass="sref">inpfault_id, printkorgriginal_handler_id) { 794 9 99 795 9 } 796 797 9 798 799 9 i = 0; i < 128; printkm="dr/max_keycodes))m="dr/maxcintass="sref">produnmax_keycodes))nmaxcintsref">i++) printkua href="+code=hid" clas="sref">hid =m="dr/max_keycodes))m="dr/maxcintass="sref">produua href="+code=hid" clans="sref">relbitadbhid.c#L8a href="+856" class="line"10n1me="L8010n> 791 10n> >10n printkm="dr/kina href="+code=him="dr/kinacints/adbhid.c#L8a href="+856" class="line"10n2me="L8010n> 792 10n> >10nntosh/adbhid.c#L773" id="L773" class="line"10n3me="L8010n> 793 10n> >10n -hid-&asssgeiginfox_keycodes))asssgeiginfoxass="s="sref">printkua href="+code=hid" clat;&s="sref">printkfault_id, printkorgriginal_handler_id) { hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;4)osh/adbhid.c#L8a href="+856" class="line"10n6me="L8010n> 796 BIT_("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"10n7me="L8010n> 797 10n> >10n BIT_m="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_EXTENDEBa> << 8) dri/maci_EXTENDEBcints/adbhid.c#L8a href="+856" class="line"10n8me="L8010n> 798 hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;0x2F)osh/adbhid.c#L8a href="+856" class="line"101ame="L8010"> 810 10"> >10"> break; BIT_("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1011me="L8010"> 811 10"> >10" hid-&m="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_MICROSPEEBa> << 8) dri/maci_MICROSPEEBcints/adbhid.c#L8a href="+856" class="line"1012me="L8010"> 812 10"> >10" ( 813 10"> >10" -hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;0x42)osh/adbhid.c#L8a href="+856" class="line"1014me="L8010"> 814 >10" printk("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1015me="L8010"> 815 10"> >10" inpm="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_TRACKBALLPRa> 816 10"> >10" break; 817 10"> >10" hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;0x66)osh/adbhid.c#L8a href="+856" class="line"1018me="L8010"> 818 10"> >10"f="+code=input_dev" code=BIT_vent" class="sr("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1019me="L8010"> 819 10"> >10"f="+code=err" class="vers/macass="sref">BIT_m="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_MICROSPEEBa> << 8) dri/maci_MICROSPEEBcints/adbhid.c#L8a href="+856" class="line"102ame="L8010"> 820 10"> >10"> break; 821 10"> >10" hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;0x5F)osh/adbhid.c#L8a href="+856" class="line"1022me="L8010"> 822 10"> >10"f="+code=printk" clas class="ass="sref">BIT_("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1023me="L8010"> 823 10"> >10" if (hid =spa/maci_MICROSPEEBa> << 8) dri/maci_MICROSPEEBcints/adbhid.c#L8a href="+856" class="line"1024me="L8010"> 824 >10" 825 10"> >10" hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;3)osh/adbhid.c#L8a href="+856" class="line"1026me="L8010"> 826 10"> >10" break; BIT_("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1027me="L8010"> 827 10"> >10" BIT_m="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_MS_A3a> << 8) dri/maci_MS_A3cints/adbhid.c#L8a href="+856" class="line"1028me="L8010"> 828 10"> >10" 829 10"> >10" break; hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;2)osh/adbhid.c#L8a href="+856" class="line"103ame="L8010"> 830 10"> >10"> break; BIT_("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1031me="L8010"> 831 >10" hid-&m="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_STANDARD_2name99 t; 8) dri/maci_STANDARD_2nacints/adbhid.c#L8a href="+856" class="line"1032me="L8010"> 832 10"> >10" ( 833 10"> >10" - 834 10"> >10" printk("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1035me="L8010"> 835 >10" inpm="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_STANDARD_1name99 t; 8) dri/maci_STANDARD_1nacints/adbhid.c#L8a href="+856" class="line"1036me="L8010"> 836 10"> >10" break; 837 10"> >10"ntosh/adbhid.c#L848" id="L848" class="line"10"8me="L8010"> 838 10"> >10" printkm="dr/kina href="+code=him="dr/kinacints=="sref">hid =spa/maci_TRACKBALLPRa> 839 10"> >10"f="+code=err" class="vers||s=sref">hid-&m="dr/kina href="+code=him="dr/kinacints=="sref">hid =spa/maci_MICROSPEEBa> << 8) dri/maci_MICROSPEEBcint)osh/adbhid.c#L8a href="+856" class="line"104ame="L8010"> 840 10"> >10"> inpinit_microspeea href="+code=hidnit_microspeeaass="s="sref">printkua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1041me="L8010"> 841 10"> >10" hid-&m="dr/kina href="+code=him="dr/kinacints=="sref">hid =spa/maci_MS_A3a> << 8) dri/maci_MS_A3cintosh/adbhid.c#L8a href="+856" class="line"1042me="L8010"> 842 10"> >10"f="+code=printk" clas class="ass="sref">BIT_dnit_ms_a3a> << 8) dnit_ms_a3ass="s="sref">printkua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1043me="L8010"> 843 10"> >10" -hid-&m="dr/kina href="+code=him="dr/kinacints==""sref">hid =spa/maci_EXTENDEBa> << 8) dri/maci_EXTENDEBcintosh/adbhid.c#L8a href="+856" class="line"1044me="L8010"> 844 >10" 845 case <10"> >10"5="+cler resume, and if theode=input_ddddddddddddddd* R7\n"1 is usually usedas="sallocaasntosh/adbhid.c#L740" id="L740" class="line"10"6me="L8010"> 846 10"> >10"6="+cler resume, and if theode=input_ddddddddddddddd* idf tification. Here, we try/ &#idf tifycintosh/adbhid.c#L740" id="L740" class="line"10"7me="L8010"> 847 >10"7="+cler resume, and if theode=input_ddddddddddddddd* a 848 10"> >10"f="+cler resume, and if theode=input_ddddddddddddddd* init function.asntosh/adbhid.c#L740" id="L740" class="line"10"9me="L8010"> 849 10"> >10"f="+cler resume, and if theode=input_dev" c dddddddd*acintosh/adbhid.c#L740" id="L740" class="line"105ame="L8010"> 850 10"> >10">="+code=printk" clas class="ass="sref">BIT_asssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos |avent" class="srersREQ_REPL 851 10"> >10" BIT_ers/REAaREG: printkua href="+code=hid" clat;1)sh/adbhid.c#L795" id="L795" class="line"1052me="L8010"> 852 10"> >10"ntosh/adbhid.c#L773" id="L773" class="line"1053me="L8010"> 853 >10" if (printkreqa href="+code=Ereq claass="sref">produreply_lena href="+code=Ereply_lencintos&&/adbhid.c#L773" id="L773" class="line"1054me="L8010"> 854 case <10"> >10" printkreqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[1]s=="0x9aos&&s="s="sref">printkreqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[2]s=="0x21h/adbhid.c#L833" id="L833" class="line"1055me="L8010"> 855 10"> >10" hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[2]s=="0x20))osh/adbhid.c#L8a href="+856" class="line"1056me="L8010 /macintosh/adbhid.c#L10 >10"f="+code=sprintf" claaaaaaaaaaaaaaaaalass="sref">inpm="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_TRACKBALL> 757 struct10"> >10" inpdnit_trackballa> << 8) dnit_trackballass="s="sref">printkua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1058me="L8010"> 758 int >10"f="+code=input_dev" code=BIT_h/adbhid.c#L796" id="L796" class="line"1059me="L8010"> 759 int >10"f="+code=err" class="vers/macelse ass="s="sref">printkreqa href="+code=Ereq claass="sref">produreply_lena href="+code=Ereply_lencint s="s= 4os&&/adbhid.c#L773" id="L773" class="line"106ame="L8010"> 760 >10"> printkreqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[1]s=="0x74os&&s=sref">hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[2]s=="0x70os&&/adbhid.c#L773" id="L773" class="line"1061me="L8010"> 761 if ( >10" hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[3]s=="0x61os&&s=sref">hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[4]s=="0x64)osh/adbhid.c#L8a href="+856" class="line"1062me="L8010"> 762 10"> >10"f="+code=printk" clas class="aaaaaaaalass="sref">inpm="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_TRACKPABa> << 8) dri/maci_TRACKPABcints/adbhid.c#L8a href="+856" class="line"1063me="L8010"> 763 10"> >10" if (inpdnit_trackpaa href="+code=hidnit_trackpaaass="s="sref">printkua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1064me="L8010"> 764 } >10" 765 >10" printkreqa href="+code=Ereq claass="sref">produreply_lena href="+code=Ereply_lencint s="s= 4os&&/adbhid.c#L773" id="L773" class="line"1066me="L8010"> 766 >10"f="+code=sprintf" claaaaaaaaaaaaa"s="sref">printkreqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[1]s=="0x4bos&&s=sref">hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[2]s=="0x4dos&&/adbhid.c#L773" id="L773" class="line"1067me="L8010"> 767 >10" hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[3]s=="0x4cos&&s=sref">hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[4]s=="0x31)osh/adbhid.c#L8a href="+856" class="line"1068me="L8010"> 768 if (!<10"> >10"f="+code=input_dev" cbit" cla+code=hilass="sref">inpm="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_TURBO/maci5a> << 8) dri/maci_TURBO/maci5cints/adbhid.c#L8a href="+856" class="line"1069me="L8010"> 769 10"> >10"f="+code=err" class="vers/macinpue=hilass="sref">inpdnit_turbom="dr href="+code=hidnit_turbom="drass="s="sref">printkua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"107ame="L8010"> 770 10"> >10"> 771 } >10" printkreqa href="+code=Ereq claass="sref">produreply_lena href="+code=Ereply_lencint =="9os&&/adbhid.c#L773" id="L773" class="line"1072me="L8010"> 772 >10"f="+code=printk" clas class="aaaa"s="sref">printkreqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[1]s=="0x4bos&&s=sref">hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[2]s=="0x4fos&&/adbhid.c#L773" id="L773" class="line"1073me="L8010"> 773 >10" if (hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[3]s=="0x49os&&s=sref">hid-&reqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[4]s=="0x54)osh/adbhid.c#L8a href="+856" class="line"1074me="L8010"> 774 >10" hid-&ass_try"drivers/cdrigt50]; printkua href="+code=hid" clat;0x42)osh/adbhid.c#L8a href="+856" class="line"1075me="L8010"> 775 >10" printk("JIS.\n"); inpua href="+code=hid" clash/adbhid.c#L795" id="L795" class="line"1076me="L8010"> 776 >10"f="+code=sprintf" claaaaaaaaaaaaaaaaaaaaaaaaalass="sref">inpm="dr/kina href="+code=him="dr/kinacints="sref">hid =spa/maci_MACALLY2a> << 8) dri/maci_MACALLY2cints/adbhid.c#L8a href="+856" class="line"1077me="L8010"> 777 >10" 778 >10"f="+code=input_dev" code=BIT_h/adbhid.c#L796" id="L796" class="line"1079me="L8010"> 779 >10"f="+code=err" class="h/adbhid.c#L796" id="L796" class="line"108ame="L8010"> 780 >10">="+code=err" class="s="sref">printk("JIS.\n"); 781 >10"ntosh/adbhid.c#L832" id="L832" class="line"10"2me="L8010"> 782 >10" (printkasssgeiginfox_keycodes))asssgeiginfoxass="s="sref">printkua href="+code=hid" clat;&s="sref">printkfault_id, printkcururrent_handler_id; 783 >10" -hid-&37\a href="+code=Eregtosha|_event" class="sref">adbriversre37\n&quoprintkua href="+code=hid" clat;Aass="sref">inpfault_id, printkorgriginal_handler_id) { 784 >10" printkm="dr/kina href="+code=him="dr/kinacintsh/adbhid.c#L795" id="L795" class="line"10"5me="L8010"> 785 >10"ref="drivers/h/adbhid.c#L796" id="L796" class="line"10"6me="L8010"> 786 >10""+856" ce 0xCs="sref">printkass="lbriversdevcleanup>->adbriversdevcleanupass="s="sref">printk37\a href="+code=Eregtoshsh/adbhid.c#L795" id="L795" class="line"10"7me="L8010"> 787 >10" 788 >10" 789 switch10"> >10"f="+cstatic void /adbhid.c#L796" id="L796" class="line"109ame="L8010"> 790 case <10"> >10">="+class="sref">inpdnit_trackpaa href="+code=hidnit_trackpaaass="a36gs="sref">printkua href="+code=hid" clah/adbhid.c#L833" id="L833" class="line"1091me="L8010"> 791 10"> >10"ntoshh/adbhid.c#L8a href="+856" class="line"1092me="L8010"> 792 10"> >10" (printkasssreque&qa href="+code=Easssreque&qtoshasref">hid-&reqa href="+code=Ereq clah/adbhid.c#L795" id="L795" class="line"10"3me="L8010"> 793 10"> >10" -hid-&r1_buffuo 794 10"> >10"ntosh/adbhid.c#L825" id="L825" class="line"1095me="L8010"> 795 10"> >10"5+856" ce 0xCs="sref">printk("JIS.\n"); 796 >10"ntosh/adbhid.c#L797" id="L797" class="line"10"7me="L8010"> 797 10"> >10"7+856" ce 0xCs="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos |avent" class="srersREQ_REPL 798 >10"f="+code=input_dev" code=vent" class="srers/REAaREG: printkua href="+code=hid" clat1)sh/adbhid.c#L795" id="L795" class="line"1099me="L8010"> 799 10"> >10"f="+code=err"ass=sref">hid-&reqa href="+code=Ereq claass="sref">produreply_lena href="+code=Ereply_lencint sclas8h/adbhid.c#L833" id="L833" class="line"11name="L8011name99 11nam>11naef="drivers/macis="sref">printk("JIS.\n"); printkmemcpya href="+code=Ememcpyass="s="sref">printk31_buffuoprintkreqa href="+code=Ereq claass="sref">produreplya href="+code=Ereply cla[1],s8hh/adbhid.c#L795" id="L795" class="line"11n4me="L8011n> 794 11n> >11nntosh/adbhid.c#L825" id="L825" class="line"11n5me="L8011n> 795 11n> >11n printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 9,/adbhid.c#L797" id="L797" class="line"11n6me="L8011n> 796 printkua href="+code=hid" clat1),/adbhid.c#L797" id="L797" class="line"11n7me="L8011n> 797 11n> >11n hid-&r1_buffuo >11n hid-&r1_buffuohid-&r1_buffuo 810 11"> >11"> break; hid-&r1_buffuo 811 11"> >11" hid-&r1_buffuo 812 11"> >11" (hid-&r1_buffuo 813 11"> >11" - 814 >11" hid-&r1_buffuo 815 11"> >11" 816 11"> >11" break; printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 9,/adbhid.c#L797" id="L797" class="line"1117me="L8011"> 817 11"> >11" printkua href="+code=hid" clat2),/adbhid.c#L797" id="L797" class="line"1118me="L8011"> 818 11"> >11"f="+code=input_dev" code=0x99,/adbhid.c#L797" id="L797" class="line"1119me="L8011"> 819 11"> >11"f="+code=err" class="vers0x94,/adbhid.c#L797" id="L797" class="line"112ame="L8011"> 820 11"> >11"> break; 821 11"> >11" 822 11"> >11"f="+code=printk" clas cla0xb2,/adbhid.c#L797" id="L797" class="line"1123me="L8011"> 823 11"> >11" if ( 824 >11" 825 11"> >11" 826 11"> >112ntosh/adbhid.c#L797" id="L797" class="line"1127me="L8011"> 827 11"> >11" printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 9,/adbhid.c#L797" id="L797" class="line"1128me="L8011"> 828 11"> >11" printkua href="+code=hid" clat1),/adbhid.c#L797" id="L797" class="line"1129me="L8011"> 829 11"> >11" break; 830 11"> >11"> break; hid-&r1_buffuo 831 >11" hid-&r1_buffuo 832 11"> >11" (hid-&r1_buffuo 833 11"> >11" -hid-&r1_buffuo 834 11"> >11" hid-&r1_buffuo 835 >11" 836 11"> >11" break; hid-&r1_buffuo 837 11"> >11"ntosh/adbhid.c#L848" id="L848" class="line"11"8me="L8011"> 838 11"> >11" 839 11"> >11"f="+code=err" clas="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 1,avent" class="srers_FLUSH: printkua href="+code=hid" cla)sh/adbhid.c#L795" id="L795" class="line"114ame="L8011"> 840 11"> >11"> 841 11"> >11" 842 11"> >114ntosh/adbhid.c#L773" id="L773" class="line"1143me="L8011"> 843 11"> >11" - 844 >11" inpdnit_trackballa> << 8) dnit_trackballass="a36gs="sref">printkua href="+code=hid" clah/adbhid.c#L833" id="L833" class="line"11"5me="L8011"> 845 case <11"> >11"5="+ch/adbhid.c#L8a href="+856" class="line"11"6me="L8011"> 846 11"> >114 break; printkasssreque&qa href="+code=Easssreque&qtoshasref">hid-&reqa href="+code=Ereq clah/adbhid.c#L795" id="L795" class="line"11"7me="L8011"> 847 >114ntosh/adbhid.c#L848" id="L848" class="line"11"8me="L8011"> 848 11"> >114 printk("JIS.\n"); 849 11"> >11"f="+c/adbhid.c#L795" id="L795" class="line"115ame="L8011"> 850 11"> >11">="+code=prins="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"11"1me="L8011"> 851 11"> >11" printkua href="+code=hid" clat1), 00,0x81sh/adbhid.c#L795" id="L795" class="line"1152me="L8011"> 852 11"> >11"ntosh/adbhid.c#L773" id="L773" class="line"1153me="L8011"> 853 >11" if (printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"11"4me="L8011"> 854 case <11"> >11" printkua href="+code=hid" clat1), 01,0x81sh/adbhid.c#L795" id="L795" class="line"1155me="L8011"> 855 11"> >115 printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"11"7me="L8011"> 757 struct11"> >1157+856" ce 0xCs="sref">printkers/WRITEREG: printkua href="+code=hid" clat1), 02,0x81sh/adbhid.c#L795" id="L795" class="line"1158me="L8011"> 758 int >115 759 int >11"f="+code=err"s="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"116ame="L8011"> 760 >116>="+code=prins="sref">printkers/WRITEREG: printkua href="+code=hid" clat1), 03,0x38hh/adbhid.c#L795" id="L795" class="line"1161me="L8011"> 761 if ( >116ntosh/adbhid.c#L832" id="L832" class="line"1162me="L8011"> 762 11"> >11"f="+code=prins="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"1163me="L8011"> 763 11"> >116 if (printkers/WRITEREG: printkua href="+code=hid" clat1), 00,0x81sh/adbhid.c#L795" id="L795" class="line"1164me="L8011"> 764 } >116ntosh/adbhid.c#L825" id="L825" class="line"1165me="L8011"> 765 >1165+856" ce 0xCs="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"1166me="L8011"> 766 >116"+856" ce 0xCs="sref">printkers/WRITEREG: printkua href="+code=hid" clat1), 01,0x81sh/adbhid.c#L795" id="L795" class="line"1167me="L8011"> 767 >116ntosh/adbhid.c#L848" id="L848" class="line"1168me="L8011"> 768 if (!<11"> >116 printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"1169me="L8011"> 769 11"> >116f="+code=err"s="sref">printkers/WRITEREG: printkua href="+code=hid" clat1), 02,0x81sh/adbhid.c#L795" id="L795" class="line"117ame="L8011"> 770 11"> >11"> /adbhid.c#L795" id="L795" class="line"1171me="L8011"> 771 } >117 printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"1172me="L8011"> 772 >117f="+code=prins="sref">printkers/WRITEREG: printkua href="+code=hid" clat1), 03,0x38hh/adbhid.c#L795" id="L795" class="line"1173me="L8011"> 773 >11" if h/adbhid.c#L796" id="L796" class="line"1174me="L8011"> 774 >117ntosh/adbhid.c#L825" id="L825" class="line"1175me="L8011"> 775 >11" 776 >11"f="+class="sref">inpdnit_turbom="dr href="+code=hidnit_turbom="drass="a36gs="sref">printkua href="+code=hid" clah/adbhid.c#L833" id="L833" class="line"1177me="L8011"> 777 >11" 778 >11"f="+code=inpustruc6gs="sref">printkasssreque&qa href="+code=Easssreque&qtoshasref">hid-&reqa href="+code=Ereq clah/adbhid.c#L795" id="L795" class="line"1179me="L8011"> 779 >117f="+c/adbhid.c#L795" id="L795" class="line"118ame="L8011"> 780 >118>="+code=prins="sref">printk("JIS.\n"); 781 >11"ntosh/adbhid.c#L832" id="L832" class="line"11"2me="L8011"> 782 >118f="+code=prins="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 1,avent" class="srers_FLUSH: printkua href="+code=hid" cla)sh/adbhid.c#L795" id="L795" class="line"11"3me="L8011"> 783 >11" - 784 >118 printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 1,avent" class="srers_FLUSH: 785 >118 786 >11""+856" ce 0xCs="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 9,/adbhid.c#L797" id="L797" class="line"11"7me="L8011"> 787 >1187+856" ce 0xCs="sref">printkers/WRITEREG: 788 >118 789 switch11"> >118f="+code=err" cla0x8c,/adbhid.c#L797" id="L797" class="line"119ame="L8011"> 790 case <11"> >119> break; 791 11"> >119 792 11"> >119 ( 793 11"> >119 - 794 11"> >119 795 11"> >119 796 >11"ntosh/adbhid.c#L797" id="L797" class="line"11"7me="L8011"> 797 11"> >11"7+856" ce 0xCs="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 1,avent" class="srers_FLUSH: 798 >119 799 11"> >119f="+code=err"s="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 9,/adbhid.c#L797" id="L797" class="line"12name="L8012name99 12nam>120>="+code=prins="sref">printkers/WRITEREG: >12n break; >12n 810 12"> >121> /adbhid.c#L795" id="L795" class="line"1211me="L8012"> 811 12"> >12" 812 12"> >12" (inpdnit_microspeea href="+code=hidnit_microspeeaass="a36gs="sref">printkua href="+code=hid" clah/adbhid.c#L833" id="L833" class="line"1213me="L8012"> 813 12"> >12" - 814 >12" printkasssreque&qa href="+code=Easssreque&qtoshasref">hid-&reqa href="+code=Ereq clah/adbhid.c#L795" id="L795" class="line"1215me="L8012"> 815 12"> >12" 816 12"> >121"+856" ce 0xCs="sref">printk("JIS.\n"); 817 12"> >121ntosh/adbhid.c#L848" id="L848" class="line"1218me="L8012"> 818 12"> >121 printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 1,avent" class="srers_FLUSH: printkua href="+code=hid" cla)sh/adbhid.c#L795" id="L795" class="line"1219me="L8012"> 819 12"> >121f="+c/adbhid.c#L795" id="L795" class="line"122ame="L8012"> 820 12"> >12"> break; tha/Microspeea, MacPoa36ganacintosh/adbhid.c#L740" id="L740" class="line"1221me="L8012"> 821 12"> >12" 822 12"> >12"f="+cler resume, and if theode=input_dasntosh/adbhid.c#L740" id="L740" class="line"1223me="L8012"> 823 12"> >12" if ler resume, and if theode=input_dR7\n"1 Ln&qun (4 Bytes)asntosh/adbhid.c#L740" id="L740" class="line"1224me="L8012"> 824 >12" !!!)asntosh/adbhid.c#L740" id="L740" class="line"1225me="L8012"> 825 12"> >1225="+cler resume, and if theode=input_dd4 - 7ut_deButtonnis lockan> (affects cdrigt speeaaalso)asntosh/adbhid.c#L740" id="L740" class="line"1226me="L8012"> 826 12"> >1226="+cler resume, and if theode=input_dd8 - 11ut_deButtonncdrigts speeaasntosh/adbhid.c#L740" id="L740" class="line"1227me="L8012"> 827 12"> >1227="+cler resume, and if theode=input_d12 e=input_d1 = Extended m="dr mint,e0 = normal m="dr mintasntosh/adbhid.c#L740" id="L740" class="line"1228me="L8012"> 828 12"> >122f="+cler resume, and if theode=input_d13 - 15put_dun"drd 0asntosh/adbhid.c#L740" id="L740" class="line"1229me="L8012"> 829 12"> >122f="+cler resume, and if theode=input_d16 - 23ut_denormal speeaasntosh/adbhid.c#L740" id="L740" class="line"123ame="L8012"> 830 12"> >12"> breler resume, and if theode=input_d24 - 31ut_decdrigtd speeaasntosh/adbhid.c#L740" id="L740" class="line"1231me="L8012"> 831 >123ntosh/adbhid.c#L832" id="L832" class="line"1232me="L8012"> 832 12"> >123f="+cler resume, and if theode=inpR7\n"1 talk holds 2" iionnana produc6gidf tificationninformation.asntosh/adbhid.c#L740" id="L740" class="line"1233me="L8012"> 833 12"> >123 if ler resume, and if theode=inpR7\n"1 Talk (4 Bytes):asntosh/adbhid.c#L740" id="L740" class="line"1234me="L8012"> 834 12"> >123 835 >1235="+cler resume, and if theode=input_dd8 - 23ut_deundefa ha, reserveaasntosh/adbhid.c#L740" id="L740" class="line"1236me="L8012"> 836 12"> >1236="+cler resume, and if theode=input_d24 - 31ut_deV" iionnnumbuo cntosh/adbhid.c#L740" id="L740" class="line"1237me="L8012"> 837 12"> >1237="+cler resume, and if theode=inpu cntosh/adbhid.c#L740" id="L740" class="line"1238me="L8012"> 838 12"> >123f="+cler resume, and if theode=inpSpeeaa0nis max.t1 to 255 setaspeeaainnincreif ts of 1/256 of max. cntosh/adbhid.c#L740" id="L740" class="line"1239me="L8012"> 839 12"> >123f="+cler resume, and if theo*acintosh/adbhid.c#L740" id="L740" class="line"124ame="L8012"> 840 12"> >124>="+code=prins="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 5,/adbhid.c#L797" id="L797" class="line"1241me="L8012"> 841 12"> >124 printkua href="+code=hid" clat1),/adbhid.c#L797" id="L797" class="line"1242me="L8012"> 842 12"> >124 ( 843 12"> >124 - 844 >124 845 case <12"> >124 846 12"> >124ntosh/adbhid.c#L797" id="L797" class="line"12"7me="L8012"> 847 >124ntosh/adbhid.c#L848" id="L848" class="line"12"8me="L8012"> 848 12"> >124 printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 1,avent" class="srers_FLUSH: printkua href="+code=hid" cla)sh/adbhid.c#L795" id="L795" class="line"12"9me="L8012"> 849 12"> >124 breh/adbhid.c#L796" id="L796" class="line"125ame="L8012"> 850 12"> >125> /adbhid.c#L795" id="L795" class="line"12"1me="L8012"> 851 12"> >125 852 12"> >125 (inpdnit_ms_a3 href="+code=hidnit_ms_a3ass="a36gs="sref">printkua href="+code=hid" clah/adbhid.c#L833" id="L833" class="line"1253me="L8012"> 853 >125 - 854 case <12"> >125 printkasssreque&qa href="+code=Easssreque&qtoshasref">hid-&reqa href="+code=Ereq clah/adbhid.c#L795" id="L795" class="line"1255me="L8012"> 855 12"> >125 printk("JIS.\n"); 757 struct12"> >1257+856" ce 0xCs="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 3,/adbhid.c#L797" id="L797" class="line"1258me="L8012"> 758 int >125 printkers/WRITEREG: printkua href="+code=hid" clat=0x2),/adbhid.c#L797" id="L797" class="line"1259me="L8012"> 759 int >125f="+code=err" cla0x00,/adbhid.c#L797" id="L797" class="line"126ame="L8012"> 760 >126> break; 761 if ( >126ntosh /adbhid.c#L796" id="L796" class="line"1262me="L8012"> 762 12"> >12"f="+code=prins="sref">printkasssreque&qa href="+code=Easssreque&qtosh(&s="sref">printkreqa href="+code=Ereq cla,avent" class="srNUL) | ntos, 1,avent" class="srers_FLUSH: printkua href="+code=hid" cla)sh/adbhid.c#L795" id="L795" class="line"1263me="L8012"> 763 12"> >126 if h/adbhid.c#L796" id="L796" class="line"1264me="L8012"> 764 } >126ntosh/adbhid.c#L825" id="L825" class="line"1265me="L8012"> 765 >126 printk__dnit href="+code=hi__dnittoshasref">hid-&ass="l_dnit href="+code=hiass="l_dnitass="voidh/adbhid.c#L833" id="L833" class="line"1266me="L8012"> 766 >126"+856h/adbhid.c#L8a href="+856" class="line"1267me="L8012"> 767 >126ntosh#ifndefasref">hid-&CONFIG_MAC href="+code=hiCONFIG_MACtosh/adbhid.c#L825" id="L825" class="line"1268me="L8012"> 768 if (!<12"> >126 hid-&="Lh _ix_keycodes))="Lh _ixass="s="sref">printkchrp>->hid-&="Lh _ix_keycodes))="Lh _ixass="s="sref">printkpower="Lspan class="striower="L cla)s/adbhid.c#L825" id="L825" class="line"1269me="L8012"> 769 12"> >126 break; 770 12"> >12"> #endif/adbhid.c#L795" id="L795" class="line"1271me="L8012"> 771 } >127ntosh/adbhid.c#L832" id="L832" class="line"1272me="L8012"> 772 >127f="+code=prins="sref">printkledsreque&qa href="+code=Eledsreque&q="+cass="sref">producompletr href="+code=hicompletr="+co= 1h/adbhid.c#L795" id="L795" class="line"1273me="L8012"> 773 >127 - 774 >127 775 >127 776 >127"+856" ce 0xCs="sref">printkblockan>_notifier_chain_37\n&quoprintkasssclient_li&qa href="+code=Easssclient_li&qntos,/adbhid.c#L795" id="L795" class="line"1277me="L8012"> 777 >127 printkass="l_asssnotifier href="+code=hiass="l_asssnotifier cla)h/adbhid.c#L795" id="L795" class="line"1278me="L8012"> 778 >127 779 >127 break; 780 >128>="+ch/adbhid.c#L796" id="L796" class="line"1281me="L8012"> 781 >12"ntosh/adbhid.c#L832" id="L832" class="line"12"2me="L8012"> 782 >128f="+cstatic void s="sref">printk__exit href="+code=hi__exittoshasref">hid-&ass="l_exit href="+code=hiass="l_exitass="voidh/adbhid.c#L833" id="L833" class="line"12"3me="L8012"> 783 >128 - 784 >128 h/adbhid.c#L796" id="L796" class="line"1285me="L8012"> 785 >12"ref="d/adbhid.c#L796" id="L796" class="line"1286me="L8012"> 786 >128f="+class="sref">inpmodule_dnit href="+code=himodule_dnitass="s="sref">printkass="l_dnit href="+code=hiass="l_dnitass=)h/adbhid.c#L795" id="L795" class="line"12"7me="L8012"> 787 >1287+856lass="sref">inpmodule_exit href="+code=himodule_exitass="s="sref">printkass="l_exit href="+code=hiass="l_exitass=)h/adbhid.c#L795" id="L795" class="line"12"8me="L8012"> 788 >128
fooquo<> The original LXR software by tha/adbhid.c#http://sourceforge.net/projects/lxo<>LXR nd iunityntos, this experiif tal 2" iionnby adbhid.c#mailto:lxo@