From 4584f840e1aa9b07096637c95deee6585aad8df0 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Wed, 10 Apr 2019 13:54:46 +0800 Subject: [PATCH] mount-matrix: also read mount-matrix from in_accel_mount_matrix The IIO framework may also export mount matrix with sysfs filename in_accel_mount_matrix (when the type of this extinfo is set to be IIO_SHARED_BY_TYPE. Also try to read mount-matrix from this file. Signed-off-by: Icenowy Zheng --- src/accel-mount-matrix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/accel-mount-matrix.c b/src/accel-mount-matrix.c index c66b440..f4e1336 100644 --- a/src/accel-mount-matrix.c +++ b/src/accel-mount-matrix.c @@ -40,6 +40,16 @@ setup_mount_matrix (GUdevDevice *device) g_clear_pointer (&ret, g_free); } + mount_matrix = g_udev_device_get_sysfs_attr (device, "in_accel_mount_matrix"); + if (mount_matrix) { + if (parse_mount_matrix (mount_matrix, &ret)) + return ret; + + g_warning ("Failed to parse mount_matrix ('%s') from sysfs", + mount_matrix); + g_clear_pointer (&ret, g_free); + } + mount_matrix = g_udev_device_get_sysfs_attr (device, "mount_matrix"); if (mount_matrix) { if (parse_mount_matrix (mount_matrix, &ret)) -- 2.22.0