mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
Kernel: Restore setting i8042 scan code set to scan code set 2 sequence
This seems to work perfectly OK on my ICH7 test machine and also it works on QEMU, so it is probably OK to restore this. This will ensure we always get scan code set 1 input, because we enable scan code set 2 and PS/2 translation on the first (keyboard) port.
This commit is contained in:
parent
0f7cc468b2
commit
3d87445c82
Notes:
sideshowbarker
2024-07-17 03:03:37 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/3d87445c82 Pull-request: https://github.com/SerenityOS/serenity/pull/15346 Reviewed-by: https://github.com/linusg
|
@ -176,6 +176,11 @@ UNMAP_AFTER_INIT ErrorOr<void> I8042Controller::detect_devices()
|
|||
configuration |= I8042ConfigurationFlag::FirstPS2PortClock;
|
||||
m_keyboard_device = nullptr;
|
||||
SpinlockLocker lock(m_lock);
|
||||
// NOTE: Before setting the actual scan code set, stop packet streaming entirely.
|
||||
TRY(send_command(HIDDevice::Type::Keyboard, I8042Command::DisablePacketStreaming));
|
||||
TRY(do_wait_then_write(I8042Port::Buffer, I8042Command::SetScanCodeSet));
|
||||
TRY(do_wait_then_write(I8042Port::Buffer, 0x2));
|
||||
|
||||
TRY(do_wait_then_write(I8042Port::Command, I8042Command::WriteConfiguration));
|
||||
TRY(do_wait_then_write(I8042Port::Buffer, configuration));
|
||||
} else {
|
||||
|
|
|
@ -34,6 +34,7 @@ enum I8042Command : u8 {
|
|||
GetDeviceID = 0xF2,
|
||||
SetSampleRate = 0xF3,
|
||||
EnablePacketStreaming = 0xF4,
|
||||
DisablePacketStreaming = 0xF5,
|
||||
SetDefaults = 0xF6,
|
||||
Reset = 0xFF,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue