From patchwork Fri Mar 19 13:01:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11627 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 13922C32E1 for ; Fri, 19 Mar 2021 13:00:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 32FF968D6C; Fri, 19 Mar 2021 14:00:56 +0100 (CET) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8124168D61 for ; Fri, 19 Mar 2021 14:00:54 +0100 (CET) X-Originating-IP: 79.22.58.175 Received: from uno.homenet.telecomitalia.it (host-79-22-58-175.retail.telecomitalia.it [79.22.58.175]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id ADC48240007; Fri, 19 Mar 2021 13:00:53 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 19 Mar 2021 14:01:19 +0100 Message-Id: <20210319130120.141563-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210319130120.141563-1-jacopo@jmondi.org> References: <20210319130120.141563-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/3] libcamera: camera_sensor: Do not register Location if not available X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Do not register the Location property if not available from the firmware interface instead of defaulting it to External. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Reviewed-by: Paul Elder --- src/libcamera/camera_sensor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 27f82071151e..f7ed91d990f7 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()) {