From patchwork Tue Apr 29 12:59:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 885975 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E20742C1784; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; cv=none; b=qUt5tvczxDWGtk/3gf5JJ8le45eJmsTBfnTHYZWYWZ929u9BIVu17kvXadJPu1J/8fhxkzoPnltrSwKJEzKxEIt6wJcW6egkZxRUNqYEQenAZtj0qCuRVI9AS1IkLoml3bpsxwzUmdlSVxIaFFYimqNfYgZjtTFvEgPKHCSrg8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; c=relaxed/simple; bh=HDEsgaluUKEPdxixqt/Aekf5T3lFNnaVwddtdEWptfw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ISuAEK80SB0eV5RHUvvDAZhCNVHetTHIjApx4Nif2iRwMBLuf79vu3SHq7y/Ph7UAk2oBQturo2/qahJwoTERMoDbQlIuUJJxg1NbHEiEtdr8zac58GDepCsvPbfD4N0/U9000fuWgP0+4etdFnaR/pCOPP3wUze4d1lafosai8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=EtxJBdET; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="EtxJBdET" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5C2E0C4CEEB; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1745931556; bh=HDEsgaluUKEPdxixqt/Aekf5T3lFNnaVwddtdEWptfw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EtxJBdETblC80AUHOc6K/T3RWxhyzwH1JHkCdVlJN7/3VGTW4TOjhVDgwjaoRQxuP 244kQ8uJW0Nvay5XDj6VPpWBrowhmBNkWWoiAR7jdCsBawljFdMrJzOcLGXEF8mwV6 rEpKkGO5Vc1LyJbBRoKTkC+lDgxBqlj72PZUgcAU= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46D36C3ABB0; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) From: Richard Leitner Date: Tue, 29 Apr 2025 14:59:07 +0200 Subject: [PATCH v3 2/9] leds: flash: add support for flash/stobe duration Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250429-ov9282-flash-strobe-v3-2-2105ce179952@linux.dev> References: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> In-Reply-To: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> To: Sakari Ailus , Dave Stevenson , Mauro Carvalho Chehab , Lee Jones , Pavel Machek , Laurent Pinchart Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Richard Leitner X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745931554; l=2827; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=HDEsgaluUKEPdxixqt/Aekf5T3lFNnaVwddtdEWptfw=; b=6M/61HmZntl6x9awtwRbQFDQpMX+zbdz7fFVJ+CjaQLXInH1bRos1VW9t5D31eRmSUYhwouXc Gn9Y9mGn5X2A1cPjJxiEGSaLbzsnf9Ob5ImmdvMY2IkG8hN1YC+O7L+ X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 Add support for the new V4L2_CID_FLASH_DURATION control to the leds driver. Signed-off-by: Richard Leitner --- drivers/leds/led-class-flash.c | 15 +++++++++++++++ include/linux/led-class-flash.h | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/drivers/leds/led-class-flash.c b/drivers/leds/led-class-flash.c index f4e26ce84862c05092a9598e63ed301967852f13..165035a8826ca7d44a5cd265a5130a76c6e94347 100644 --- a/drivers/leds/led-class-flash.c +++ b/drivers/leds/led-class-flash.c @@ -440,6 +440,21 @@ int led_update_flash_brightness(struct led_classdev_flash *fled_cdev) } EXPORT_SYMBOL_GPL(led_update_flash_brightness); +int led_set_flash_duration(struct led_classdev_flash *fled_cdev, u32 duration) +{ + struct led_classdev *led_cdev = &fled_cdev->led_cdev; + struct led_flash_setting *s = &fled_cdev->duration; + + s->val = duration; + led_clamp_align(s); + + if (!(led_cdev->flags & LED_SUSPENDED)) + return call_flash_op(fled_cdev, duration_set, s->val); + + return 0; +} +EXPORT_SYMBOL_GPL(led_set_flash_duration); + MODULE_AUTHOR("Jacek Anaszewski "); MODULE_DESCRIPTION("LED Flash class interface"); MODULE_LICENSE("GPL v2"); diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h index 36df927ec4b7dcaf9074c6ef32ac8ce83a87a79d..21ec856c36bc67decda46aa8ff1c040ffdcf1181 100644 --- a/include/linux/led-class-flash.h +++ b/include/linux/led-class-flash.h @@ -45,6 +45,8 @@ struct led_flash_ops { int (*timeout_set)(struct led_classdev_flash *fled_cdev, u32 timeout); /* get the flash LED fault */ int (*fault_get)(struct led_classdev_flash *fled_cdev, u32 *fault); + /* set flash duration */ + int (*duration_set)(struct led_classdev_flash *fled_cdev, u32 duration); }; /* @@ -75,6 +77,9 @@ struct led_classdev_flash { /* flash timeout value in microseconds along with its constraints */ struct led_flash_setting timeout; + /* flash timeout value in microseconds along with its constraints */ + struct led_flash_setting duration; + /* LED Flash class sysfs groups */ const struct attribute_group *sysfs_groups[LED_FLASH_SYSFS_GROUPS_SIZE]; }; @@ -209,4 +214,15 @@ int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, u32 timeout); */ int led_get_flash_fault(struct led_classdev_flash *fled_cdev, u32 *fault); +/** + * led_set_flash_duration - set flash LED duration + * @fled_cdev: the flash LED to set + * @timeout: the flash duration to set it to + * + * Set the flash strobe duration. + * + * Returns: 0 on success or negative error value on failure + */ +int led_set_flash_duration(struct led_classdev_flash *fled_cdev, u32 duration); + #endif /* __LINUX_FLASH_LEDS_H_INCLUDED */ From patchwork Tue Apr 29 12:59:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 885974 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19DA32C2ACB; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; cv=none; b=jNK00nGcxG/DwO9N1oxedV3Nxa7OQAhWD+GSBqBW/jA8C/zjzT+RhCw5jCULlBO7m2yWvowAdI59ufLoeDNqKMrz7oQC6d6wmTOOHUyKR4qlX/fqSn/II94zHIrrQXQ6Wb8+HqbOBh6wyhlyZ3DAnhxPY7KkxZbT8q2hcbDx+6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; c=relaxed/simple; bh=bHa9DyU5pY4KwqBVVlo7OhSDU5Z0nzs/MOBy8JAQCk8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=boNxrzcWmcbSrKGiRNN5VRc+fK4cc2OvRz9tn3cnq394emldX2PPelbJaEhSQlaf/dncb4Z0JV2acsqchjbszpQkhwQyjEhFfa376XAF3iJvLkodMEDN5BCHBiteTeyCGMcdY/k5H3IoUmgr+JKnONBGNuS3HF/WdC744XcassU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=I8Zlxolk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="I8Zlxolk" Received: by smtp.kernel.org (Postfix) with ESMTPS id 64F5FC4CEE3; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1745931556; bh=bHa9DyU5pY4KwqBVVlo7OhSDU5Z0nzs/MOBy8JAQCk8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=I8ZlxolkPmnlRxzBImS4gkvuuZmnKUH3pwE+WkEhyPd77vJKJ4p5ugmwxZRnItG5U qsnXgP8KZQZtRZa4PaSa6YrjLzSj0xVl5QgD8t3wp3GAQ3YCzkYVVxxFDhv/9hIauo NWb8NEuCJmcPZX9RMGgCbWzX9ECU97snYSq720ro= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56723C3ABAF; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) From: Richard Leitner Date: Tue, 29 Apr 2025 14:59:08 +0200 Subject: [PATCH v3 3/9] media: v4l2-flash: add support for flash/strobe duration Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250429-ov9282-flash-strobe-v3-3-2105ce179952@linux.dev> References: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> In-Reply-To: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> To: Sakari Ailus , Dave Stevenson , Mauro Carvalho Chehab , Lee Jones , Pavel Machek , Laurent Pinchart Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Richard Leitner X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745931554; l=1581; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=bHa9DyU5pY4KwqBVVlo7OhSDU5Z0nzs/MOBy8JAQCk8=; b=hVLXrCC7H/khQgUUmgEY6fKTLCw2sfgTBSOK7fv5eNAhyCFTkDCcubJY6AF75MdxFRtdzZy2o yzE9BVZM+BTDwY3RokFPA6JAstT7f+XTi0dkNf5jgv//PoSkhrv764I X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 Add support for the new V4L2_CID_FLASH_DURATION control to the v4l2 flash led class. Signed-off-by: Richard Leitner --- drivers/media/v4l2-core/v4l2-flash-led-class.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-flash-led-class.c b/drivers/media/v4l2-core/v4l2-flash-led-class.c index 355595a0fefac72c2f6941a30fa430d37dbdccfe..963b549480f6eb3b9eb0d80696a764de7ffcc1a2 100644 --- a/drivers/media/v4l2-core/v4l2-flash-led-class.c +++ b/drivers/media/v4l2-core/v4l2-flash-led-class.c @@ -298,6 +298,12 @@ static int v4l2_flash_s_ctrl(struct v4l2_ctrl *c) * microamperes for flash intensity units. */ return led_set_flash_brightness(fled_cdev, c->val); + case V4L2_CID_FLASH_DURATION: + /* + * No conversion is needed as LED Flash class also uses + * microseconds for flash duration units. + */ + return led_set_flash_duration(fled_cdev, c->val); } return -EINVAL; @@ -424,6 +430,13 @@ static void __fill_ctrl_init_data(struct v4l2_flash *v4l2_flash, ctrl_cfg->flags = V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; } + + /* Init FLASH_DURATION ctrl data */ + if (has_flash_op(fled_cdev, timeout_set)) { + ctrl_init_data[FLASH_DURATION].cid = V4L2_CID_FLASH_DURATION; + ctrl_cfg = &ctrl_init_data[FLASH_DURATION].config; + __lfs_to_v4l2_ctrl_config(&fled_cdev->duration, ctrl_cfg); + ctrl_cfg->id = V4L2_CID_FLASH_DURATION; } static int v4l2_flash_init_controls(struct v4l2_flash *v4l2_flash, From patchwork Tue Apr 29 12:59:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 885973 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 826AE2D0291; Tue, 29 Apr 2025 12:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; cv=none; b=iMFi/6BUk6XR1Jbmy84LUV0qMKT7Ff1Kf6vjDGw2PW9MYzfOnjhAa+nowqlLB6IP+zOcUDcQfLMhfh4YmOlc+4kDfbVDk3/pIuHv/ukRW+buxoLjUqXOtxTNWi949Cy1kacEYbaLiH2IKbuTwmv5Xv7ZrlZZZj1aFQgWTDo00Lo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; c=relaxed/simple; bh=8XoXfLI3glbsttjIv49MTkNU8w73Ts/XjbKrGmMzkd0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZsUDxYxYbN9F/AMQ8jmBm8ucCaeCw7F83NHKmRDE07jlBHUqeOz8SZkpxfQ8kd4LF3dC5SrdzPg86Ip5Vft7AMHN3auYXZ4uWcreqELPcb/aT619od7n2loxy7OAcbb8gMQJWhFRcdARLmlrzdGRsgdYHKjCr2D7uno8WL9BCjM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=IO9CMbZJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="IO9CMbZJ" Received: by smtp.kernel.org (Postfix) with ESMTPS id 70CD8C113D0; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1745931556; bh=8XoXfLI3glbsttjIv49MTkNU8w73Ts/XjbKrGmMzkd0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IO9CMbZJhk2C+zZaHkRnoUfv64mmmJJWv/w5SnS2Dsv7nF+vzxf2p6jy7ElPizJfp R4br8lWuwtYkkz/dP+pO3m6o8QjhSws1a7OchYXH5GXZQjENRO+2brN7VJDPeauoW1 c792UomRuYVRILHsOvzDR03zW5rm4uWzWPvfRcOE= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63503C3ABB3; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) From: Richard Leitner Date: Tue, 29 Apr 2025 14:59:09 +0200 Subject: [PATCH v3 4/9] media: v4l2-flash: fix flash_timeout comment Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250429-ov9282-flash-strobe-v3-4-2105ce179952@linux.dev> References: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> In-Reply-To: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> To: Sakari Ailus , Dave Stevenson , Mauro Carvalho Chehab , Lee Jones , Pavel Machek , Laurent Pinchart Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Richard Leitner X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745931554; l=878; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=8XoXfLI3glbsttjIv49MTkNU8w73Ts/XjbKrGmMzkd0=; b=Vq8RYyKXTeDizbDIP7IUbAZFqHkLZBZKwFKb49hINPfxPyE8rYPfI2bTUFxoo8MoEliN3pWnG Fft5ZyMMDSPCKz+khm2gLoRnlV+FYf4fxgAgaVv5IJgEzrmHfWYSa9S X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 The comment for the flash_timeout setter mentioned it is the "flash duration". Fix this by changing it to "flash timeout". Signed-off-by: Richard Leitner --- include/linux/led-class-flash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h index 21ec856c36bc67decda46aa8ff1c040ffdcf1181..775a96217518936633541c7a5d394502dbf04f83 100644 --- a/include/linux/led-class-flash.h +++ b/include/linux/led-class-flash.h @@ -197,7 +197,7 @@ int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); * @fled_cdev: the flash LED to set * @timeout: the flash timeout to set it to * - * Set the flash strobe duration. + * Set the flash strobe timeout. * * Returns: 0 on success or negative error value on failure */ From patchwork Tue Apr 29 12:59:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 885972 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 827822D029B; Tue, 29 Apr 2025 12:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; cv=none; b=QKSTVkyQvdPgLQS4pE4L08wJYZNDD8qUCK9rD1btLBrqSMyzqkrgwhsb8WVQAWjoatf7192r3yrJvpmSweecJ1VN+Gt9cWW+p6PY+csnJLzAwdi9QZX4Fp5KP4/pci87fs8wdV7ZtqVjr1vDC3bPkMSWDdMCrdrxgxQ95dZCfn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; c=relaxed/simple; bh=16N0ehkJWytFD5jx5wDbSTZhtNf5Qf6vx2SOhlkAC1Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BJEODbAoGqoS8SbZ6PL0zbvpUhV6AlkCGYy+Je5/VjIrom6HDwPsDxCgM/1xR54u46XCx/O+9Q+djcy+Ux0AqeTJIdFFTAiHRWAs+8U/fU0k/+cOIyaYWK7x3xhHfIMUKApR1Wl9Jc3fgrj7VaqXpuVldJklcExdV0NkpbLKkgc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=JbekdOJw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="JbekdOJw" Received: by smtp.kernel.org (Postfix) with ESMTPS id 80DD3C19422; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1745931556; bh=16N0ehkJWytFD5jx5wDbSTZhtNf5Qf6vx2SOhlkAC1Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JbekdOJwB5KkfTAVZnMSOOO6KVy1H6HwF6VKcRVwVXOFunM+3RY6myhhlhg2hU/7F JdW4B/3S0cZC2c6ghkfiAaysIBglATaik/oewo6ILaWiGne7QN818AixQhkUM9h/+j BmkflqODYfw3m4/9Pajr0mRPMMWI+jE7VpODF8OQ= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7058EC3ABB2; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) From: Richard Leitner Date: Tue, 29 Apr 2025 14:59:10 +0200 Subject: [PATCH v3 5/9] Documentation: uAPI: media: add V4L2_CID_FLASH_DURATION Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250429-ov9282-flash-strobe-v3-5-2105ce179952@linux.dev> References: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> In-Reply-To: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> To: Sakari Ailus , Dave Stevenson , Mauro Carvalho Chehab , Lee Jones , Pavel Machek , Laurent Pinchart Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Richard Leitner X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745931554; l=1038; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=16N0ehkJWytFD5jx5wDbSTZhtNf5Qf6vx2SOhlkAC1Y=; b=wDEuqGzuAzAKafp77XME7C+1i7hnGJTO89QyQhr8UWvQwj2gMhQE+C5LSPSBLXfqY3CEcJ1b8 ++BLABez+d7B93WWQ0NEdUvzpbCac5Zq0fkIRqX/GwSy7FYbxSW1P9d X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 Add the new strobe_duration control to v4l uAPI documentation. Signed-off-by: Richard Leitner --- Documentation/userspace-api/media/v4l/ext-ctrls-flash.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-flash.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-flash.rst index d22c5efb806a183a3ad67ec3e6550b002a51659a..03a58ef94be7c870f55d5a9bb09503995dbfb402 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-flash.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-flash.rst @@ -186,3 +186,8 @@ Flash Control IDs charged before strobing. LED flashes often require a cooldown period after strobe during which another strobe will not be possible. This is a read-only control. + +``V4L2_CID_FLASH_DURATION (integer)`` + Duration the flash should be on when the flash LED is in flash mode + (V4L2_FLASH_LED_MODE_FLASH). The unit should be microseconds (µs) + if possible. From patchwork Tue Apr 29 12:59:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 885971 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 827E72D1901; Tue, 29 Apr 2025 12:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; cv=none; b=UGmjACTVayfTfgDoFV/rsmS3uvEK3oAXk1krF6YUsC4oWEyhBoAtmz32DpcOUu5xxmOZxc5+JLQ7p9if2nfpvceTBzGb73clF39dhHaJZmLg+5IlAI3ZCkg7ziSqzj5FhV5BI1q+cuG/vyCtQxh9FiWtZinWfDkkPmJuxs86l8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745931557; c=relaxed/simple; bh=XEA7eOKnFQPnS5jigwSOQXrETAAO0hBpVmtM8cu5xnQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RhTQl7y8x+TUAeH6UytlT3HqbeJKugBwT8h1iVXBoG1/7Ifvy8DF/u0sPrbQP4gv7tD6IA+0/R537VVf2QBspOiO+01fz/rWozmTQ49GyYKiiybMaUbReqPPzEzKlHTSs/phw7uZewFHHeAiTimxxcv5UgF1DpI5gpttA17uJfI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=H5axyzlz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="H5axyzlz" Received: by smtp.kernel.org (Postfix) with ESMTPS id C1254C2BC9E; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1745931556; bh=XEA7eOKnFQPnS5jigwSOQXrETAAO0hBpVmtM8cu5xnQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=H5axyzlzhcx9TtD2sC3uKQcmAWsDcx2DxglLDHqdqr8XZVcQRDPGHtEnTGR+3MACi 0EuplDnN6ZYfiuoYFdl+E0eRQG8XliK2TBVP0nB0SCgBn9zRhYUWpa5fu71jr6BTgZ /5LueXIpzQpKcMnMM2Q3n/PLvslSYhxkPAXtU9Hk= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6B9EC3ABB5; Tue, 29 Apr 2025 12:59:16 +0000 (UTC) From: Richard Leitner Date: Tue, 29 Apr 2025 14:59:14 +0200 Subject: [PATCH v3 9/9] media: i2c: ov9282: add strobe_source v4l2 control Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250429-ov9282-flash-strobe-v3-9-2105ce179952@linux.dev> References: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> In-Reply-To: <20250429-ov9282-flash-strobe-v3-0-2105ce179952@linux.dev> To: Sakari Ailus , Dave Stevenson , Mauro Carvalho Chehab , Lee Jones , Pavel Machek , Laurent Pinchart Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Richard Leitner X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745931554; l=1520; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=XEA7eOKnFQPnS5jigwSOQXrETAAO0hBpVmtM8cu5xnQ=; b=G943Q5rMrjMVhETxHQsNfxhFguRPkjvBIpdTCRSMAOGxjlQcMv3+Boxr4o2GjWUhOBi9+5JZ6 Ltei845X9whB6qJ45gzW850L1g4sbaFIqm312RqHYxMIOgZdS6cl8hf X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 Add read-only V4L2_CID_FLASH_STROBE_SOURCE control. Its value is fixed to V4L2_FLASH_STROBE_SOURCE_EXTERNAL as the camera sensor triggers the strobe based on its register settings. Signed-off-by: Richard Leitner --- drivers/media/i2c/ov9282.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 5ddbfc51586111fbd2e17b739fb3d28bfb0aee1e..34ea903a18dadeeebd497a4a8858abf12b598717 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -1367,6 +1367,7 @@ static int ov9282_init_controls(struct ov9282 *ov9282) struct v4l2_ctrl_handler *ctrl_hdlr = &ov9282->ctrl_handler; const struct ov9282_mode *mode = ov9282->cur_mode; struct v4l2_fwnode_device_properties props; + struct v4l2_ctrl *ctrl; u32 hblank_min; u32 lpfr; int ret; @@ -1446,6 +1447,13 @@ static int ov9282_init_controls(struct ov9282 *ov9282) v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops, V4L2_CID_FLASH_DURATION, 0, 13900, 1, 8); + ctrl = v4l2_ctrl_new_std_menu(ctrl_hdlr, &ov9282_ctrl_ops, + V4L2_CID_FLASH_STROBE_SOURCE, + V4L2_FLASH_STROBE_SOURCE_EXTERNAL, + ~(1 << V4L2_FLASH_STROBE_SOURCE_EXTERNAL), + V4L2_FLASH_STROBE_SOURCE_EXTERNAL); + ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; + ret = v4l2_fwnode_device_parse(ov9282->dev, &props); if (!ret) { /* Failure sets ctrl_hdlr->error, which we check afterwards anyway */