• Home
  • Raw
  • Download

Lines Matching +full:product +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
7 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
8 * Copyright (c) 2006-2007 Jiri Kosina
27 #include "hid-ids.h"
52 static int iso_layout = -1;
54 MODULE_PARM_DESC(iso_layout, "Swap the backtick/tilde and greater-than/less-than keys. "
55 "([-1] = auto, 0 = disabled, 1 = enabled)");
61 "[0] = as-is, Mac layout. 1 = swapped, Windows layout., 2 = swapped, Swap only left side)");
73 "[0] = as-is, Mac layout, 1 = swapped, PC layout)");
76 char *name; member
357 char *non_apple = non_apple_keyboards[i].name; in apple_is_non_apple_keyboard()
359 if (strncmp(hdev->name, non_apple, strlen(non_apple)) == 0) in apple_is_non_apple_keyboard()
368 return hdev->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI && in apple_is_omoton_kb066()
369 strcmp(hdev->name, "Bluetooth Keyboard") == 0; in apple_is_omoton_kb066()
377 for (trans = table; trans->from; trans++) in apple_setup_key_translation()
378 set_bit(trans->to, input->keybit); in apple_setup_key_translation()
387 for (trans = table; trans->from; trans++) in apple_find_translation()
388 if (trans->from == from) in apple_find_translation()
398 (!test_bit(code, input->key)) == value) in input_event_with_scancode()
409 u16 code = usage->code; in hidinput_apple_event()
413 real_fnmode = (asc->quirks & APPLE_IS_NON_APPLE) ? 2 : 1; in hidinput_apple_event()
422 code = trans->to; in hidinput_apple_event()
425 if (iso_layout > 0 || (iso_layout < 0 && (asc->quirks & APPLE_ISO_TILDE_QUIRK) && in hidinput_apple_event()
426 hid->country == HID_COUNTRY_INTERNATIONAL_ISO)) { in hidinput_apple_event()
430 code = trans->to; in hidinput_apple_event()
440 code = trans->to; in hidinput_apple_event()
447 code = trans->to; in hidinput_apple_event()
451 asc->fn_on = !!value; in hidinput_apple_event()
454 if (hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI || in hidinput_apple_event()
455 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO || in hidinput_apple_event()
456 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS || in hidinput_apple_event()
457 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI || in hidinput_apple_event()
458 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO || in hidinput_apple_event()
459 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS || in hidinput_apple_event()
460 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI || in hidinput_apple_event()
461 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO || in hidinput_apple_event()
462 hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS) in hidinput_apple_event()
464 else if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015 || in hidinput_apple_event()
465 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015) in hidinput_apple_event()
467 else if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 || in hidinput_apple_event()
468 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 || in hidinput_apple_event()
469 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 || in hidinput_apple_event()
470 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021) in hidinput_apple_event()
472 else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132 || in hidinput_apple_event()
473 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680 || in hidinput_apple_event()
474 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213) in hidinput_apple_event()
476 else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K || in hidinput_apple_event()
477 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223 || in hidinput_apple_event()
478 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F) in hidinput_apple_event()
480 else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K || in hidinput_apple_event()
481 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K) in hidinput_apple_event()
483 else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI && in hidinput_apple_event()
484 hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) in hidinput_apple_event()
486 else if (hid->product < 0x21d || hid->product >= 0x300) in hidinput_apple_event()
494 bool from_is_set = test_bit(trans->from, input->key); in hidinput_apple_event()
495 bool to_is_set = test_bit(trans->to, input->key); in hidinput_apple_event()
498 code = trans->from; in hidinput_apple_event()
500 code = trans->to; in hidinput_apple_event()
503 if (trans->flags & APPLE_FLAG_FKEY) { in hidinput_apple_event()
506 do_translate = !asc->fn_on; in hidinput_apple_event()
509 do_translate = asc->fn_on; in hidinput_apple_event()
516 do_translate = asc->fn_on; in hidinput_apple_event()
520 code = trans->to; in hidinput_apple_event()
524 if (asc->quirks & APPLE_NUMLOCK_EMULATION && in hidinput_apple_event()
525 (test_bit(code, asc->pressed_numlock) || in hidinput_apple_event()
526 test_bit(LED_NUML, input->led))) { in hidinput_apple_event()
531 set_bit(code, asc->pressed_numlock); in hidinput_apple_event()
533 clear_bit(code, asc->pressed_numlock); in hidinput_apple_event()
535 code = trans->to; in hidinput_apple_event()
540 if (usage->code != code) { in hidinput_apple_event()
541 input_event_with_scancode(input, usage->type, code, usage->hid, value); in hidinput_apple_event()
554 if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || in apple_event()
555 !usage->type) in apple_event()
558 if ((asc->quirks & APPLE_INVERT_HWHEEL) && in apple_event()
559 usage->code == REL_HWHEEL) { in apple_event()
560 input_event_with_scancode(field->hidinput->input, usage->type, in apple_event()
561 usage->code, usage->hid, -value); in apple_event()
565 if ((asc->quirks & APPLE_HAS_FN) && in apple_event()
566 hidinput_apple_event(hdev, field->hidinput->input, in apple_event()
581 if (!(asc->quirks & APPLE_RDESC_BATTERY) || !hdev->battery) in apple_fetch_battery()
582 return -1; in apple_fetch_battery()
584 report_enum = &hdev->report_enum[hdev->battery_report_type]; in apple_fetch_battery()
585 report = report_enum->report_id_hash[hdev->battery_report_id]; in apple_fetch_battery()
587 if (!report || report->maxfield < 1) in apple_fetch_battery()
588 return -1; in apple_fetch_battery()
590 if (hdev->battery_capacity == hdev->battery_max) in apple_fetch_battery()
591 return -1; in apple_fetch_battery()
596 return -1; in apple_fetch_battery()
603 struct hid_device *hdev = asc->hdev; in apple_battery_timer_tick()
606 mod_timer(&asc->battery_timer, in apple_battery_timer_tick()
626 if ((asc->quirks & APPLE_RDESC_JIS) && *rsize >= 60 && in apple_report_fixup()
641 if ((asc->quirks & APPLE_RDESC_BATTERY) && *rsize == 83 && in apple_report_fixup()
645 *rsize = *rsize - 1; in apple_report_fixup()
661 set_bit(KEY_NUMLOCK, input->keybit); in apple_setup_input()
681 if (usage->hid == (HID_UP_CUSTOM | 0x0003) || in apple_input_mapping()
682 usage->hid == (HID_UP_MSVENDOR | 0x0003) || in apple_input_mapping()
683 usage->hid == (HID_UP_HPVENDOR2 | 0x0003)) { in apple_input_mapping()
685 set_bit(EV_REP, hi->input->evbit); in apple_input_mapping()
687 asc->fn_found = true; in apple_input_mapping()
688 apple_setup_input(hi->input); in apple_input_mapping()
702 if (asc->quirks & APPLE_MIGHTYMOUSE) { in apple_input_mapped()
703 if (usage->hid == HID_GD_Z) in apple_input_mapped()
705 else if (usage->code == BTN_1) in apple_input_mapped()
707 else if (usage->code == BTN_2) in apple_input_mapped()
719 if (((asc->quirks & APPLE_HAS_FN) && !asc->fn_found) || apple_is_omoton_kb066(hdev)) { in apple_input_configured()
721 asc->quirks &= ~APPLE_HAS_FN; in apple_input_configured()
725 hid_info(hdev, "Non-apple keyboard detected; function keys will default to fnmode=2 behavior\n"); in apple_input_configured()
726 asc->quirks |= APPLE_IS_NON_APPLE; in apple_input_configured()
738 list_for_each_entry(report, &hdev->report_enum[HID_INPUT_REPORT].report_list, list) { in apple_backlight_check_support()
739 for (i = 0; i < report->maxfield; i++) { in apple_backlight_check_support()
740 hid = report->field[i]->usage->hid; in apple_backlight_check_support()
756 return -ENOMEM; in apple_backlight_set()
758 rep->report_id = 0xB0; in apple_backlight_set()
759 rep->version = 1; in apple_backlight_set()
760 rep->backlight = value; in apple_backlight_set()
761 rep->rate = rate; in apple_backlight_set()
776 return apple_backlight_set(backlight->hdev, brightness, 0); in apple_backlight_led_set()
786 return -EINVAL; in apple_backlight_init()
790 return -ENOMEM; in apple_backlight_init()
798 if (ret < 8 || rep->version != 1) { in apple_backlight_init()
799 hid_err(hdev, "backlight config struct: bad version %i\n", rep->version); in apple_backlight_init()
800 ret = -EINVAL; in apple_backlight_init()
805 rep->backlight_off, rep->backlight_on_min, rep->backlight_on_max); in apple_backlight_init()
807 asc->backlight = devm_kzalloc(&hdev->dev, sizeof(*asc->backlight), GFP_KERNEL); in apple_backlight_init()
808 if (!asc->backlight) { in apple_backlight_init()
809 ret = -ENOMEM; in apple_backlight_init()
813 asc->backlight->hdev = hdev; in apple_backlight_init()
814 asc->backlight->cdev.name = "apple::kbd_backlight"; in apple_backlight_init()
815 asc->backlight->cdev.max_brightness = rep->backlight_on_max; in apple_backlight_init()
816 asc->backlight->cdev.brightness_set_blocking = apple_backlight_led_set; in apple_backlight_init()
824 ret = devm_led_classdev_register(&hdev->dev, &asc->backlight->cdev); in apple_backlight_init()
834 unsigned long quirks = id->driver_data; in apple_probe()
838 asc = devm_kzalloc(&hdev->dev, sizeof(*asc), GFP_KERNEL); in apple_probe()
841 return -ENOMEM; in apple_probe()
844 asc->hdev = hdev; in apple_probe()
845 asc->quirks = quirks; in apple_probe()
861 timer_setup(&asc->battery_timer, apple_battery_timer_tick, 0); in apple_probe()
862 mod_timer(&asc->battery_timer, in apple_probe()
876 del_timer_sync(&asc->battery_timer); in apple_remove()
1092 .name = "apple",