Tested on: HP Envy x360 2-in-1 Laptop 15-fh0xxx, Ubuntu with GNOME on Wayland.
The AMD Sensor Fusion Hub (SFH) driver loads on boot before the PCIe hardware is fully ready, causing it to miss the accelerometer. The fix is to force the correct sensor mask and reload the module before the display manager starts.
1. Create a modprobe config to set the sensor mask:
sudo mkdir -p /etc/modprobe.d/
echo "options amd_sfh sensor_mask=1" | sudo tee /etc/modprobe.d/amd_sfh.conf
sudo update-initramfs -u2. Create a systemd service to reload the module before GNOME starts:
sudo nano /etc/systemd/system/amd-sfh-fix.service[Unit]
Description=Fix AMD SFH (accelerometer) sensor mask
Before=display-manager.service
After=systemd-udev-settle.service
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'modprobe -r amd_sfh; sleep 2; modprobe amd_sfh'
RemainAfterExit=yes
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable amd-sfh-fix.service
sudo rebootAfter reboot, iio-sensor-proxy should automatically detect the accelerometer and GNOME extensions like Screen Rotate will work.