From patchwork Thu Mar 19 15:21:24 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: 6050681 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 D0BD49F2A9 for ; Thu, 19 Mar 2015 15:23:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 095502052C for ; Thu, 19 Mar 2015 15:23:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D60720525 for ; Thu, 19 Mar 2015 15:23:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbbCSPVj (ORCPT ); Thu, 19 Mar 2015 11:21:39 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:33439 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782AbbCSPVg (ORCPT ); Thu, 19 Mar 2015 11:21:36 -0400 Received: by lbnq5 with SMTP id q5so27181099lbn.0; Thu, 19 Mar 2015 08:21:35 -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=gRNqW2Okd/Yvpeh5RaFg8YnYI461xVo3/hr89ICZUEk=; b=joxb7Rxx7ihyFDUixWI3qfDCA0FyM/D6c3+RiTyv8o4Y7WGWBmSHV+d4b/IjKbYrz6 3S3jcYNY6ki8CRhLqjxGhPupu35Yhru5C9WaiyzJ1lvxm+2pDLp1zhbCXKbTQos9v60Z DOKX/70E1FmibECnN3LQRz95HxvEk/GcYyGYCbl+P6lTr8D0QRMLN7W9HZFJljKwUOUa 8lWUgteeAMm+40O1dmhVrU6RXsks06GAXVJxj+6sSxmjG43qyHm++wmlzkIH8EpxzRus 6Yb0LgW+Nt7dIaP/KVtx670BJyxi109+orFBHEkVykmSzhVFI6Lw3WjceAVbkp1tUbie flOQ== X-Received: by 10.112.151.2 with SMTP id um2mr19323743lbb.31.1426778495197; Thu, 19 Mar 2015 08:21:35 -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.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 08:21:34 -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 3/5] media/v4l2-ctrls: Add execute flags to write_only controls Date: Thu, 19 Mar 2015 16:21:24 +0100 Message-Id: <1426778486-21807-4-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=ham 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 Any control that sets FLAG_WRITE_ONLY should OR it with FLAG_ACTION. So we can keep the current meaning of WRITE_ONLY. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/v4l2-core/v4l2-ctrls.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 627d4c7..da0ffd3 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -991,7 +991,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_AUTO_FOCUS_START: case V4L2_CID_AUTO_FOCUS_STOP: *type = V4L2_CTRL_TYPE_BUTTON; - *flags |= V4L2_CTRL_FLAG_WRITE_ONLY; + *flags |= V4L2_CTRL_FLAG_WRITE_ONLY | + V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; *min = *max = *step = *def = 0; break; case V4L2_CID_POWER_LINE_FREQUENCY: @@ -1172,7 +1173,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_FOCUS_RELATIVE: case V4L2_CID_IRIS_RELATIVE: case V4L2_CID_ZOOM_RELATIVE: - *flags |= V4L2_CTRL_FLAG_WRITE_ONLY; + *flags |= V4L2_CTRL_FLAG_WRITE_ONLY | + V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; break; case V4L2_CID_FLASH_STROBE_STATUS: case V4L2_CID_AUTO_FOCUS_STATUS: @@ -1983,7 +1985,8 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl, sz_extra = 0; if (type == V4L2_CTRL_TYPE_BUTTON) - flags |= V4L2_CTRL_FLAG_WRITE_ONLY; + flags |= V4L2_CTRL_FLAG_WRITE_ONLY | + V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; else if (type == V4L2_CTRL_TYPE_CTRL_CLASS) flags |= V4L2_CTRL_FLAG_READ_ONLY; else if (type == V4L2_CTRL_TYPE_INTEGER64 ||