From 285d36518682b2c7cf8b932af4e8be23cbc7f6fa Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 10 Mar 2021 10:42:57 +0100 Subject: libcamera: camera_sensor: Do not register Location if not available Do not register the Location property if not available from the firmware interface instead of defaulting it to External. Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/libcamera/camera_sensor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/libcamera/camera_sensor.cpp') diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 27f82071..f7ed91d9 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -468,12 +468,10 @@ int CameraSensor::initProperties() propertyValue = properties::CameraLocationBack; break; } + properties_.set(properties::Location, propertyValue); } else { - LOG(CameraSensor, Warning) - << "Failed to retrieve the camera location, setting to External"; - propertyValue = properties::CameraLocationExternal; + LOG(CameraSensor, Warning) << "Failed to retrieve the camera location"; } - properties_.set(properties::Location, propertyValue); const auto &rotationControl = controls.find(V4L2_CID_CAMERA_SENSOR_ROTATION); if (rotationControl != controls.end()) { -- cgit v1.2.1