mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
Revert "Kernel+Userland: Implement support for PS2 scan code set 2"
This reverts commit 61a385fc01
.
The commit broke the shift and caps lock key from working.
This commit is contained in:
parent
68b0826107
commit
d3025668a4
12 changed files with 440 additions and 982 deletions
|
@ -120,7 +120,7 @@ UNMAP_AFTER_INIT bool I8042Controller::check_existence_via_probing(Badge<HIDMana
|
|||
}
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT ErrorOr<void> I8042Controller::detect_devices(EnableKeyboardFirstPortTranslation enable_first_port_translation)
|
||||
UNMAP_AFTER_INIT ErrorOr<void> I8042Controller::detect_devices()
|
||||
{
|
||||
u8 configuration;
|
||||
{
|
||||
|
@ -135,13 +135,7 @@ UNMAP_AFTER_INIT ErrorOr<void> I8042Controller::detect_devices(EnableKeyboardFir
|
|||
configuration = TRY(do_wait_then_read_any_input(I8042Port::Buffer));
|
||||
configuration &= ~I8042ConfigurationFlag::FirstPS2PortInterrupt;
|
||||
configuration &= ~I8042ConfigurationFlag::SecondPS2PortInterrupt;
|
||||
|
||||
// FIXME: Don't enable translation for the first i8042 port if nothing is connected
|
||||
// or even worse - a mouse device, because we will get garbage data.
|
||||
if (enable_first_port_translation == EnableKeyboardFirstPortTranslation::Yes)
|
||||
configuration |= I8042ConfigurationFlag::FirstPS2PortTranslation;
|
||||
else
|
||||
configuration &= ~I8042ConfigurationFlag::FirstPS2PortTranslation;
|
||||
configuration |= I8042ConfigurationFlag::FirstPS2PortTranslation;
|
||||
|
||||
TRY(do_wait_then_write(I8042Port::Command, I8042Command::WriteConfiguration));
|
||||
TRY(do_wait_then_write(I8042Port::Buffer, configuration));
|
||||
|
@ -203,9 +197,7 @@ UNMAP_AFTER_INIT ErrorOr<void> I8042Controller::detect_devices(EnableKeyboardFir
|
|||
// FIXME: Actually figure out the connected PS2 device type
|
||||
m_first_ps2_port.device_type = PS2DeviceType::StandardKeyboard;
|
||||
auto keyboard_device = TRY(KeyboardDevice::try_to_initialize());
|
||||
// FIXME: Determine if the user wants to operate in scan code set 3.
|
||||
auto keyboard_device_scan_code_set = enable_first_port_translation == EnableKeyboardFirstPortTranslation::Yes ? ScanCodeSet::Set1 : ScanCodeSet::Set2;
|
||||
auto error_or_device = PS2KeyboardDevice::try_to_initialize(*this, I8042PortIndex::FirstPort, keyboard_device_scan_code_set, *keyboard_device);
|
||||
auto error_or_device = PS2KeyboardDevice::try_to_initialize(*this, I8042PortIndex::FirstPort, *keyboard_device);
|
||||
if (error_or_device.is_error()) {
|
||||
dbgln("I8042: Keyboard device failed to initialize, disable");
|
||||
m_first_port_available = false;
|
||||
|
|
|
@ -94,12 +94,7 @@ class I8042Controller final : public SerialIOController {
|
|||
public:
|
||||
static ErrorOr<NonnullRefPtr<I8042Controller>> create();
|
||||
|
||||
enum class EnableKeyboardFirstPortTranslation {
|
||||
Yes,
|
||||
No
|
||||
};
|
||||
ErrorOr<void> detect_devices(EnableKeyboardFirstPortTranslation);
|
||||
|
||||
ErrorOr<void> detect_devices();
|
||||
virtual ErrorOr<void> send_command(PortIndex, DeviceCommand command) override;
|
||||
virtual ErrorOr<void> send_command(PortIndex, DeviceCommand command, u8 data) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue