[patch] Split up lid switch & power button in device tree
So I was trying out s2idle (coincidentally!) while proper suspend support is still pending, and while s2idle itself works fine, a couple things bothered me about the wakeup experience:
- The only way to wake the laptop is either via the power button or opening the lid, even though wakeup is enabled on the keyboard device. Probably has to do with USB power being cut. Not a big deal, but impacts the next two points.
- The lid switch and power button are on the same device, which means if you want to disable wakeup on one of them in sysfs at runtime, you have to disable both. Combined with the first point, this means disabling
gpio-keys
removes your ability to wake up the system at all. - Closing the lid triggers wakeup. As someone who doesn't care for lid switch<=>suspend functionality, this takes the previous point from "bearable" to "annoying". Plus it's just counterintuitive behavior.
This patch rectifies this by splitting gpio-keys
into power-key
and lid-switch
, and adds the wakeup-event-action
property to the lid switch. I also removed autorepeat because it doesn't really make sense.
Anecdote regarding s2idle: resume happens so quickly that logind catches the power key press used to resume, and (by default) immediately initiates a shutdown. This only applies when logind power key handling isn't inhibited (e.g. in a VT). It can be configured to ignore the power key if necessary, and it's certainly a logind bug that should be reported upstream, but it affects us so I wanted to note it here.
Cheers!