Lines Matching refs:id
212 int id; member
237 static void init_trackpad(int id);
238 static void init_trackball(int id);
239 static void init_turbomouse(int id);
240 static void init_microspeed(int id);
241 static void init_ms_a3(int id);
268 int id = (data[0] >> 4) & 0x0f; in adbhid_keyboard_input() local
270 if (!adbhid[id]) { in adbhid_keyboard_input()
272 id, data[0], data[1], data[2], data[3]); in adbhid_keyboard_input()
279 adbhid_input_keycode(id, data[1], 0); in adbhid_keyboard_input()
281 adbhid_input_keycode(id, data[2], 0); in adbhid_keyboard_input()
285 adbhid_input_keycode(int id, int scancode, int repeat) in adbhid_input_keycode() argument
287 struct adbhid *ahid = adbhid[id]; in adbhid_input_keycode()
394 key = adbhid[id]->keycode[keycode]; in adbhid_input_keycode()
396 input_report_key(adbhid[id]->input, key, !up_flag); in adbhid_input_keycode()
397 input_sync(adbhid[id]->input); in adbhid_input_keycode()
407 int id = (data[0] >> 4) & 0x0f; in adbhid_mouse_input() local
409 if (!adbhid[id]) { in adbhid_mouse_input()
410 pr_err("ADB HID on ID %d not yet registered\n", id); in adbhid_mouse_input()
458 switch (adbhid[id]->mouse_kind) in adbhid_mouse_input()
488 input_report_key(adbhid[id]->input, BTN_LEFT, !((data[1] >> 7) & 1)); in adbhid_mouse_input()
489 input_report_key(adbhid[id]->input, BTN_MIDDLE, !((data[2] >> 7) & 1)); in adbhid_mouse_input()
491 if (nb >= 4 && adbhid[id]->mouse_kind != ADBMOUSE_TRACKPAD) in adbhid_mouse_input()
492 input_report_key(adbhid[id]->input, BTN_RIGHT, !((data[3] >> 7) & 1)); in adbhid_mouse_input()
494 input_report_rel(adbhid[id]->input, REL_X, in adbhid_mouse_input()
496 input_report_rel(adbhid[id]->input, REL_Y, in adbhid_mouse_input()
499 input_sync(adbhid[id]->input); in adbhid_mouse_input()
505 int id = (data[0] >> 4) & 0x0f; in adbhid_buttons_input() local
507 if (!adbhid[id]) { in adbhid_buttons_input()
508 pr_err("ADB HID on ID %d not yet registered\n", id); in adbhid_buttons_input()
512 switch (adbhid[id]->original_handler_id) { in adbhid_buttons_input()
520 input_report_key(adbhid[id]->input, KEY_SOUND, down); in adbhid_buttons_input()
524 input_report_key(adbhid[id]->input, KEY_MUTE, down); in adbhid_buttons_input()
528 input_report_key(adbhid[id]->input, KEY_VOLUMEDOWN, down); in adbhid_buttons_input()
532 input_report_key(adbhid[id]->input, KEY_VOLUMEUP, down); in adbhid_buttons_input()
554 input_report_key(adbhid[id]->input, KEY_MUTE, down); in adbhid_buttons_input()
558 input_report_key(adbhid[id]->input, KEY_VOLUMEDOWN, down); in adbhid_buttons_input()
562 input_report_key(adbhid[id]->input, KEY_VOLUMEUP, down); in adbhid_buttons_input()
566 input_report_key(adbhid[id]->input, KEY_EJECTCD, down); in adbhid_buttons_input()
574 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSDOWN, down); in adbhid_buttons_input()
582 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSUP, down); in adbhid_buttons_input()
586 input_report_key(adbhid[id]->input, KEY_SWITCHVIDEOMODE, down); in adbhid_buttons_input()
590 input_report_key(adbhid[id]->input, KEY_KBDILLUMTOGGLE, down); in adbhid_buttons_input()
594 input_report_key(adbhid[id]->input, KEY_KBDILLUMDOWN, down); in adbhid_buttons_input()
602 input_report_key(adbhid[id]->input, KEY_KBDILLUMUP, down); in adbhid_buttons_input()
625 input_sync(adbhid[id]->input); in adbhid_buttons_input()
694 real_leds(leds, adbhid->id); in adbhid_kbd_event()
710 if (ahid && ahid->id == ADB_KEYBOARD) in adbhid_kbd_capslock_remember()
753 adbhid_input_register(int id, int default_id, int original_handler_id, in adbhid_input_register() argument
762 if (adbhid[id]) { in adbhid_input_register()
763 pr_err("Trying to reregister ADB HID on ID %d\n", id); in adbhid_input_register()
767 adbhid[id] = hid = kzalloc(sizeof(struct adbhid), GFP_KERNEL); in adbhid_input_register()
774 sprintf(hid->phys, "adb%d:%d.%02x/input", id, default_id, original_handler_id); in adbhid_input_register()
777 hid->id = default_id; in adbhid_input_register()
785 input_dev->id.bustype = BUS_ADB; in adbhid_input_register()
786 input_dev->id.vendor = 0x0001; in adbhid_input_register()
787 input_dev->id.product = (id << 12) | (default_id << 8) | original_handler_id; in adbhid_input_register()
788 input_dev->id.version = 0x0100; in adbhid_input_register()
805 input_dev->id.version = ADB_KEYBOARD_UNKNOWN; in adbhid_input_register()
812 input_dev->id.version = ADB_KEYBOARD_ANSI; in adbhid_input_register()
819 input_dev->id.version = ADB_KEYBOARD_ISO; in adbhid_input_register()
828 input_dev->id.version = ADB_KEYBOARD_JIS; in adbhid_input_register()
913 adbhid[id] = NULL; in adbhid_input_register()
917 static void adbhid_input_unregister(int id) in adbhid_input_unregister() argument
919 input_unregister_device(adbhid[id]->input); in adbhid_input_unregister()
920 kfree(adbhid[id]->keycode); in adbhid_input_unregister()
921 kfree(adbhid[id]); in adbhid_input_unregister()
922 adbhid[id] = NULL; in adbhid_input_unregister()
927 adbhid_input_reregister(int id, int default_id, int org_handler_id, in adbhid_input_reregister() argument
930 if (adbhid[id]) { in adbhid_input_reregister()
931 if (adbhid[id]->input->id.product != in adbhid_input_reregister()
932 ((id << 12)|(default_id << 8)|org_handler_id)) { in adbhid_input_reregister()
933 adbhid_input_unregister(id); in adbhid_input_reregister()
934 adbhid_input_register(id, default_id, org_handler_id, in adbhid_input_reregister()
938 adbhid_input_register(id, default_id, org_handler_id, in adbhid_input_reregister()
940 return 1<<id; in adbhid_input_reregister()
964 int id = keyboard_ids.id[i]; in adbhid_probe() local
966 adb_get_infos(id, &default_id, &org_handler_id); in adbhid_probe()
970 ADB_WRITEREG(id, KEYB_LEDREG), 0xff, 0xff); in adbhid_probe()
976 if (!adb_try_handler_change(id, 5)) in adbhid_probe()
978 adb_try_handler_change(id, 3); in adbhid_probe()
980 adb_get_infos(id, &default_id, &cur_handler_id); in adbhid_probe()
982 id, cur_handler_id); in adbhid_probe()
983 reg |= adbhid_input_reregister(id, default_id, org_handler_id, in adbhid_probe()
988 int id = buttons_ids.id[i]; in adbhid_probe() local
990 adb_get_infos(id, &default_id, &org_handler_id); in adbhid_probe()
991 reg |= adbhid_input_reregister(id, default_id, org_handler_id, in adbhid_probe()
998 int id = mouse_ids.id[i]; in adbhid_probe() local
1002 adb_get_infos(id, &default_id, &org_handler_id); in adbhid_probe()
1004 if (adb_try_handler_change(id, 4)) { in adbhid_probe()
1007 else if (adb_try_handler_change(id, 0x2F)) { in adbhid_probe()
1010 else if (adb_try_handler_change(id, 0x42)) { in adbhid_probe()
1013 else if (adb_try_handler_change(id, 0x66)) { in adbhid_probe()
1016 else if (adb_try_handler_change(id, 0x5F)) { in adbhid_probe()
1019 else if (adb_try_handler_change(id, 3)) { in adbhid_probe()
1022 else if (adb_try_handler_change(id, 2)) { in adbhid_probe()
1032 init_microspeed(id); in adbhid_probe()
1035 init_ms_a3(id); in adbhid_probe()
1045 ADB_READREG(id, 1)); in adbhid_probe()
1052 init_trackball(id); in adbhid_probe()
1059 init_trackpad(id); in adbhid_probe()
1066 init_turbomouse(id); in adbhid_probe()
1071 if (adb_try_handler_change(id, 0x42)) { in adbhid_probe()
1078 adb_get_infos(id, &default_id, &cur_handler_id); in adbhid_probe()
1080 desc, id, cur_handler_id); in adbhid_probe()
1081 reg |= adbhid_input_reregister(id, default_id, org_handler_id, in adbhid_probe()
1088 init_trackpad(int id) in init_trackpad() argument
1094 ADB_READREG(id,1)); in init_trackpad()
1102 ADB_WRITEREG(id,1), in init_trackpad()
1113 ADB_WRITEREG(id,2), in init_trackpad()
1124 ADB_WRITEREG(id,1), in init_trackpad()
1135 adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id)); in init_trackpad()
1140 init_trackball(int id) in init_trackball() argument
1145 ADB_WRITEREG(id,1), 00,0x81); in init_trackball()
1148 ADB_WRITEREG(id,1), 01,0x81); in init_trackball()
1151 ADB_WRITEREG(id,1), 02,0x81); in init_trackball()
1154 ADB_WRITEREG(id,1), 03,0x38); in init_trackball()
1157 ADB_WRITEREG(id,1), 00,0x81); in init_trackball()
1160 ADB_WRITEREG(id,1), 01,0x81); in init_trackball()
1163 ADB_WRITEREG(id,1), 02,0x81); in init_trackball()
1166 ADB_WRITEREG(id,1), 03,0x38); in init_trackball()
1170 init_turbomouse(int id) in init_turbomouse() argument
1174 adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id)); in init_turbomouse()
1204 init_microspeed(int id) in init_microspeed() argument
1208 adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id)); in init_microspeed()
1231 ADB_WRITEREG(id,1), in init_microspeed()
1238 adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id)); in init_microspeed()
1242 init_ms_a3(int id) in init_ms_a3() argument
1247 ADB_WRITEREG(id, 0x2), in init_ms_a3()
1251 adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id)); in init_ms_a3()