From patchwork Tue May 24 11:45:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16010 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 6122CC326D for ; Tue, 24 May 2022 11:46:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 39E7E65678; Tue, 24 May 2022 13:46:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653392797; bh=J82y7/1hXVMiwHUAH2A1Gwma14uw5Jc//aizDlp0V5U=; 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=XutE+9veGd7UuRxKNeVOHptHTjhY0DEUCsnLAMo1Q3bGljM7EKCgbaVo7Ojj9kpb6 sGsOGrPLANiciTEm6mrvQbJwjf+/u9wAksffcfJeZaiyfACYh31ET696/EAyPJuMi1 va5f47prpHUkDZIOP171ZXfwti5jhsmVNkBP8Q57eT8XnmHQgDLIHeNTSjFRBswsF7 VlgB+eTj49RpZSnrtMuD27dHxuX4l7nOeYYpvGGFPah8SVpXpAZAzGXJuDrt4bfZuw 8MRo5s7u9ugFkkIS4tGmL6Yk9VTNaTnVZohuDOWkNY/U1GKNPGu53YvQ4wsLICibaM qzdoCeVEvePnQ== 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 1473465666 for ; Tue, 24 May 2022 13:46:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="I0H1K9zq"; dkim-atps=neutral Received: from deskari.lan (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7CAA4AEC; Tue, 24 May 2022 13:46:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1653392791; bh=J82y7/1hXVMiwHUAH2A1Gwma14uw5Jc//aizDlp0V5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0H1K9zqHtG5xJhQznh4wO4RH8WO8z+5rGLivtTK4A65Sk+/wgt2ACXo3qOCn3DIh /4a2V/b842oBg86chnaSNLZgz8/RTJhhmaKGdh/UUcpeLl1W1We1gTxNBmE2shOvwl QRAgSwwOXETdOjrWsXQBYJwRVrAiJohAHfjXDzHo= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Tue, 24 May 2022 14:45:55 +0300 Message-Id: <20220524114610.41848-5-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220524114610.41848-1-tomi.valkeinen@ideasonboard.com> References: <20220524114610.41848-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 04/19] py: Fix SceneFlicker enum values 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: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Stripping 'SceneFlicker' prefix from the enum value names leads to '50Hz' and '60Hz', which are not valid names. So add another heuristics to keep the prefix for SceneFlicker. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- src/py/libcamera/gen-py-control-enums.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/py/libcamera/gen-py-control-enums.py b/src/py/libcamera/gen-py-control-enums.py index dcc28b1a..6b2b5362 100755 --- a/src/py/libcamera/gen-py-control-enums.py +++ b/src/py/libcamera/gen-py-control-enums.py @@ -42,6 +42,9 @@ def generate_py(controls): if name == 'LensShadingMapMode': prefix = 'LensShadingMapMode' + elif name == 'SceneFlicker': + # If we strip the prefix, we would get '50Hz', which is illegal name + prefix = '' else: prefix = find_common_prefix([e['name'] for e in enum])