From patchwork Mon Dec 18 19:54:02 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: 10121795 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 6B6F160390 for ; Mon, 18 Dec 2017 19:54:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DF9F28DAD for ; Mon, 18 Dec 2017 19:54:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52C3128DD9; Mon, 18 Dec 2017 19:54:18 +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 EB38A28DAD for ; Mon, 18 Dec 2017 19:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758907AbdLRTyO (ORCPT ); Mon, 18 Dec 2017 14:54:14 -0500 Received: from osg.samsung.com ([64.30.133.232]:40087 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758693AbdLRTyL (ORCPT ); Mon, 18 Dec 2017 14:54:11 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 3878A33D94; Mon, 18 Dec 2017 11:54:11 -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 kRfGnkIHRmzT; Mon, 18 Dec 2017 11:54:10 -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 2738D33D5D; Mon, 18 Dec 2017 11:54:06 -0800 (PST) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1eR1UB-0002c4-PZ; Mon, 18 Dec 2017 17:54:03 -0200 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab Subject: [PATCH 8/8] media: v4l2-subdev: use kernel-doc markups to document subdev flags Date: Mon, 18 Dec 2017 17:54:02 -0200 Message-Id: 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 2562e8854022..cd6db6c1495b 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