summaryrefslogtreecommitdiff
path: root/src/libcamera/sysfs.cpp
AgeCommit message (Collapse)Author
2021-06-25libcamera/base: Move File to base libraryKieran Bingham
The File abstraction is a base helper and not part of the libcamera API. Move it to to allow usage by users of the base library. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-25libcamera/base: Move extended base functionalityKieran Bingham
Move the functionality for the following components to the new base support library: - BoundMethod - EventDispatcher - EventDispatcherPoll - Log - Message - Object - Signal - Semaphore - Thread - Timer While it would be preferable to see these split to move one component per commit, these components are all interdependent upon each other, which leaves us with one big change performing the move for all of them. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-01-13libcamera: sysfs: Fix directory exists checkNiklas Söderlund
The scope of File::exists() was changed to only validate that a file exists and is therefore not usable to check if a directory exists. This breaks the persistent name generation for DT based systems as it uses File::exists() to check for directories, fix this by using stat() directly. On Scarlet the persistent names of the cameras are impacted by this and where incorrectly reported as: $ cam -l Available cameras: 1: Internal front camera (platform/ff160000.i2c/i2c-7/7-003c ov2685) 2: Internal front camera (platform/ff160000.i2c/i2c-7/7-0036 ov5695 While the expected ones are restored with this fix: $ cam -l Available cameras: 1: Internal front camera (/base/i2c@ff160000/camera@3c) 2: Internal front camera (/base/i2c@ff160000/camera@36) Fixes: 8f4e16f014c820a0 ("test: file: Check that directories are not treated as files") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-20libcamera: Omit extra semicolonsHirokazu Honda
The end semicolons with LOG_DEFINE_CATEGORY, LOG_DECLARE_CATEGORY and REGISTER_PIPELINE_HANDLER are unnecessary. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-05libcamera: sysfs: Add helper to lookup device firmware node pathNiklas Söderlund
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>
2020-08-05libcamera: sysfs: Add helper to lookup sysfs path of a character deviceNiklas Söderlund
Add a helper function to lookup the sysfs path of a character device. Store the function in a new libcamera::sysfs namespace as there is not class to host it. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>