{"id":16424,"url":"https://patchwork.libcamera.org/api/patches/16424/?format=json","web_url":"https://patchwork.libcamera.org/patch/16424/","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":"<20220629085722.11786-4-naush@raspberrypi.com>","date":"2022-06-29T08:57:21","name":"[libcamera-devel,v4,3/4] ipa: raspberrypi: imx477: Get sensor temperature from embedded data","commit_ref":"95151dd06feb1574090e13bdcaa69be25498dee9","pull_url":null,"state":"accepted","archived":false,"hash":"875e8690b818df4c8a535a46b90cba8ee50446e5","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16424/mbox/","series":[{"id":3231,"url":"https://patchwork.libcamera.org/api/series/3231/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3231","date":"2022-06-29T08:57:18","name":"Add SensorTemperature control","version":4,"mbox":"https://patchwork.libcamera.org/series/3231/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16424/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16424/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 0D1B6BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jun 2022 08:57:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B505A6563B;\n\tWed, 29 Jun 2022 10:57:33 +0200 (CEST)","from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2988760552\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jun 2022 10:57:30 +0200 (CEST)","by mail-wm1-x331.google.com with SMTP id\n\tl2-20020a05600c4f0200b0039c55c50482so11019812wmq.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jun 2022 01:57:30 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf15-20020a05600c154f00b003a032c88877sm2897102wmg.15.2022.06.29.01.57.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 29 Jun 2022 01:57:28 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656493053;\n\tbh=YTK5Noc2Q2lbhWo+rp4bSjy1UOV7qDRJES7u6OCqZJA=;\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=odmUpdFAxHoRaBeY4TYgQDaa77u8oUsdBbrJGDsoQ9WWl8oSn3GajKuEN73S6OTkP\n\tExTXnvvFS/csSELl+KcKlXQz8n51RwDUlQR4CNFBxdy7i2pBVZXG2YM5YlX7vrgXA9\n\tSLW8VHWuLcb2h4lJSRwcHFf4BzaTh4gMQU53AScRX840zfQi2jZUKUkkKiswKrZ3Gq\n\tY8A5tX55UENmP5Q0frzso75l6Z2O5M3QlDrfVZMFBBfH1+YmqGCzOA22G+WkhBN5c7\n\tyVhWkS7eNE4RiESIItedZxhrh2lUjVUZrYtalUT5cqdof7mJg1Pa16e5wICUGIPr3b\n\tbUTDxTY/S5zRw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=YqAxiP9TCv8odUus2VXRkdrejIzP2Ylpisi7DvbfMtc=;\n\tb=ApE8xHjBt6xqMMaqRfM4wLRC2WbeFrXaYdtu6d+Kwma/XQkfnu0lQ3UlJsF4m5c/2E\n\t4k53uZtS7Yn1V/DmnF0/f9SsVhSamjD5f638JYncqpQgB9mwnOZ0DGK1KqzVs69EWzU0\n\tcNugxS9ipeaGQzccl/yxYSoNAW5xFP17XRgl/USfQZRAOm3GSF9EowPcn12KOYcvBk+k\n\tCo5AuL17Os8pvee5cnSAl6YI7Za/HX6smYzHrjfOWezdQZ4QWtL4FQqhwrVHnImxbKtJ\n\txbT9C44uTRjuHxy1jNSFT43CKcEjtPqEnsfIEUV3NxlKo2RlPg8029v4bVQCrpWRf1zs\n\tPa3A=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"ApE8xHjB\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=YqAxiP9TCv8odUus2VXRkdrejIzP2Ylpisi7DvbfMtc=;\n\tb=UbrAP/soU6fc12+FMlbmIqLGE7afJ0iDvJp/kWQ4jIdhUnZIt5+rfG59X3OuR5Tp4a\n\t/D4OhY421xndDEo17osiUuF42z343yxwv0zgVjIMXfcOtTAuMabtaijhth+DeGjxgAE9\n\tqyH8Iv0jr7mA0E7tW8VFSqPGdvGNecOWcnfStzVWiZJ989NdBGWGUHkz0r1OJpToLVQA\n\tI2icJkS7qocjH9nlWmx1+aNe0eFt2JyBFGtdtCktxN7ozXpEakygyAQOusovd2lm1/Uq\n\tqhwX2Leb06aU6KsD3unnTAiEsMME79alkoBrF/PqROUYNj2Bvy9H0uAVqF1SdEKpnSr3\n\tOSLg==","X-Gm-Message-State":"AJIora+fYL2W22LyUFrOuPsCGBs1Gx+7ygkVDzuzW+HWxQ44hJIl73hi\n\tSNH6a3snqsyD2jhfuBjNORrUbaR1nBkhHCdK","X-Google-Smtp-Source":"AGRyM1s0fQviXlV1MbmGpdzRD1utZoJEVkLoOZPclN9kx0oHAEysU6F9VPmCidgt59Pa+gvHo2HSxw==","X-Received":"by 2002:a05:600c:4e54:b0:3a0:4e07:ce with SMTP id\n\te20-20020a05600c4e5400b003a04e0700cemr2470555wmq.37.1656493049462; \n\tWed, 29 Jun 2022 01:57:29 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 29 Jun 2022 09:57:21 +0100","Message-Id":"<20220629085722.11786-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220629085722.11786-1-naush@raspberrypi.com>","References":"<20220629085722.11786-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 3/4] ipa: raspberrypi: imx477: Get\n\tsensor temperature from embedded data","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Fetch the sensor temperature value from the embedded data buffer and add it to\nthe DeviceStatus structure in CamHelperImx477::PopulateMetadata().\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper_imx477.cpp | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp\nindex 338fdc0c416a..0e1c0dbd142f 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n@@ -5,6 +5,7 @@\n  * cam_helper_imx477.cpp - camera helper for imx477 sensor\n  */\n \n+#include <algorithm>\n #include <assert.h>\n #include <cmath>\n #include <stddef.h>\n@@ -34,8 +35,9 @@ constexpr uint32_t gainHiReg = 0x0204;\n constexpr uint32_t gainLoReg = 0x0205;\n constexpr uint32_t frameLengthHiReg = 0x0340;\n constexpr uint32_t frameLengthLoReg = 0x0341;\n+constexpr uint32_t temperatureReg = 0x013a;\n constexpr std::initializer_list<uint32_t> registerList =\n-\t{ expHiReg, expLoReg, gainHiReg, gainLoReg, frameLengthHiReg, frameLengthLoReg  };\n+\t{ expHiReg, expLoReg, gainHiReg, gainLoReg, frameLengthHiReg, frameLengthLoReg, temperatureReg  };\n \n class CamHelperImx477 : public CamHelper\n {\n@@ -171,6 +173,7 @@ void CamHelperImx477::PopulateMetadata(const MdParser::RegisterMap &registers,\n \tdeviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n \tdeviceStatus.analogue_gain = Gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg));\n \tdeviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n+\tdeviceStatus.sensor_temperature = std::clamp<int8_t>(registers.at(temperatureReg), -20, 80);\n \n \tmetadata.Set(\"device.status\", deviceStatus);\n }\n","prefixes":["libcamera-devel","v4","3/4"]}