From patchwork Fri Mar 20 13:30:46 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: 6056591 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 D84D89F314 for ; Fri, 20 Mar 2015 13:31:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29EE1204E3 for ; Fri, 20 Mar 2015 13:31:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C00C2051D for ; Fri, 20 Mar 2015 13:31:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbbCTNax (ORCPT ); Fri, 20 Mar 2015 09:30:53 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:34312 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750870AbbCTNaw (ORCPT ); Fri, 20 Mar 2015 09:30:52 -0400 Received: by lagg8 with SMTP id g8so87086509lag.1; Fri, 20 Mar 2015 06:30:50 -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=O0SimyX86Xl02gYdyP/MNt9AO8/ttOcTCNJglL6y018=; b=cY9mQaZOG1kq5SVjVpndOuJ/v8bno/X4hD10TK14iR3m28WoI5OZjWgDXd4p5Xxwyt 7TL+a7ca3j82PLpNzuFj+Aw4LT2Ea0Yvr9eR/6BwZhmGr2HuRqXOeXfGQaslbhLoUjVl wr2mcD+C4zJe4qZOwPHiQJLp9ikA4vHDOluA1N25iP45DoBQFr8zadSRPQ64Ooyjtaos /7D83pmfDjJ6a4LqU9UZKtx/2A3VOZa8Ui+x4iJL80b90P4AIoH24fGpAmzXwE94hpx5 uoRXvcu2CfdtC+pIgGAlIcoKqJD60caIlM7LOzhepPiSGue2m2H3E2CmI9duk8GuG9yK iKXw== X-Received: by 10.152.6.34 with SMTP id x2mr66418185lax.47.1426858250177; Fri, 20 Mar 2015 06:30:50 -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 lv11sm934808lac.38.2015.03.20.06.30.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Mar 2015 06:30:49 -0700 (PDT) From: Ricardo Ribalda Delgado To: Ricardo Ribalda Delgado , Hans Verkuil , Mauro Carvalho Chehab , Arun Kumar K , Sylwester Nawrocki , Antti Palosaari , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Sakari Ailus Subject: [PATCH v2 1/5] media/v4l2-ctrls: volatiles should not generate CH_VALUE Date: Fri, 20 Mar 2015 14:30:46 +0100 Message-Id: <1426858247-25746-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 Volatile controls should not generate CH_VALUE events. Set has_changed to false to prevent this happening. Signed-off-by: Ricardo Ribalda Delgado --- v2: By Sakari Ailus Fix CodeStyle (sorry :S) 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..2ebc33e 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);