From patchwork Tue Jun 28 11:25:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 924282 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5SBSefr003532 for ; Tue, 28 Jun 2011 11:29:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757360Ab1F1L1t (ORCPT ); Tue, 28 Jun 2011 07:27:49 -0400 Received: from smtp-vbr10.xs4all.nl ([194.109.24.30]:1221 "EHLO smtp-vbr10.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757241Ab1F1L0S (ORCPT ); Tue, 28 Jun 2011 07:26:18 -0400 Received: from tschai (64-103-25-233.cisco.com [64.103.25.233]) (authenticated bits=0) by smtp-vbr10.xs4all.nl (8.13.8/8.13.8) with ESMTP id p5SBQ9k3032542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Jun 2011 13:26:13 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil Subject: [RFCv2 PATCH 05/13] v4l2-ctrls: don't initially set CH_VALUE for write-only controls Date: Tue, 28 Jun 2011 13:25:57 +0200 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: <1309260365-4831-1-git-send-email-hverkuil@xs4all.nl> References: <1309260365-4831-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <3d92b242dcf5e7766d128d6c1f05c0bd837a2633.1309260043.git.hans.verkuil@cisco.com> References: <3d92b242dcf5e7766d128d6c1f05c0bd837a2633.1309260043.git.hans.verkuil@cisco.com> X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 28 Jun 2011 11:29:23 +0000 (UTC) From: Hans Verkuil When sending the SEND_INITIAL event for write-only controls the V4L2_EVENT_CTRL_CH_VALUE flag should not be set. It's meaningless. Signed-off-by: Hans Verkuil --- drivers/media/video/v4l2-ctrls.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 63a44fd..1b0422e 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -2032,9 +2032,11 @@ void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl, if (ctrl->type != V4L2_CTRL_TYPE_CTRL_CLASS && (sev->flags & V4L2_EVENT_SUB_FL_SEND_INITIAL)) { struct v4l2_event ev; + u32 changes = V4L2_EVENT_CTRL_CH_FLAGS; - fill_event(&ev, ctrl, V4L2_EVENT_CTRL_CH_VALUE | - V4L2_EVENT_CTRL_CH_FLAGS); + if (!(ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY)) + changes |= V4L2_EVENT_CTRL_CH_VALUE; + fill_event(&ev, ctrl, changes); v4l2_event_queue_fh(sev->fh, &ev); } v4l2_ctrl_unlock(ctrl);