From patchwork Tue Sep 25 10:14:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 10613837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 819D66CB for ; Tue, 25 Sep 2018 10:14:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 724B229D57 for ; Tue, 25 Sep 2018 10:14:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 668CA29DA5; Tue, 25 Sep 2018 10:14:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC7D829D57 for ; Tue, 25 Sep 2018 10:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727606AbeIYQVd (ORCPT ); Tue, 25 Sep 2018 12:21:33 -0400 Received: from mga06.intel.com ([134.134.136.31]:59192 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbeIYQVd (ORCPT ); Tue, 25 Sep 2018 12:21:33 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2018 03:14:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,301,1534834800"; d="scan'208";a="75735264" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga007.jf.intel.com with ESMTP; 25 Sep 2018 03:14:38 -0700 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by paasikivi.fi.intel.com (Postfix) with ESMTPS id F1CC5209CB; Tue, 25 Sep 2018 13:14:37 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.89) (envelope-from ) id 1g4kMV-0005Ie-Fr; Tue, 25 Sep 2018 13:14:35 +0300 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, tfiga@chromium.org, bingbu.cao@intel.com, jian.xu.zheng@intel.com, rajmohan.mani@intel.com, tian.shu.qiu@intel.com, ricardo.ribalda@gmail.com, grundler@chromium.org, ping-chung.chen@intel.com, andy.yeh@intel.com, jim.lai@intel.com, helmut.grohne@intenta.de, laurent.pinchart@ideasonboard.com, snawrocki@kernel.org Subject: [PATCH 1/5] videodev2.h: Use 8 hexadecimals (32 bits) for control flags Date: Tue, 25 Sep 2018 13:14:30 +0300 Message-Id: <20180925101434.20327-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180925101434.20327-1-sakari.ailus@linux.intel.com> References: <20180925101434.20327-1-sakari.ailus@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The V4L2 control flags are a 32-bit bitmask. Use 32-bit hexadecimal numbers to specify the flags (was 16). Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Acked-by: Hans Verkuil --- Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 22 +++++++++++----------- include/uapi/linux/videodev2.h | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst index 5bd26e8c9a1a0..ff2d131223b84 100644 --- a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst +++ b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst @@ -439,37 +439,37 @@ See also the examples in :ref:`control`. :widths: 3 1 4 * - ``V4L2_CTRL_FLAG_DISABLED`` - - 0x0001 + - 0x00000001 - This control is permanently disabled and should be ignored by the application. Any attempt to change the control will result in an ``EINVAL`` error code. * - ``V4L2_CTRL_FLAG_GRABBED`` - - 0x0002 + - 0x00000002 - This control is temporarily unchangeable, for example because another application took over control of the respective resource. Such controls may be displayed specially in a user interface. Attempts to change the control may result in an ``EBUSY`` error code. * - ``V4L2_CTRL_FLAG_READ_ONLY`` - - 0x0004 + - 0x00000004 - This control is permanently readable only. Any attempt to change the control will result in an ``EINVAL`` error code. * - ``V4L2_CTRL_FLAG_UPDATE`` - - 0x0008 + - 0x00000008 - A hint that changing this control may affect the value of other controls within the same control class. Applications should update their user interface accordingly. * - ``V4L2_CTRL_FLAG_INACTIVE`` - - 0x0010 + - 0x00000010 - This control is not applicable to the current configuration and should be displayed accordingly in a user interface. For example the flag may be set on a MPEG audio level 2 bitrate control when MPEG audio encoding level 1 was selected with another control. * - ``V4L2_CTRL_FLAG_SLIDER`` - - 0x0020 + - 0x00000020 - A hint that this control is best represented as a slider-like element in a user interface. * - ``V4L2_CTRL_FLAG_WRITE_ONLY`` - - 0x0040 + - 0x00000040 - This control is permanently writable only. Any attempt to read the control will result in an ``EACCES`` error code error code. This flag is typically present for relative controls or action controls @@ -477,7 +477,7 @@ See also the examples in :ref:`control`. action (e. g. motor control) but no meaningful value can be returned. * - ``V4L2_CTRL_FLAG_VOLATILE`` - - 0x0080 + - 0x00000080 - This control is volatile, which means that the value of the control changes continuously. A typical example would be the current gain value if the device is in auto-gain mode. In such a @@ -493,7 +493,7 @@ See also the examples in :ref:`control`. Setting a new value for a volatile control will *never* trigger a :ref:`V4L2_EVENT_CTRL_CH_VALUE ` event. * - ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` - - 0x0100 + - 0x00000100 - This control has a pointer type, so its value has to be accessed using one of the pointer fields of struct :c:type:`v4l2_ext_control`. This flag is set @@ -503,7 +503,7 @@ See also the examples in :ref:`control`. * .. _FLAG_EXECUTE_ON_WRITE: - ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` - - 0x0200 + - 0x00000200 - The value provided to the control will be propagated to the driver even if it remains constant. This is required when the control represents an action on the hardware. For example: clearing an @@ -512,7 +512,7 @@ See also the examples in :ref:`control`. * .. _FLAG_MODIFY_LAYOUT: - ``V4L2_CTRL_FLAG_MODIFY_LAYOUT`` - - 0x0400 + - 0x00000400 - Changing this control value may modify the layout of the buffer (for video devices) or the media bus format (for sub-devices). diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 184e4dbe8f9c0..ae083978988f1 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1681,17 +1681,17 @@ struct v4l2_querymenu { } __attribute__ ((packed)); /* Control flags */ -#define V4L2_CTRL_FLAG_DISABLED 0x0001 -#define V4L2_CTRL_FLAG_GRABBED 0x0002 -#define V4L2_CTRL_FLAG_READ_ONLY 0x0004 -#define V4L2_CTRL_FLAG_UPDATE 0x0008 -#define V4L2_CTRL_FLAG_INACTIVE 0x0010 -#define V4L2_CTRL_FLAG_SLIDER 0x0020 -#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 -#define V4L2_CTRL_FLAG_VOLATILE 0x0080 -#define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100 -#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200 -#define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x0400 +#define V4L2_CTRL_FLAG_DISABLED 0x00000001 +#define V4L2_CTRL_FLAG_GRABBED 0x00000002 +#define V4L2_CTRL_FLAG_READ_ONLY 0x00000004 +#define V4L2_CTRL_FLAG_UPDATE 0x00000008 +#define V4L2_CTRL_FLAG_INACTIVE 0x00000010 +#define V4L2_CTRL_FLAG_SLIDER 0x00000020 +#define V4L2_CTRL_FLAG_WRITE_ONLY 0x00000040 +#define V4L2_CTRL_FLAG_VOLATILE 0x00000080 +#define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x00000100 +#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x00000200 +#define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x00000400 /* Query flags, to be ORed with the control ID */ #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000