libcamera  v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
Namespaces | Functions
sysfs.h File Reference

Miscellaneous utility functions to access sysfs. More...

#include <string>
Include dependency graph for sysfs.h:

Go to the source code of this file.

Namespaces

 libcamera
 Top-level libcamera namespace.
 

Functions

std::string libcamera::sysfs::charDevPath (const std::string &deviceNode)
 Retrieve the sysfs path for a character device. More...
 
std::string libcamera::sysfs::firmwareNodePath (const std::string &device)
 Retrieve the path of the firmware node for a device. More...
 

Detailed Description

Miscellaneous utility functions to access sysfs.

Function Documentation

◆ charDevPath()

std::string libcamera::sysfs::charDevPath ( const std::string &  deviceNode)

Retrieve the sysfs path for a character device.

Parameters
[in]deviceNodePath to character device node
Returns
The sysfs path on success or an empty string on failure

◆ firmwareNodePath()

std::string libcamera::sysfs::firmwareNodePath ( const std::string &  device)

Retrieve the path of the firmware node for a device.

Parameters
[in]devicePath in sysfs to search

Physical devices in a system are described by the system firmware. Depending on the type of platform, devices are identified using different naming schemes. The Linux kernel abstract those differences with "firmware nodes". This function retrieves the firmware node path corresponding to the device.

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.

Returns
The firmware node path on success or an empty string on failure