[libcamera-devel] [RFC PATCH 2/7] libcamera: camera_lens: add method to set controls on subdev
Matthias Fend
matthias.fend at emfend.at
Thu Feb 2 12:12:47 CET 2023
This method allows v4l2 controls to be set directly on the underlying
v4l2 subdevice.
Signed-off-by: Matthias Fend <matthias.fend at emfend.at>
---
include/libcamera/internal/camera_lens.h | 1 +
src/libcamera/camera_lens.cpp | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h
index 277417da..66c32a46 100644
--- a/include/libcamera/internal/camera_lens.h
+++ b/include/libcamera/internal/camera_lens.h
@@ -27,6 +27,7 @@ public:
int init();
int setFocusPosition(int32_t position);
+ int setSubdevControls(const ControlList &controls);
const std::string &model() const { return model_; }
diff --git a/src/libcamera/camera_lens.cpp b/src/libcamera/camera_lens.cpp
index b3d48199..c8fadda5 100644
--- a/src/libcamera/camera_lens.cpp
+++ b/src/libcamera/camera_lens.cpp
@@ -95,6 +95,16 @@ int CameraLens::setFocusPosition(int32_t position)
return 0;
}
+int CameraLens::setSubdevControls(const ControlList &controls)
+{
+ ControlList lensCtrls(controls);
+
+ if (subdev_->setControls(&lensCtrls))
+ return -EINVAL;
+
+ return 0;
+}
+
int CameraLens::validateLensDriver()
{
int ret = 0;
--
2.25.1
More information about the libcamera-devel
mailing list