From patchwork Thu Mar 19 15:21:22 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: 6050591 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 81602BF910 for ; Thu, 19 Mar 2015 15:22:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FE4E203C0 for ; Thu, 19 Mar 2015 15:22:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8082320525 for ; Thu, 19 Mar 2015 15:22:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751607AbbCSPVo (ORCPT ); Thu, 19 Mar 2015 11:21:44 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:32892 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751183AbbCSPVf (ORCPT ); Thu, 19 Mar 2015 11:21:35 -0400 Received: by ladw1 with SMTP id w1so64895488lad.0; Thu, 19 Mar 2015 08:21:33 -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=Y3fbZnJKEa066+LxQTc6w08HbVR6Fc1jaX/IGo/Y7bQ=; b=U8wICGzafGQmWpEEODHA0cjdQ6twOx2wS7kx3LlLRZ9zOGqox1j84yWKEQ9icliSOn IhZ7hUycWYoxlCTgOkYMy2Dfk3gCvlRd/t9OeaStxDPIVbWM3QBEle14CG78pgcaVRlz KGHgVq2Ns43sii5yD5LabupsNi/JeVjFbzlruMvTHXnweofrLTdM6aUp/GrN60tnWnoH a74TZwNTE8p7mJR0S0vyexXOSeoNFYx2lAk0UlvvKXShtGdqq/XGvo28ii4D8LNEvyFp k6N3cRSlIUypLFrg/EYq+ywKO2CM6lQcrmcLK62UP1/Qp1l6mYqOO1pVYR6KwBLmmkIr AjBA== X-Received: by 10.112.137.164 with SMTP id qj4mr57253388lbb.17.1426778493296; Thu, 19 Mar 2015 08:21:33 -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.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 08:21:32 -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 1/5] media/v4l2-ctrls: volatiles should not generate CH_VALUE Date: Thu, 19 Mar 2015 16:21:22 +0100 Message-Id: <1426778486-21807-2-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 Volatile controls should not generate CH_VALUE events. Set has_changed to false to prevent this happening. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 45c5b47..627d4c7 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1609,6 +1609,15 @@ static int cluster_changed(struct v4l2_ctrl *master) if (ctrl == NULL) continue; + /* + * Set has_changed to false to avoid generating + * the event V4L2_EVENT_CTRL_CH_VALUE + */ + if (ctrl->flags & V4L2_CTRL_FLAG_VOLATILE){ + ctrl->has_changed = false; + continue; + } + for (idx = 0; !ctrl_changed && idx < ctrl->elems; idx++) ctrl_changed = !ctrl->type_ops->equal(ctrl, idx, ctrl->p_cur, ctrl->p_new);