From 39efe737746d6da8e4819f41b6e4069c4b09d359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Mon, 3 Aug 2020 18:35:09 +0200 Subject: libcamera: sysfs: Add helper to lookup device firmware node path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A system's firmware description is recorded differently in sysfs depending if the system uses DT or ACPI. Add a helper to abstract this, allowing users not to care which of the two are used. For DT-based systems, the path is the full name of the DT node that represents the device. For ACPI-based systems, the path is the absolute namespace path to the ACPI object that represents the device. In both cases, the path is guaranteed to be unique and persistent as long as the system firmware is not modified. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/libcamera/internal/sysfs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/sysfs.h b/include/libcamera/internal/sysfs.h index 247a376a..bc6c1620 100644 --- a/include/libcamera/internal/sysfs.h +++ b/include/libcamera/internal/sysfs.h @@ -15,6 +15,8 @@ namespace sysfs { std::string charDevPath(const std::string &deviceNode); +std::string firmwareNodePath(const std::string &device); + } /* namespace sysfs */ } /* namespace libcamera */ -- cgit v1.2.1