{"id":15710,"url":"https://patchwork.libcamera.org/api/patches/15710/?format=json","web_url":"https://patchwork.libcamera.org/patch/15710/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220426055830.8999-3-hpa@redhat.com>","date":"2022-04-26T05:58:28","name":"[libcamera-devel,v3,2/4] libcamera: camera_lens: Get maximum VCM steps","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7d36161817841c7de2fc253062645259b4439d6e","submitter":{"id":105,"url":"https://patchwork.libcamera.org/api/people/105/?format=json","name":"Kate Hsuan","email":"hpa@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15710/mbox/","series":[{"id":3069,"url":"https://patchwork.libcamera.org/api/series/3069/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3069","date":"2022-04-26T05:58:27","name":"Enabling AF algorithm to get the VCM attributes from the device driver","version":3,"mbox":"https://patchwork.libcamera.org/series/3069/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15710/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15710/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id ECC84C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Apr 2022 05:59:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8FF1065647;\n\tTue, 26 Apr 2022 07:59:35 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 123C86042D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Apr 2022 07:59:33 +0200 (CEST)","from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n\t[66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-161-NMffx9V5MAGcjZNYqJID9g-1; Tue, 26 Apr 2022 01:59:31 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9CABC811E80\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Apr 2022 05:59:16 +0000 (UTC)","from fedora.redhat.com (unknown [10.39.192.178])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 847FD111DCFC;\n\tTue, 26 Apr 2022 05:59:06 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650952775;\n\tbh=F2y+L6vE3qfEbBj7N92mo37hhxc8Nd5vp5+8wcu29mw=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=oDrh7bhXKdw1Cx1BorXN2ad/cmXTxI1ERfvYMamMiQd1kff5TK6Be0p+2/fOf7qCG\n\tpjap0LHpLoNhSYHLRzC8oSlRYlbNaYnBzgbbCog/2h0+P3p9mnoWGqPipEAbbhwHNJ\n\tgWcl9myEcZruVTrQoXZ7xKxJJ6PzOtyLeVuGMmYINOoBQmez3YQzNjD/9y5lrWhguK\n\ttwC2ZrRUJMf7Gewkeqmg4xTLXOMRBmqH6M0aXnrlFDsAg/p/Zj91Zj3CjO1Lu7usg3\n\t6s9xTciXRO3PHia+palz0A/Lg0j+DZFfB12YZypmJMfsHwRxU71CldkSmtOgD4MG3z\n\tloIxOZI0Y46Hw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1650952773;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=lGfsVSJOvG0lJQ4ZxO5jD55efCr/5Wy/6avz9J/1qi0=;\n\tb=SU5Gq4b0lJyaRsY0ThdB/rSY/DZ7SHtvDHAJFV7JzR5a9YEkW5tJFPmzRl46HyUIeCNusM\n\t2dOvFw0REO0Ormwl/ANdA/X7J+mBltn2TYgr765nKinTEPMEq6B9IywBfdZkzqMmh1E/d8\n\tS/+EHxsZPD6zR+IS6+xmACwa33sH/NU="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"SU5Gq4b0\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com"],"X-MC-Unique":"NMffx9V5MAGcjZNYqJID9g-1","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 26 Apr 2022 13:58:28 +0800","Message-Id":"<20220426055830.8999-3-hpa@redhat.com>","In-Reply-To":"<20220426055830.8999-1-hpa@redhat.com>","References":"<20220426055830.8999-1-hpa@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 2.78 on 10.11.54.3","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/4] libcamera: camera_lens: Get\n\tmaximum VCM steps","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kate Hsuan via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Kate Hsuan <hpa@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"It allows other components to get the maximum VCM steps. It get the device\ninformation from subdev and return it's maximum value.\n\nSigned-off-by: Kate Hsuan<hpa@redhat.com>\n---\n include/libcamera/internal/camera_lens.h |  1 +\n src/libcamera/camera_lens.cpp            | 13 +++++++++++++\n 2 files changed, 14 insertions(+)","diff":"diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h\nindex 277417da..84b3c884 100644\n--- a/include/libcamera/internal/camera_lens.h\n+++ b/include/libcamera/internal/camera_lens.h\n@@ -27,6 +27,7 @@ public:\n \n \tint init();\n \tint setFocusPosition(int32_t position);\n+\tint getMaxFocusStep();\n \n \tconst std::string &model() const { return model_; }\n \ndiff --git a/src/libcamera/camera_lens.cpp b/src/libcamera/camera_lens.cpp\nindex b3d48199..b9810551 100644\n--- a/src/libcamera/camera_lens.cpp\n+++ b/src/libcamera/camera_lens.cpp\n@@ -95,6 +95,19 @@ int CameraLens::setFocusPosition(int32_t position)\n \treturn 0;\n }\n \n+/**\n+ * \\brief Get maximum lens steps\n+ * \\return The maximum lens steps.\n+ */\n+int CameraLens::getMaxFocusStep()\n+{\n+\tconst ControlInfoMap &infoMap_ = subdev_->controls();\n+\tconst ControlInfo devInfo = infoMap_.find(V4L2_CID_FOCUS_ABSOLUTE)->second;\n+\tint32_t maxFocus = devInfo.max().get<int32_t>();\n+\n+\treturn maxFocus;\n+}\n+\n int CameraLens::validateLensDriver()\n {\n \tint ret = 0;\n","prefixes":["libcamera-devel","v3","2/4"]}