From patchwork Fri Mar 20 14:13:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 6057031 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0011A9F314 for ; Fri, 20 Mar 2015 14:13:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E325820522 for ; Fri, 20 Mar 2015 14:13:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB53F203F4 for ; Fri, 20 Mar 2015 14:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159AbbCTON2 (ORCPT ); Fri, 20 Mar 2015 10:13:28 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:35760 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564AbbCTONY (ORCPT ); Fri, 20 Mar 2015 10:13:24 -0400 Received: by lbcgn8 with SMTP id gn8so76147729lbc.2; Fri, 20 Mar 2015 07:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=Q155JuTR4By7U1jQAVuUKe5IS+NnHbC2xwnLw/FoRtg=; b=MQv5w/HkD5dvogpSXHBBrpPj3vU4Hxos6T0p8vJnQ37ZU0Qx8Myx/HQ661ueqOIR/0 0d/0Ytj8FCMP5rRBTJyDMOKs+S+0X5V6xYrrziNcX//fwCJovRXn1TWvrzZtWuuaFH30 yixsyk7XGgTQBo7nPQmJMkBPOdDZai80eXTXfO/lixXVBTOrjDBs/TiwLYcoHxzJaU8+ HdUwgw1yVCgMNQeFs7OBxgY9/FaxvtBfwzzauSvAUi0w9tGErPOyJcH9/LEZmy/UPYU6 Y8ohthU2VwzZju3J60UwKJP1ZjPAg9HlrKcJ+sSnzKLVxqYUIkfYJAkKmMLD5goUCgdi 0iuQ== X-Received: by 10.112.141.106 with SMTP id rn10mr23741875lbb.100.1426860802631; Fri, 20 Mar 2015 07:13:22 -0700 (PDT) Received: from neopili.fritz.box (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by mx.google.com with ESMTPSA id dy8sm962499lac.13.2015.03.20.07.13.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Mar 2015 07:13:22 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , Ricardo Ribalda Delgado , Hans Verkuil , Mauro Carvalho Chehab , Arun Kumar K , Sylwester Nawrocki , Sakari Ailus , Antti Palosaari , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Laurent Pinchart Subject: [PATCH v2 5/5] media/Documentation: New flag EXECUTE_ON_WRITE Date: Fri, 20 Mar 2015 15:13:14 +0100 Message-Id: <1426860794-5026-1-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Document new flag V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and the new behavior of CH_VALUE event on VOLATILE controls. Signed-off-by: Ricardo Ribalda Delgado --- v2: Hans Verkuil Fix documentation (Thanks Hans!) Documentation/DocBook/media/v4l/vidioc-dqevent.xml | 6 +++--- Documentation/DocBook/media/v4l/vidioc-queryctrl.xml | 12 +++++++++++- Documentation/video4linux/v4l2-controls.txt | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml index b036f89..b7a6b42 100644 --- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml +++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml @@ -318,9 +318,9 @@ V4L2_EVENT_CTRL_CH_VALUE 0x0001 This control event was triggered because the value of the control - changed. Special case: if a button control is pressed, then this - event is sent as well, even though there is not explicit value - associated with a button control. + changed. Special cases: Volatile controls do no generate this event; + If a control has the V4L2_CTRL_FLAG_EXECUTE_ON_WRITE + flag set, then this event is sent as well, regardless its value. V4L2_EVENT_CTRL_CH_FLAGS diff --git a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml index 2bd98fd..dc83ad7 100644 --- a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml +++ b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml @@ -600,7 +600,9 @@ writing a value will cause the device to carry out a given action changes continuously. A typical example would be the current gain value if the device is in auto-gain mode. In such a case the hardware calculates the gain value based on the lighting conditions which can change over time. Note that setting a new value for -a volatile control will have no effect. The new value will just be ignored. +a volatile control will have no effect and no V4L2_EVENT_CTRL_CH_VALUE +will be sent, unless the V4L2_CTRL_FLAG_EXECUTE_ON_WRITE flag +(see below) is also set. Otherwise the new value will just be ignored. V4L2_CTRL_FLAG_HAS_PAYLOAD @@ -610,6 +612,14 @@ using one of the pointer fields of &v4l2-ext-control;. This flag is set for cont that are an array, string, or have a compound type. In all cases you have to set a pointer to memory containing the payload of the control. + + V4L2_CTRL_FLAG_EXECUTE_ON_WRITE + 0x0200 + The value provided to the control will be propagated to the driver +even if remains constant. This is required when the control represents an action +on the hardware. For example: clearing an error flag or triggering the flash. All the +controls of the type V4L2_CTRL_TYPE_BUTTON have this flag set. + diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt index 0f84ce8..5517db6 100644 --- a/Documentation/video4linux/v4l2-controls.txt +++ b/Documentation/video4linux/v4l2-controls.txt @@ -344,7 +344,9 @@ implement g_volatile_ctrl like this: } Note that you use the 'new value' union as well in g_volatile_ctrl. In general -controls that need to implement g_volatile_ctrl are read-only controls. +controls that need to implement g_volatile_ctrl are read-only controls. If they +are not, a V4L2_EVENT_CTRL_CH_VALUE will not be generated when the control +changes. To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE: