summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86_64/ISABus
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Arch/x86_64/ISABus')
-rw-r--r--Kernel/Arch/x86_64/ISABus/I8042Controller.cpp5
-rw-r--r--Kernel/Arch/x86_64/ISABus/I8042Controller.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/Arch/x86_64/ISABus/I8042Controller.cpp b/Kernel/Arch/x86_64/ISABus/I8042Controller.cpp
index f4ceeea04e..3b80df2cb1 100644
--- a/Kernel/Arch/x86_64/ISABus/I8042Controller.cpp
+++ b/Kernel/Arch/x86_64/ISABus/I8042Controller.cpp
@@ -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 {
diff --git a/Kernel/Arch/x86_64/ISABus/I8042Controller.h b/Kernel/Arch/x86_64/ISABus/I8042Controller.h
index e62b5517a3..c73997150b 100644
--- a/Kernel/Arch/x86_64/ISABus/I8042Controller.h
+++ b/Kernel/Arch/x86_64/ISABus/I8042Controller.h
@@ -34,6 +34,7 @@ enum I8042Command : u8 {
GetDeviceID = 0xF2,
SetSampleRate = 0xF3,
EnablePacketStreaming = 0xF4,
+ DisablePacketStreaming = 0xF5,
SetDefaults = 0xF6,
Reset = 0xFF,
};