libcamera: sysfs: Add helper to lookup device firmware node path

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 <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund 2020-08-03 18:35:09 +02:00
parent 6ad3258cd3
commit 39efe73774
2 changed files with 60 additions and 0 deletions

View file

@ -15,6 +15,8 @@ namespace sysfs {
std::string charDevPath(const std::string &deviceNode);
std::string firmwareNodePath(const std::string &device);
} /* namespace sysfs */
} /* namespace libcamera */