From patchwork Thu Feb 25 17:12:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11384 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 9F897BD808 for ; Thu, 25 Feb 2021 17:12:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 651D568A5C; Thu, 25 Feb 2021 18:12:14 +0100 (CET) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 184D268A50 for ; Thu, 25 Feb 2021 18:12:13 +0100 (CET) Received: from guri.fritz.box (p200300c7cf1cce00c495f7eb403f1d15.dip0.t-ipconnect.de [IPv6:2003:c7:cf1c:ce00:c495:f7eb:403f:1d15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 988BE1F46357; Thu, 25 Feb 2021 17:12:12 +0000 (GMT) From: Dafna Hirschfeld To: libcamera-devel@lists.libcamera.org Date: Thu, 25 Feb 2021 18:12:03 +0100 Message-Id: <20210225171205.23341-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225171205.23341-1-dafna.hirschfeld@collabora.com> References: <20210225171205.23341-1-dafna.hirschfeld@collabora.com> Subject: [libcamera-devel] [PATCH v2 1/3] libcamera: media_device: add hwRevision method 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: , Cc: kernel@collabora.com MIME-Version: 1.0 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a method 'hwRevision' to return the info.hw_version reported by the driver. Signed-off-by: Dafna Hirschfeld Reviewed-by: Paul Elder --- include/libcamera/internal/media_device.h | 2 ++ src/libcamera/media_device.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h index d0459cde..c3292508 100644 --- a/include/libcamera/internal/media_device.h +++ b/include/libcamera/internal/media_device.h @@ -41,6 +41,7 @@ public: const std::string deviceNode() const { return deviceNode_; } const std::string model() const { return model_; } unsigned int version() const { return version_; } + unsigned int hwRevision() const { return hwRevision_; } const std::vector &entities() const { return entities_; } MediaEntity *getEntityByName(const std::string &name) const; @@ -79,6 +80,7 @@ private: std::string deviceNode_; std::string model_; unsigned int version_; + unsigned int hwRevision_; int fd_; bool valid_; diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index de18d572..ec964948 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -231,6 +231,7 @@ int MediaDevice::populate() driver_ = info.driver; model_ = info.model; version_ = info.media_version; + hwRevision_ = info.hw_revision; /* * Keep calling G_TOPOLOGY until the version number stays stable.