I have a Dell Latitude 7390 2-in-1 touchscreen laptop. I have installed PopOS 22.04 on it (based on Ubuntu 22.04 but with a higher kernel: 5.19.0). Now, whenever I put the laptop on suspend (say if I close the lid), then it randomly comes out of the suspend state and keeps consuming power.
To tackle this, I tried disabling all the wakeup devices (except the power button), using this:
for x in $(grep enabled /proc/acpi/wakeup | cut -f1 | grep -v PBTN)
do
echo $x | sudo tee /proc/acpi/wakeup
done
However, it has no effect. The laptop still comes out of the sleep/suspend state using a keyboard or by opening the lid. I want to enforce that it comes out of the sleep state ONLY using the power button.
UPDATE: Even when disabling all wakeup devices, it wakes up!
Even when I disable every wakeup device in /proc/acpi/wakeup
, the laptop still wakes up by pressing the keyboard key (even though it doesn't wake up when I open the lid or press the power button).
UPDATE: How to disable the accelerometer?
I noticed that if I shake the laptop, then also it wakes up! That is what's been happening a lot when I put it inside my backpack. This must be happening because of accelerometer wake-up. So, if I disable the accelerometer itself, then this problem should go away.
So, I pose an alternative question: How do I disable the accelerometer?
I should be able to unload the kernel modules for the relevant sensors using modprobe -r module_name
, however I am stuck in a Catch-22 situation. They each seem to have a dependency on each other, and some have unlisted dependencies. Here are a list of important sensors:
$ lsmod | grep sensor
Module Size Used by
hid_sensor_accel_3d 20480 1
hid_sensor_gyro_3d 20480 0
hid_sensor_magn_3d 20480 1
hid_sensor_custom_intel_hinge 16384 0
hid_sensor_rotation 20480 0
hid_sensor_incl_3d 20480 0
hid_sensor_trigger 20480 12 hid_sensor_gyro_3d,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation
industrialio_triggered_buffer 16384 1 hid_sensor_trigger
hid_sensor_iio_common 24576 7 hid_sensor_gyro_3d,hid_sensor_trigger,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation
industrialio 102400 11 industrialio_triggered_buffer,hid_sensor_gyro_3d,hid_sensor_trigger,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,kfifo_buf,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation
hid_sensor_custom 28672 0
hid_sensor_hub 28672 9 hid_sensor_gyro_3d,hid_sensor_trigger,hid_sensor_iio_common,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation,hid_sensor_custom
hid 155648 7 i2c_hid,wacom,usbhid,hid_multitouch,hid_sensor_hub,intel_ishtp_hid,hid_generic
Some of the sensors have listed a number in the "Used By" column (but not specifically which module is using them). Hence, unloading them fails. One such sensor is hid_sensor_accel_3d
which I wish to unload. But can't do it!
modinfo -F depends hid_sensor_accel_3d