From patchwork Fri Mar 20 14:21:28 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: 6057281 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 7AEFA9F314 for ; Fri, 20 Mar 2015 14:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C23102049E for ; Fri, 20 Mar 2015 14:22:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA0DC2051D for ; Fri, 20 Mar 2015 14:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbCTOVg (ORCPT ); Fri, 20 Mar 2015 10:21:36 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:35993 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbbCTOVc (ORCPT ); Fri, 20 Mar 2015 10:21:32 -0400 Received: by lbblx11 with SMTP id lx11so54298522lbb.3; Fri, 20 Mar 2015 07:21:30 -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; bh=tAW1BSz5ALaBCDM67gA3Kwud0uCVrD4HRP9/N/OC2J4=; b=G6Ae0PyzqaAlcaZrUgi9kAXpT3l5YjfOYloZWa6TqkHKjmUwdVGIoGoHA+TGYQK4iM 7ZRcykLWkSeLGxHGckqAsqyTzSo4aAEiz29Gsi8PHqzRMkPHByjKlvhj+fcthzmbc6NI Ivlg4dcIIBSTZtavTUVC8Xs/EIjFWvicM73A4wRVukmx3lJdIz+pzfyw2gjOq4sIwUSq kL5uBpyid7P2SfvoucpgiMJcdcaRy8J+S/5Bv4eMQEjxScTHODbxzFyTR+1bPkkKY5Q7 4sMw44iHXVx7GhAxs5XMR0D1+rxgZ2yzORlkOq9fuUeaijimNkJa1HCaTPt+95UnreD1 B34w== X-Received: by 10.152.243.4 with SMTP id wu4mr73761422lac.33.1426861290503; Fri, 20 Mar 2015 07:21:30 -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 us1sm968951lbc.1.2015.03.20.07.21.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Mar 2015 07:21:29 -0700 (PDT) From: Ricardo Ribalda Delgado To: Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , Arun Kumar K , Sylwester Nawrocki , Sakari Ailus , Antti Palosaari , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v2 3/5] media/v4l2-ctrls: Add execute flags to write_only controls Date: Fri, 20 Mar 2015 15:21:28 +0100 Message-Id: <1426861288-5832-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 Any control that sets FLAG_WRITE_ONLY should OR it with FLAG_EXECUTE_ON_WRITE. So we can keep the current meaning of WRITE_ONLY. Signed-off-by: Ricardo Ribalda Delgado --- v2: Laurent Pinchart Fix commit message 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 2ebc33e..bacaed6 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 ||