From 29497a73dd67bbfc7062570738aa8d7e026fd633 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Sat, 3 Sep 2022 12:48:03 +0100 Subject: CameraSensor: Don't fail to add camera with faulty lens If the CameraSensor fails to identify the VCM specified, it could still be possible to continue to operate the sensor. Autofocus support will be disabled, but this would be no different to operating a camera with a fixed focus. While of course the fixed focus position may not be suitable, it would provide a better user experience to be able to continue to operate the camera, while still reporting that the lens is disabled. Bug: https://bugs.libcamera.org/show_bug.cgi?id=146 Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/libcamera/camera_sensor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index d055c16a..911fd0be 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -467,8 +467,8 @@ int CameraSensor::discoverAncillaryDevices() ret = focusLens_->init(); if (ret) { LOG(CameraSensor, Error) - << "CameraLens initialisation failed"; - return ret; + << "Lens initialisation failed, lens disabled"; + focusLens_.reset(); } break; -- cgit v1.2.1