From patchwork Tue Dec 19 11:18:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10123055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E9E6603B5 for ; Tue, 19 Dec 2017 11:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B86E2928A for ; Tue, 19 Dec 2017 11:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 807372928D; Tue, 19 Dec 2017 11:18:33 +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=-6.9 required=2.0 tests=BAYES_00,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 2DBAE2928A for ; Tue, 19 Dec 2017 11:18:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762267AbdLSLSb (ORCPT ); Tue, 19 Dec 2017 06:18:31 -0500 Received: from osg.samsung.com ([64.30.133.232]:33261 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762261AbdLSLS3 (ORCPT ); Tue, 19 Dec 2017 06:18:29 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 4BAB7371DD; Tue, 19 Dec 2017 03:18:29 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eVAkZgS9_5ua; Tue, 19 Dec 2017 03:18:28 -0800 (PST) Received: from smtp.s-opensource.com (201.86.134.76.dynamic.adsl.gvt.net.br [201.86.134.76]) by osg.samsung.com (Postfix) with ESMTPSA id 37464371BF; Tue, 19 Dec 2017 03:18:27 -0800 (PST) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1eRFui-0003Js-Ry; Tue, 19 Dec 2017 09:18:24 -0200 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab Subject: [PATCH v2 8/8] media: v4l2-subdev: use kernel-doc markups to document subdev flags Date: Tue, 19 Dec 2017 09:18:24 -0200 Message-Id: <88799b2a5b259bed62f5a0f22968eb49959e1aeb.1513682135.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: 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 Right now, those are documented together with the subdev struct, instead of together with the definitions. Convert the definitions to an enum, use BIT() macros and document it at its right place. Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-subdev.h | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index c8c827553042..473ddb1b2d39 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -18,6 +18,7 @@ #define _V4L2_SUBDEV_H #include +#include #include #include #include @@ -772,14 +773,23 @@ struct v4l2_subdev_internal_ops { #define V4L2_SUBDEV_NAME_SIZE 32 -/* Set this flag if this subdev is a i2c device. */ -#define V4L2_SUBDEV_FL_IS_I2C (1U << 0) -/* Set this flag if this subdev is a spi device. */ -#define V4L2_SUBDEV_FL_IS_SPI (1U << 1) -/* Set this flag if this subdev needs a device node. */ -#define V4L2_SUBDEV_FL_HAS_DEVNODE (1U << 2) -/* Set this flag if this subdev generates events. */ -#define V4L2_SUBDEV_FL_HAS_EVENTS (1U << 3) +/** + * enum v4l2_subdev_flags - flags used to describe a sub-device + * at &struct v4l2_subdev. + * + * @V4L2_SUBDEV_FL_IS_I2C: set this flag if this subdev is an I2C device; + * @V4L2_SUBDEV_FL_IS_SPI: set this flag if this subdev is a SPI device; + * @V4L2_SUBDEV_FL_HAS_DEVNODE: set this flag if this subdev needs + * a device node; + * @V4L2_SUBDEV_FL_HAS_EVENTS: set this flag if this subdev + * generates events. + */ +enum v4l2_subdev_flags { + V4L2_SUBDEV_FL_IS_I2C = BIT(0), + V4L2_SUBDEV_FL_IS_SPI = BIT(1), + V4L2_SUBDEV_FL_HAS_DEVNODE = BIT(2), + V4L2_SUBDEV_FL_HAS_EVENTS = BIT(3), +}; struct regulator_bulk_data; @@ -805,13 +815,7 @@ struct v4l2_subdev_platform_data { * @owner: The owner is the same as the driver's &struct device owner. * @owner_v4l2_dev: true if the &sd->owner matches the owner of @v4l2_dev->dev * owner. Initialized by v4l2_device_register_subdev(). - * @flags: subdev flags. Can be: - * %V4L2_SUBDEV_FL_IS_I2C - Set this flag if this subdev is a i2c device; - * %V4L2_SUBDEV_FL_IS_SPI - Set this flag if this subdev is a spi device; - * %V4L2_SUBDEV_FL_HAS_DEVNODE - Set this flag if this subdev needs a - * device node; - * %V4L2_SUBDEV_FL_HAS_EVENTS - Set this flag if this subdev generates - * events. + * @flags: subdev flags, as defined by &enum v4l2_subdev_flags. * * @v4l2_dev: pointer to struct &v4l2_device * @ops: pointer to struct &v4l2_subdev_ops