@@ -27,6 +27,7 @@ public:
int init();
int setFocusPosition(int32_t position);
+ int getMaxFocusStep();
const std::string &model() const { return model_; }
@@ -95,6 +95,19 @@ int CameraLens::setFocusPosition(int32_t position)
return 0;
}
+/**
+ * \brief Get maximum lens steps
+ * \return The maximum lens steps.
+ */
+int CameraLens::getMaxFocusStep()
+{
+ const ControlInfoMap &infoMap_ = subdev_->controls();
+ const ControlInfo devInfo = infoMap_.find(V4L2_CID_FOCUS_ABSOLUTE)->second;
+ int32_t maxFocus = devInfo.max().get<int32_t>();
+
+ return maxFocus;
+}
+
int CameraLens::validateLensDriver()
{
int ret = 0;
It allows other components to get the maximum VCM steps. It get the device information from subdev and return it's maximum value. Signed-off-by: Kate Hsuan<hpa@redhat.com> --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+)