From patchwork Thu Mar 18 12:55:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11622 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 B713DC32E1 for ; Thu, 18 Mar 2021 12:54:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7E74368D68; Thu, 18 Mar 2021 13:54:57 +0100 (CET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 976DC602DB for ; Thu, 18 Mar 2021 13:54: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 relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 0C7191BF204; Thu, 18 Mar 2021 12:54:53 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Thu, 18 Mar 2021 13:55:20 +0100 Message-Id: <20210318125521.43278-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210318125521.43278-1-jacopo@jmondi.org> References: <20210318125521.43278-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] 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. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- 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()) {