From patchwork Thu Mar 19 15:21:26 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: 6050661 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1783FBF90F for ; Thu, 19 Mar 2015 15:23:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26E4420525 for ; Thu, 19 Mar 2015 15:23:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 10A5B20519 for ; Thu, 19 Mar 2015 15:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751784AbbCSPVq (ORCPT ); Thu, 19 Mar 2015 11:21:46 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:36380 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbbCSPVj (ORCPT ); Thu, 19 Mar 2015 11:21:39 -0400 Received: by lbblx11 with SMTP id lx11so33130877lbb.3; Thu, 19 Mar 2015 08:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GLi+EZ4EP6RRCoBxprfAMiO/uwvs7Y1iX3Uw9uoPvUE=; b=zr1D9YuEwn49skxpUZdb5ZAE58d+Ks+m6sEgxJT6StNHw4bDU6o6hdVPP0LScib/in jfzZtfas4HVZYdj5gTI/svPuwdGiBR5Z4XTrPL0zeSw2lcaFmNZao0v3eUnu1i6Qm2KA R75AbHuF74ACccz7kr/RUoQwCn8BXBDkk72wCQ9rDERKpc8IC6AjR/4YOUYtq4UHn3gY ys4ww6BDJGxzmqBxY6+x0cDWh+JWR2lZx7BuHgXC/SBTThuz1zbPyCmaICDkuDGsSDHL pvTDLqgRIYthg6S06OB3gUw3wTpaZu3a/Qd3zUAtebCQjxFoJA2KYqdUVrKCP14icYQ1 E+7g== X-Received: by 10.112.219.196 with SMTP id pq4mr69455270lbc.104.1426778497134; Thu, 19 Mar 2015 08:21:37 -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 p7sm350623lap.18.2015.03.19.08.21.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 08:21:36 -0700 (PDT) From: Ricardo Ribalda Delgado To: 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 Cc: Ricardo Ribalda Delgado Subject: [PATCH 5/5] media/Documentation: New flag EXECUTE_ON_WRITE Date: Thu, 19 Mar 2015 16:21:26 +0100 Message-Id: <1426778486-21807-6-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426778486-21807-1-git-send-email-ricardo.ribalda@gmail.com> References: <1426778486-21807-1-git-send-email-ricardo.ribalda@gmail.com> 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 --- Documentation/DocBook/media/v4l/vidioc-dqevent.xml | 7 ++++--- Documentation/DocBook/media/v4l/vidioc-queryctrl.xml | 15 +++++++++++++-- Documentation/video4linux/v4l2-controls.txt | 4 +++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml index b036f89..38d907e 100644 --- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml +++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml @@ -318,9 +318,10 @@ 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 button control is pressed, then this event is sent as well, + even though there is not explicit value associated with a button + control. 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..d389292 100644 --- a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml +++ b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml @@ -599,8 +599,11 @@ writing a value will cause the device to carry out a given action This control is volatile, which means that the value of the control 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. +the lighting conditions which can change over time. Another example would be an error +flag (missed trigger, invalid voltage on the sensor). In those situations the user +could write to the control to acknowledge the error, but that write will never +generate a V4L2_EVENT_CTRL_CH_VALUE event and the flag +V4L2_CTRL_FLAG_EXECUTE_ON_WRITE must be set. V4L2_CTRL_FLAG_HAS_PAYLOAD @@ -610,6 +613,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 controls 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: