From patchwork Wed Apr 19 08:58:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 18540 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 5CA42C3274 for ; Wed, 19 Apr 2023 08:58:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AE2FF627C1; Wed, 19 Apr 2023 10:58:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1681894712; bh=xbimLW7IfavOO4wvlCRojtdOMlUfxGpZjZ0RbDIgzMM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=B822mngYtkiz+VItbAeATzVhY2TrJLC+oDZRa41xKFTwDGsVRbrUbYo2myq4kORKD S5UIaE/YEc8mCTEkCukGQxFyqA+275wH2eyqi9RSo015C3Jcq18xdl54r8+merLgrJ stqkx+HDcjSu8qahEKc9PexLVcfCwhlANARQnDybSpeLEr9AtxzU3iv2IXW88fuwQF fFYyfOW86BwGb5qY8htLHjDruNkRAgJOvLv3d6238FWY8z4qT2dgUpoZZV2aJakuaz V6pSdeB+oDIe0HaB3OSOD7X4g+286qIrd2wo9zsTY0BEaNdajq+6j2WQpWlDJbZJJh WpD852B0Uxifg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 97A3A627B1 for ; Wed, 19 Apr 2023 10:58:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="pRotODtG"; dkim-atps=neutral Received: from Monstersaurus.tail69b4.ts.net (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DFEFDF07; Wed, 19 Apr 2023 10:58:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1681894704; bh=xbimLW7IfavOO4wvlCRojtdOMlUfxGpZjZ0RbDIgzMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pRotODtGocr/mJliAl0hJhw+nAPXPe9oS2EwJaTQ5TDbrM5cCGcl6pyM86S3OM2F/ WHSKK9puGNoBT+oVPbImY/xk3npLdruO0SQDAbkPUT6NB3FUQDiRhMnDHLekeOqGaI +pEt0viKA4Z3T0LQA1h0y3an906+nrJuU9WOLM0A= To: libcamera devel Date: Wed, 19 Apr 2023 09:58:19 +0100 Message-Id: <20230419085821.2682901-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419085821.2682901-1-kieran.bingham@ideasonboard.com> References: <20230419085821.2682901-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] libcamera: controls: Support dev_t in an Integer32 type. 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: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Allow dev_t device numbers to be stored in a ControlValue utilising the space of a 32 bit integer. Signed-off-by: Kieran Bingham --- Note that dev_t is typedef'd as an unsigned long, and this allows all unsigned long types to be mapped to a ControlTypeInteger32. I'm not sure I like that bit, so I'm very open to ideas and suggestions here. Ideally without having to duplicate the devnum vector just after it's created, just to retype it. include/libcamera/controls.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index cf94205577a5..84033babbcd5 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -62,6 +62,11 @@ struct control_type { static constexpr ControlType value = ControlTypeInteger32; }; +template<> +struct control_type { + static constexpr ControlType value = ControlTypeInteger32; +}; + template<> struct control_type { static constexpr ControlType value = ControlTypeInteger64;