nixos-hardware icon indicating copy to clipboard operation
nixos-hardware copied to clipboard

[SL5] - Lid switch not working, but it was working with a "normal" kernel...

Open TimoVerbrugghe opened this issue 1 year ago • 1 comments

Hi everyone,

First off: very deep appreciation for everything already done here :).

I have a Surface Laptop 5 running on nixos with the nixos microsoft-surface-common module. Everything working (this includes suspending and waking up with the power button) except when I close the lid, nothing happens.

The screen stays on (I can see the light bleed through the small gap) and while evtest does mention that there is a lid switch input, when running it and closing, it doesn't detect anything.

Funny thing though is that when running the standard 6.6 kernel from nixos 24.05 release, the lid closing actually does make the computer suspend (but then it doesn't wake up because well... not running the linux-surface kernel I guess).

I saw that this is handled by the surface_gpe kernel module, but I see with lsmod that it's not loaded and when I try to load it, I get the following error message in dmesg:

modprobe: ERROR: could not insert 'surface_gpe': No such device

and in dmesg:

surface_gpe: no compatible Microsoft Surface device found, exiting

I think it's because surface_gpe still has a separate sl5 branch which might include the fixes needed but isn't part of master: https://github.com/linux-surface/surface-gpe/tree/devices/sl5

  • Anything more I need to provide in terms of logs?
  • Anybody that can help me build this surface_gpe kernel module from the sl5 branch on nixos and test it? I know a bit of nix configuration but building out of tree kernel modules is a bit above my current knowledge...

TimoVerbrugghe avatar Oct 13 '24 00:10 TimoVerbrugghe