From 6ad3258cd34295611e871edf5e8474d4aa79af59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 4 Aug 2020 15:39:16 +0200 Subject: libcamera: sysfs: Add helper to lookup sysfs path of a character device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- include/libcamera/internal/sysfs.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/libcamera/internal/sysfs.h (limited to 'include/libcamera/internal/sysfs.h') diff --git a/include/libcamera/internal/sysfs.h b/include/libcamera/internal/sysfs.h new file mode 100644 index 00000000..247a376a --- /dev/null +++ b/include/libcamera/internal/sysfs.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020, Google Inc. + * + * sysfs.h - Miscellaneous utility functions to access sysfs + */ +#ifndef __LIBCAMERA_INTERNAL_SYSFS_H__ +#define __LIBCAMERA_INTERNAL_SYSFS_H__ + +#include + +namespace libcamera { + +namespace sysfs { + +std::string charDevPath(const std::string &deviceNode); + +} /* namespace sysfs */ + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_INTERNAL_SYSFS_H__ */ -- cgit v1.2.1