Lines Matching +full:fn +full:- +full:keymap

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (c) 1999-2002 Vojtech Pavlik
12 * input-only controllers and AT keyboards connected over a one way RS232
22 #include <linux/input/vivaldi-fmap.h>
58 MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards");
68 #define SCANCODE(keymap) ((keymap >> 16) & 0xFFFF) argument
69 #define KEYCODE(keymap) (keymap & 0xFFFF) argument
236 /* Serializes reconnect(), attr->set() and event work */
243 * System-specific keymap fixup routine
309 return vivaldi_function_row_physmap_show(&atkbd->vdata, buf); in atkbd_show_function_row_physmap()
320 !atkbd->vdata.num_function_row_keys) in atkbd_attr_is_visible()
323 return attr->mode; in atkbd_attr_is_visible()
368 __clear_bit(i, &atkbd->xl_bit); in atkbd_calculate_xl_bit()
370 __set_bit(i, &atkbd->xl_bit); in atkbd_calculate_xl_bit()
382 if (atkbd->set == 3) { in atkbd_compat_scancode()
383 if (atkbd->emul == 1) in atkbd_compat_scancode()
387 if (atkbd->emul == 1) in atkbd_compat_scancode()
403 struct input_dev *dev = atkbd->dev; in atkbd_interrupt()
405 int scroll = 0, hscroll = 0, click = -1; in atkbd_interrupt()
409 dev_dbg(&serio->dev, "Received %02x flags %02x\n", data, flags); in atkbd_interrupt()
412 …if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && !atkbd->resend && atkbd- in atkbd_interrupt()
413 dev_warn(&serio->dev, "Frame/parity error: %02x\n", flags); in atkbd_interrupt()
415 atkbd->resend = true; in atkbd_interrupt()
420 atkbd->resend = false; in atkbd_interrupt()
423 if (unlikely(atkbd->ps2dev.flags & PS2_FLAG_ACK)) in atkbd_interrupt()
424 if (ps2_handle_ack(&atkbd->ps2dev, data)) in atkbd_interrupt()
427 if (unlikely(atkbd->ps2dev.flags & PS2_FLAG_CMD)) in atkbd_interrupt()
428 if (ps2_handle_response(&atkbd->ps2dev, data)) in atkbd_interrupt()
431 pm_wakeup_event(&serio->dev, 0); in atkbd_interrupt()
433 if (!atkbd->enabled) in atkbd_interrupt()
441 if (atkbd->translated) { in atkbd_interrupt()
443 if (atkbd->emul || atkbd_need_xlate(atkbd->xl_bit, code)) { in atkbd_interrupt()
444 atkbd->release = code >> 7; in atkbd_interrupt()
448 if (!atkbd->emul) in atkbd_interrupt()
454 atkbd->enabled = false; in atkbd_interrupt()
455 serio_reconnect(atkbd->ps2dev.serio); in atkbd_interrupt()
458 atkbd->emul = 1; in atkbd_interrupt()
461 atkbd->emul = 2; in atkbd_interrupt()
464 atkbd->release = true; in atkbd_interrupt()
469 dev_warn(&serio->dev, in atkbd_interrupt()
472 data == ATKBD_RET_ACK ? "ACK" : "NAK", serio->phys); in atkbd_interrupt()
475 atkbd->err_count++; in atkbd_interrupt()
476 dev_dbg(&serio->dev, "Keyboard on %s reports too many keys pressed.\n", in atkbd_interrupt()
477 serio->phys); in atkbd_interrupt()
483 if (atkbd->emul && --atkbd->emul) in atkbd_interrupt()
486 keycode = atkbd->keycode[code]; in atkbd_interrupt()
488 if (!(atkbd->release && test_bit(code, atkbd->force_release_mask))) in atkbd_interrupt()
496 dev_warn(&serio->dev, in atkbd_interrupt()
498 atkbd->release ? "released" : "pressed", in atkbd_interrupt()
499 atkbd->translated ? "translated" : "raw", in atkbd_interrupt()
500 atkbd->set, code, serio->phys); in atkbd_interrupt()
501 dev_warn(&serio->dev, in atkbd_interrupt()
519 click = !atkbd->release; in atkbd_interrupt()
522 hscroll = -1; in atkbd_interrupt()
528 if (atkbd->release) { in atkbd_interrupt()
530 atkbd->last = 0; in atkbd_interrupt()
531 } else if (!atkbd->softrepeat && test_bit(keycode, dev->key)) { in atkbd_interrupt()
533 value = time_before(jiffies, atkbd->time) && atkbd->last == code ? 1 : 2; in atkbd_interrupt()
536 atkbd->last = code; in atkbd_interrupt()
537 atkbd->time = jiffies + msecs_to_jiffies(dev->rep[REP_DELAY]) / 2; in atkbd_interrupt()
543 if (value && test_bit(code, atkbd->force_release_mask)) { in atkbd_interrupt()
550 if (atkbd->scroll) { in atkbd_interrupt()
551 if (click != -1) in atkbd_interrupt()
554 atkbd->release ? -scroll : scroll); in atkbd_interrupt()
559 atkbd->release = false; in atkbd_interrupt()
572 struct input_dev *dev = atkbd->dev; in atkbd_set_repeat_rate()
576 while (i < ARRAY_SIZE(period) - 1 && period[i] < dev->rep[REP_PERIOD]) in atkbd_set_repeat_rate()
578 dev->rep[REP_PERIOD] = period[i]; in atkbd_set_repeat_rate()
580 while (j < ARRAY_SIZE(delay) - 1 && delay[j] < dev->rep[REP_DELAY]) in atkbd_set_repeat_rate()
582 dev->rep[REP_DELAY] = delay[j]; in atkbd_set_repeat_rate()
585 return ps2_command(&atkbd->ps2dev, &param, ATKBD_CMD_SETREP); in atkbd_set_repeat_rate()
590 struct input_dev *dev = atkbd->dev; in atkbd_set_leds()
593 param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0) in atkbd_set_leds()
594 | (test_bit(LED_NUML, dev->led) ? 2 : 0) in atkbd_set_leds()
595 | (test_bit(LED_CAPSL, dev->led) ? 4 : 0); in atkbd_set_leds()
596 if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS)) in atkbd_set_leds()
597 return -1; in atkbd_set_leds()
599 if (atkbd->extra) { in atkbd_set_leds()
601 param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0) in atkbd_set_leds()
602 | (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0) in atkbd_set_leds()
603 | (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0) in atkbd_set_leds()
604 | (test_bit(LED_MISC, dev->led) ? 0x10 : 0) in atkbd_set_leds()
605 | (test_bit(LED_MUTE, dev->led) ? 0x20 : 0); in atkbd_set_leds()
606 if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS)) in atkbd_set_leds()
607 return -1; in atkbd_set_leds()
623 mutex_lock(&atkbd->mutex); in atkbd_event_work()
625 if (!atkbd->enabled) { in atkbd_event_work()
632 schedule_delayed_work(&atkbd->event_work, in atkbd_event_work()
635 if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) in atkbd_event_work()
638 if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) in atkbd_event_work()
642 mutex_unlock(&atkbd->mutex); in atkbd_event_work()
653 if (time_after(jiffies, atkbd->event_jiffies + delay)) in atkbd_schedule_event_work()
656 atkbd->event_jiffies = jiffies; in atkbd_schedule_event_work()
657 set_bit(event_bit, &atkbd->event_mask); in atkbd_schedule_event_work()
659 schedule_delayed_work(&atkbd->event_work, delay); in atkbd_schedule_event_work()
673 if (!atkbd->write) in atkbd_event()
674 return -1; in atkbd_event()
683 if (!atkbd->softrepeat) in atkbd_event()
688 return -1; in atkbd_event()
699 serio_pause_rx(atkbd->ps2dev.serio); in atkbd_enable()
700 atkbd->enabled = true; in atkbd_enable()
701 serio_continue_rx(atkbd->ps2dev.serio); in atkbd_enable()
711 serio_pause_rx(atkbd->ps2dev.serio); in atkbd_disable()
712 atkbd->enabled = false; in atkbd_disable()
713 serio_continue_rx(atkbd->ps2dev.serio); in atkbd_disable()
718 struct ps2dev *ps2dev = &atkbd->ps2dev; in atkbd_activate()
725 dev_err(&ps2dev->serio->dev, in atkbd_activate()
727 ps2dev->serio->phys); in atkbd_activate()
728 return -1; in atkbd_activate()
741 struct ps2dev *ps2dev = &atkbd->ps2dev; in atkbd_deactivate()
744 dev_err(&ps2dev->serio->dev, in atkbd_deactivate()
746 ps2dev->serio->phys); in atkbd_deactivate()
755 struct ps2dev *ps2dev = &atkbd->ps2dev; in atkbd_probe()
759 * Some systems, where the bit-twiddling when testing the io-lines of the in atkbd_probe()
766 dev_warn(&ps2dev->serio->dev, in atkbd_probe()
768 ps2dev->serio->phys); in atkbd_probe()
787 return -1; in atkbd_probe()
788 atkbd->id = 0xabba; in atkbd_probe()
793 return -1; in atkbd_probe()
795 atkbd->id = (param[0] << 8) | param[1]; in atkbd_probe()
797 if (atkbd->id == 0xaca1 && atkbd->translated) { in atkbd_probe()
798 dev_err(&ps2dev->serio->dev, in atkbd_probe()
799 "NCD terminal keyboards are only supported on non-translating controllers. " in atkbd_probe()
801 return -1; in atkbd_probe()
822 struct ps2dev *ps2dev = &atkbd->ps2dev; in atkbd_select_set()
825 atkbd->extra = false; in atkbd_select_set()
829 * IBM RapidAccess / IBM EzButton / Chicony KBP-8993 keyboards. in atkbd_select_set()
832 if (atkbd->translated) in atkbd_select_set()
835 if (atkbd->id == 0xaca1) { in atkbd_select_set()
844 atkbd->extra = true; in atkbd_select_set()
858 atkbd->id = param[0] << 8 | param[1]; in atkbd_select_set()
883 struct ps2dev *ps2dev = &atkbd->ps2dev; in atkbd_reset_state()
892 return -1; in atkbd_reset_state()
900 return -1; in atkbd_reset_state()
915 ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_DEF); in atkbd_cleanup()
929 input_unregister_device(atkbd->dev); in atkbd_disconnect()
933 * Note that since atkbd->enabled is false event work will keep in atkbd_disconnect()
937 cancel_delayed_work_sync(&atkbd->event_work); in atkbd_disconnect()
953 if (atkbd->set == 2) in atkbd_apply_forced_release_keylist()
954 for (i = 0; keys[i] != -1U; i++) in atkbd_apply_forced_release_keylist()
955 __set_bit(keys[i], atkbd->force_release_mask); in atkbd_apply_forced_release_keylist()
959 * Most special keys (Fn+F?) on Dell laptops do not generate release
963 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, -1U
971 0x94, -1U
975 * Samsung NC10,NC20 with Fn+F? key release not working
978 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9, -1U
982 * Amilo Pi 3525 key release for Fn+Volume keys not working
985 0x20, 0xa0, 0x2e, 0xae, 0x30, 0xb0, -1U
992 0x67, 0xed, 0x90, 0xa2, 0x99, 0xa4, 0xae, 0xb0, -1U
999 0xa0, 0xae, 0xb0, -1U
1007 0xae, 0xb0, -1U
1011 * OQO 01+ multimedia keys (64--66) generate e0 6x upon release whereas
1012 * they should be generating e4-e6 (0x80 | code).
1017 if (atkbd->translated && atkbd->emul == 1 && in atkbd_oqo_01plus_scancode_fixup()
1019 atkbd->emul = 0; in atkbd_oqo_01plus_scancode_fixup()
1028 struct device *dev = &atkbd->ps2dev.serio->dev; in atkbd_get_keymap_from_fwnode()
1033 /* Parse "linux,keymap" property */ in atkbd_get_keymap_from_fwnode()
1034 n = device_property_count_u32(dev, "linux,keymap"); in atkbd_get_keymap_from_fwnode()
1036 return -ENXIO; in atkbd_get_keymap_from_fwnode()
1040 return -ENOMEM; in atkbd_get_keymap_from_fwnode()
1042 if (device_property_read_u32_array(dev, "linux,keymap", ptr, n)) { in atkbd_get_keymap_from_fwnode()
1043 dev_err(dev, "problem parsing FW keymap property\n"); in atkbd_get_keymap_from_fwnode()
1045 return -EINVAL; in atkbd_get_keymap_from_fwnode()
1048 memset(atkbd->keycode, 0, sizeof(atkbd->keycode)); in atkbd_get_keymap_from_fwnode()
1052 atkbd->keycode[scancode] = keycode; in atkbd_get_keymap_from_fwnode()
1066 struct device *dev = &atkbd->ps2dev.serio->dev; in atkbd_set_keycode_table()
1070 memset(atkbd->keycode, 0, sizeof(atkbd->keycode)); in atkbd_set_keycode_table()
1071 bitmap_zero(atkbd->force_release_mask, ATKBD_KEYMAP_SIZE); in atkbd_set_keycode_table()
1074 dev_dbg(dev, "Using FW keymap\n"); in atkbd_set_keycode_table()
1075 } else if (atkbd->translated) { in atkbd_set_keycode_table()
1078 atkbd->keycode[i] = atkbd_set2_keycode[scancode]; in atkbd_set_keycode_table()
1079 atkbd->keycode[i | 0x80] = atkbd_set2_keycode[scancode | 0x80]; in atkbd_set_keycode_table()
1080 if (atkbd->scroll) in atkbd_set_keycode_table()
1083 atkbd->keycode[i | 0x80] = atkbd_scroll_keys[j].keycode; in atkbd_set_keycode_table()
1085 } else if (atkbd->set == 3) { in atkbd_set_keycode_table()
1086 memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode)); in atkbd_set_keycode_table()
1088 memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode)); in atkbd_set_keycode_table()
1090 if (atkbd->scroll) in atkbd_set_keycode_table()
1093 atkbd->keycode[scancode] = atkbd_scroll_keys[i].keycode; in atkbd_set_keycode_table()
1102 atkbd->keycode[scancode] = KEY_HANGEUL; in atkbd_set_keycode_table()
1103 __set_bit(scancode, atkbd->force_release_mask); in atkbd_set_keycode_table()
1106 atkbd->keycode[scancode] = KEY_HANJA; in atkbd_set_keycode_table()
1107 __set_bit(scancode, atkbd->force_release_mask); in atkbd_set_keycode_table()
1122 struct input_dev *input_dev = atkbd->dev; in atkbd_set_device_attrs()
1125 if (atkbd->extra) in atkbd_set_device_attrs()
1126 snprintf(atkbd->name, sizeof(atkbd->name), in atkbd_set_device_attrs()
1129 snprintf(atkbd->name, sizeof(atkbd->name), in atkbd_set_device_attrs()
1131 atkbd->translated ? "Translated" : "Raw", atkbd->set); in atkbd_set_device_attrs()
1133 snprintf(atkbd->phys, sizeof(atkbd->phys), in atkbd_set_device_attrs()
1134 "%s/input0", atkbd->ps2dev.serio->phys); in atkbd_set_device_attrs()
1136 input_dev->name = atkbd->name; in atkbd_set_device_attrs()
1137 input_dev->phys = atkbd->phys; in atkbd_set_device_attrs()
1138 input_dev->id.bustype = BUS_I8042; in atkbd_set_device_attrs()
1139 input_dev->id.vendor = 0x0001; in atkbd_set_device_attrs()
1140 input_dev->id.product = atkbd->translated ? 1 : atkbd->set; in atkbd_set_device_attrs()
1141 input_dev->id.version = atkbd->id; in atkbd_set_device_attrs()
1142 input_dev->event = atkbd_event; in atkbd_set_device_attrs()
1143 input_dev->dev.parent = &atkbd->ps2dev.serio->dev; in atkbd_set_device_attrs()
1147 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | in atkbd_set_device_attrs()
1150 if (atkbd->write) { in atkbd_set_device_attrs()
1151 input_dev->evbit[0] |= BIT_MASK(EV_LED); in atkbd_set_device_attrs()
1152 input_dev->ledbit[0] = BIT_MASK(LED_NUML) | in atkbd_set_device_attrs()
1156 if (atkbd->extra) in atkbd_set_device_attrs()
1157 input_dev->ledbit[0] |= BIT_MASK(LED_COMPOSE) | in atkbd_set_device_attrs()
1161 if (!atkbd->softrepeat) { in atkbd_set_device_attrs()
1162 input_dev->rep[REP_DELAY] = 250; in atkbd_set_device_attrs()
1163 input_dev->rep[REP_PERIOD] = 33; in atkbd_set_device_attrs()
1166 input_dev->mscbit[0] = atkbd->softraw ? BIT_MASK(MSC_SCAN) : in atkbd_set_device_attrs()
1169 if (atkbd->scroll) { in atkbd_set_device_attrs()
1170 input_dev->evbit[0] |= BIT_MASK(EV_REL); in atkbd_set_device_attrs()
1171 input_dev->relbit[0] = BIT_MASK(REL_WHEEL) | in atkbd_set_device_attrs()
1173 __set_bit(BTN_MIDDLE, input_dev->keybit); in atkbd_set_device_attrs()
1176 input_dev->keycode = atkbd->keycode; in atkbd_set_device_attrs()
1177 input_dev->keycodesize = sizeof(unsigned short); in atkbd_set_device_attrs()
1178 input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode); in atkbd_set_device_attrs()
1181 if (atkbd->keycode[i] != KEY_RESERVED && in atkbd_set_device_attrs()
1182 atkbd->keycode[i] != ATKBD_KEY_NULL && in atkbd_set_device_attrs()
1183 atkbd->keycode[i] < ATKBD_SPECIAL) { in atkbd_set_device_attrs()
1184 __set_bit(atkbd->keycode[i], input_dev->keybit); in atkbd_set_device_attrs()
1192 struct device *dev = &serio->dev; in atkbd_parse_fwnode_data()
1195 /* Parse "function-row-physmap" property */ in atkbd_parse_fwnode_data()
1196 n = device_property_count_u32(dev, "function-row-physmap"); in atkbd_parse_fwnode_data()
1198 !device_property_read_u32_array(dev, "function-row-physmap", in atkbd_parse_fwnode_data()
1199 atkbd->vdata.function_row_physmap, in atkbd_parse_fwnode_data()
1201 atkbd->vdata.num_function_row_keys = n; in atkbd_parse_fwnode_data()
1202 dev_dbg(dev, "FW reported %d function-row key locations\n", n); in atkbd_parse_fwnode_data()
1217 int err = -ENOMEM; in atkbd_connect()
1224 atkbd->dev = dev; in atkbd_connect()
1225 ps2_init(&atkbd->ps2dev, serio); in atkbd_connect()
1226 INIT_DELAYED_WORK(&atkbd->event_work, atkbd_event_work); in atkbd_connect()
1227 mutex_init(&atkbd->mutex); in atkbd_connect()
1229 switch (serio->id.type) { in atkbd_connect()
1232 atkbd->translated = true; in atkbd_connect()
1236 if (serio->write) in atkbd_connect()
1237 atkbd->write = true; in atkbd_connect()
1241 atkbd->softraw = atkbd_softraw; in atkbd_connect()
1242 atkbd->softrepeat = atkbd_softrepeat; in atkbd_connect()
1243 atkbd->scroll = atkbd_scroll; in atkbd_connect()
1245 if (atkbd->softrepeat) in atkbd_connect()
1246 atkbd->softraw = true; in atkbd_connect()
1254 if (atkbd->write) { in atkbd_connect()
1257 err = -ENODEV; in atkbd_connect()
1261 atkbd->set = atkbd_select_set(atkbd, atkbd_set, atkbd_extra); in atkbd_connect()
1265 atkbd->set = 2; in atkbd_connect()
1266 atkbd->id = 0xab00; in atkbd_connect()
1275 if (serio->write) in atkbd_connect()
1278 err = input_register_device(atkbd->dev); in atkbd_connect()
1299 struct serio_driver *drv = serio->drv; in atkbd_reconnect()
1300 int retval = -1; in atkbd_reconnect()
1303 dev_dbg(&serio->dev, in atkbd_reconnect()
1305 return -1; in atkbd_reconnect()
1308 mutex_lock(&atkbd->mutex); in atkbd_reconnect()
1312 if (atkbd->write) { in atkbd_reconnect()
1316 if (atkbd->set != atkbd_select_set(atkbd, atkbd->set, atkbd->extra)) in atkbd_reconnect()
1327 if (!atkbd->softrepeat) in atkbd_reconnect()
1334 * of multi-byte scancode. in atkbd_reconnect()
1336 atkbd->xl_bit = 0; in atkbd_reconnect()
1337 atkbd->emul = 0; in atkbd_reconnect()
1340 if (atkbd->write) in atkbd_reconnect()
1346 mutex_unlock(&atkbd->mutex); in atkbd_reconnect()
1404 retval = mutex_lock_interruptible(&atkbd->mutex); in atkbd_attr_set_helper()
1412 mutex_unlock(&atkbd->mutex); in atkbd_attr_set_helper()
1419 return sprintf(buf, "%d\n", atkbd->extra ? 1 : 0); in atkbd_show_extra()
1430 if (!atkbd->write) in atkbd_set_extra()
1431 return -EIO; in atkbd_set_extra()
1438 return -EINVAL; in atkbd_set_extra()
1440 if (atkbd->extra != value) { in atkbd_set_extra()
1446 old_dev = atkbd->dev; in atkbd_set_extra()
1447 old_extra = atkbd->extra; in atkbd_set_extra()
1448 old_set = atkbd->set; in atkbd_set_extra()
1452 return -ENOMEM; in atkbd_set_extra()
1454 atkbd->dev = new_dev; in atkbd_set_extra()
1455 atkbd->set = atkbd_select_set(atkbd, atkbd->set, value); in atkbd_set_extra()
1461 err = input_register_device(atkbd->dev); in atkbd_set_extra()
1465 atkbd->dev = old_dev; in atkbd_set_extra()
1466 atkbd->set = atkbd_select_set(atkbd, old_set, old_extra); in atkbd_set_extra()
1480 size_t len = scnprintf(buf, PAGE_SIZE - 1, "%*pbl", in atkbd_show_force_release()
1481 ATKBD_KEYMAP_SIZE, atkbd->force_release_mask); in atkbd_show_force_release()
1500 memcpy(atkbd->force_release_mask, new_mask, sizeof(atkbd->force_release_mask)); in atkbd_set_force_release()
1507 return sprintf(buf, "%d\n", atkbd->scroll ? 1 : 0); in atkbd_show_scroll()
1522 return -EINVAL; in atkbd_set_scroll()
1524 if (atkbd->scroll != value) { in atkbd_set_scroll()
1525 old_dev = atkbd->dev; in atkbd_set_scroll()
1526 old_scroll = atkbd->scroll; in atkbd_set_scroll()
1530 return -ENOMEM; in atkbd_set_scroll()
1532 atkbd->dev = new_dev; in atkbd_set_scroll()
1533 atkbd->scroll = value; in atkbd_set_scroll()
1537 err = input_register_device(atkbd->dev); in atkbd_set_scroll()
1541 atkbd->scroll = old_scroll; in atkbd_set_scroll()
1542 atkbd->dev = old_dev; in atkbd_set_scroll()
1555 return sprintf(buf, "%d\n", atkbd->set); in atkbd_show_set()
1566 if (!atkbd->write) in atkbd_set_set()
1567 return -EIO; in atkbd_set_set()
1574 return -EINVAL; in atkbd_set_set()
1576 if (atkbd->set != value) { in atkbd_set_set()
1577 old_dev = atkbd->dev; in atkbd_set_set()
1578 old_extra = atkbd->extra; in atkbd_set_set()
1579 old_set = atkbd->set; in atkbd_set_set()
1583 return -ENOMEM; in atkbd_set_set()
1585 atkbd->dev = new_dev; in atkbd_set_set()
1586 atkbd->set = atkbd_select_set(atkbd, value, atkbd->extra); in atkbd_set_set()
1592 err = input_register_device(atkbd->dev); in atkbd_set_set()
1596 atkbd->dev = old_dev; in atkbd_set_set()
1597 atkbd->set = atkbd_select_set(atkbd, old_set, old_extra); in atkbd_set_set()
1610 return sprintf(buf, "%d\n", atkbd->softrepeat ? 1 : 0); in atkbd_show_softrepeat()
1620 if (!atkbd->write) in atkbd_set_softrepeat()
1621 return -EIO; in atkbd_set_softrepeat()
1628 return -EINVAL; in atkbd_set_softrepeat()
1630 if (atkbd->softrepeat != value) { in atkbd_set_softrepeat()
1631 old_dev = atkbd->dev; in atkbd_set_softrepeat()
1632 old_softrepeat = atkbd->softrepeat; in atkbd_set_softrepeat()
1633 old_softraw = atkbd->softraw; in atkbd_set_softrepeat()
1637 return -ENOMEM; in atkbd_set_softrepeat()
1639 atkbd->dev = new_dev; in atkbd_set_softrepeat()
1640 atkbd->softrepeat = value; in atkbd_set_softrepeat()
1641 if (atkbd->softrepeat) in atkbd_set_softrepeat()
1642 atkbd->softraw = true; in atkbd_set_softrepeat()
1645 err = input_register_device(atkbd->dev); in atkbd_set_softrepeat()
1649 atkbd->dev = old_dev; in atkbd_set_softrepeat()
1650 atkbd->softrepeat = old_softrepeat; in atkbd_set_softrepeat()
1651 atkbd->softraw = old_softraw; in atkbd_set_softrepeat()
1664 return sprintf(buf, "%d\n", atkbd->softraw ? 1 : 0); in atkbd_show_softraw()
1679 return -EINVAL; in atkbd_set_softraw()
1681 if (atkbd->softraw != value) { in atkbd_set_softraw()
1682 old_dev = atkbd->dev; in atkbd_set_softraw()
1683 old_softraw = atkbd->softraw; in atkbd_set_softraw()
1687 return -ENOMEM; in atkbd_set_softraw()
1689 atkbd->dev = new_dev; in atkbd_set_softraw()
1690 atkbd->softraw = value; in atkbd_set_softraw()
1693 err = input_register_device(atkbd->dev); in atkbd_set_softraw()
1697 atkbd->dev = old_dev; in atkbd_set_softraw()
1698 atkbd->softraw = old_softraw; in atkbd_set_softraw()
1710 return sprintf(buf, "%lu\n", atkbd->err_count); in atkbd_show_err_count()
1716 atkbd_platform_fixup_data = id->driver_data; in atkbd_setup_forced_release()
1723 atkbd_platform_scancode_fixup = id->driver_data; in atkbd_setup_scancode_fixup()
1759 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1767 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1775 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1783 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1791 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),