From 796fbdee57b57ce030e735ae02aba706e26bed6f Mon Sep 17 00:00:00 2001 From: Martin Juecker Date: Thu, 25 Sep 2025 22:38:07 +0200 Subject: [PATCH] device-samsung-p4note: adjust sensor mount matrix for iio-sensor-proxy There is currently two different ways to handle sensors, the Linux way which is taking earth as a starting point and then drawing a vector through the device, as well as the Windows way which takes the device as a starting point and drawing a vector towards earth. iio-sensor-proxy decided to go the Windows way, therefor the configuration needs to be flipped for the readings to produce the expected result. I created an issue with iio-sensor-proxy that goes into a bit more details, see #375. Part-of: --- device/testing/device-samsung-p4note/90-sensors.hwdb | 3 +++ device/testing/device-samsung-p4note/APKBUILD | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 device/testing/device-samsung-p4note/90-sensors.hwdb diff --git a/device/testing/device-samsung-p4note/90-sensors.hwdb b/device/testing/device-samsung-p4note/90-sensors.hwdb new file mode 100644 index 000000000..8ff2979c8 --- /dev/null +++ b/device/testing/device-samsung-p4note/90-sensors.hwdb @@ -0,0 +1,3 @@ +# this fixes the Windows style handling of sensors in iio-sensor-proxy, see issue #375 +sensor:modalias:of:*lsm330*:* + ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1 \ No newline at end of file diff --git a/device/testing/device-samsung-p4note/APKBUILD b/device/testing/device-samsung-p4note/APKBUILD index 64fdb00c3..8fdd39be8 100644 --- a/device/testing/device-samsung-p4note/APKBUILD +++ b/device/testing/device-samsung-p4note/APKBUILD @@ -1,7 +1,7 @@ # Reference: pkgname=device-samsung-p4note pkgdesc="Samsung Galaxy Note 10.1" -pkgver=4 +pkgver=5 pkgrel=0 url="https://postmarketos.org" license="MIT" @@ -18,7 +18,8 @@ subpackages="$pkgname-nonfree-firmware:nonfree_firmware" source=" deviceinfo audio/HiFi.conf - audio/p4note.conf" + audio/p4note.conf + 90-sensors.hwdb" build() { devicepkg_build $startdir $pkgname @@ -31,6 +32,8 @@ package() { -t "$pkgdir"/usr/share/alsa/ucm2/conf.d/p4note install -Dm644 "$srcdir"/p4note.conf \ -t "$pkgdir"/usr/share/alsa/ucm2/conf.d/p4note + install -Dm644 "$srcdir"/90-sensors.hwdb \ + -t "$pkgdir"/etc/udev/hwdb.d } nonfree_firmware() { @@ -47,4 +50,5 @@ sha512sums=" b51570c46435560265eea91adc41456ec29275d3f28c88c5d85ae59a066568e864b926f29cf7a852daf27ec79eb792fb2bbd87a2ddbf1ef2f84c6b282361c0df deviceinfo 40c2d13a8e59749a646e4070a444098609f62679f19a975da3f53b1a0fc4ac4c417dd86ec271a339e6a19c1737b384b759661d8f9a167c7eedc4a3ffbaffd77f HiFi.conf 2c5011f7d5f25362e6249624796a6d9d36d858169538ab9c4ab1a79f37ece95f425a92b14849a65fd9281c5567753158871c6bf20a772f8dca6b2d6813ea2f03 p4note.conf +af1dfc74ebec2f848d784c961c1b19eb1134aa62a0fd741903043466cfdec98d2c35c5b95738f63fcbdac6937e0b39be188b584b1f8cd45d98d295f32f2c882a 90-sensors.hwdb "