From patchwork Fri Aug 21 09:29:40 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: 7050641 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 F3C619F358 for ; Fri, 21 Aug 2015 09:33:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3016020256 for ; Fri, 21 Aug 2015 09:33:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D41E20328 for ; Fri, 21 Aug 2015 09:33:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753992AbbHUJcp (ORCPT ); Fri, 21 Aug 2015 05:32:45 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:33146 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753578AbbHUJ3y (ORCPT ); Fri, 21 Aug 2015 05:29:54 -0400 Received: by lalv9 with SMTP id v9so37863532lal.0; Fri, 21 Aug 2015 02:29:52 -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=NVHVO8/kzXcbBsU7Yac+aQCbwXmuBnNNi2HzaeVcEoY=; b=Ffd2KO/QbBJ8WrplBH+irlnE9o7jyqc39yDoEhfPI9GzrdoV5yxkGrPPjpBsauPcvT h798a9+z8bBrNktSP+ZahndaKRyvwgF1pjs/gkBKMysQLDOB/tng9jbE77CACHCNTrqy kQbNDo4X2eKQuiTLri9xtCstvMQ/D35CS+4OIxbjsv40UhmMXkoBH1deXKBITh38Nc6Y hPZconwBgCTLNAtG5pZTDJXGz1pWj536UZM30JBJHpKkVCW74z0MOLWmnCMxMw3QF5Bh pNe/+ETZDXUfT/zL+t9eygyDrpPanMrX3KtiycrjNBxWP7w8qPIlruZTk4hIvbklnHz/ K08A== X-Received: by 10.152.42.170 with SMTP id p10mr6837599lal.39.1440149392409; Fri, 21 Aug 2015 02:29:52 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id f10sm2112680lae.23.2015.08.21.02.29.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Aug 2015 02:29:51 -0700 (PDT) From: Ricardo Ribalda Delgado To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans Verkuil , Steven Toth , Sakari Ailus , Vincent Palatin , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 2/8] videodev2.h: Extend struct v4l2_ext_controls Date: Fri, 21 Aug 2015 11:29:40 +0200 Message-Id: <1440149386-19783-3-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1440149386-19783-1-git-send-email-ricardo.ribalda@gmail.com> References: <1440149386-19783-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=-7.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 So it can be used to get the default value of a control. Without this change it is not possible to get get the default value of array controls. Signed-off-by: Ricardo Ribalda Delgado --- include/uapi/linux/videodev2.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 72fa3e490e30..2e857b19a155 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1461,7 +1461,10 @@ struct v4l2_ext_control { } __attribute__ ((packed)); struct v4l2_ext_controls { - __u32 ctrl_class; + union { + __u32 ctrl_class; + __u32 which; + }; __u32 count; __u32 error_idx; __u32 reserved[2]; @@ -1472,6 +1475,8 @@ struct v4l2_ext_controls { #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) #define V4L2_CTRL_MAX_DIMS (4) +#define V4L2_CTRL_WHICH_CUR_VAL 0 +#define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000 enum v4l2_ctrl_type { V4L2_CTRL_TYPE_INTEGER = 1,