From patchwork Sun Dec 13 11:01:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 7838951 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 480099F1C2 for ; Sun, 13 Dec 2015 11:02:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63B7820375 for ; Sun, 13 Dec 2015 11:02:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DCBB20361 for ; Sun, 13 Dec 2015 11:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbbLMLB7 (ORCPT ); Sun, 13 Dec 2015 06:01:59 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:38527 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640AbbLMLB7 (ORCPT ); Sun, 13 Dec 2015 06:01:59 -0500 Received: from 177.17.248.210.dynamic.adsl.gvt.net.br ([177.17.248.210] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1a84Pe-0006zk-CF; Sun, 13 Dec 2015 11:01:58 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.86) (envelope-from ) id 1a84PQ-0006TN-Ke; Sun, 13 Dec 2015 09:01:44 -0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 1/4] [media] media-entity.h: Document some ancillary functions Date: Sun, 13 Dec 2015 09:01:40 -0200 Message-Id: X-Mailer: git-send-email 2.5.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Add a basic documentation for most ancillary functions. Signed-off-by: Mauro Carvalho Chehab --- include/media/media-entity.h | 58 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/include/media/media-entity.h b/include/media/media-entity.h index d073b205e6a6..81aca1f5a09a 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -238,11 +238,21 @@ struct media_intf_devnode { u32 minor; }; +/** + * media_entity_id() - return the media entity graph object id + * + * @entity: pointer to entity + */ static inline u32 media_entity_id(struct media_entity *entity) { return entity->graph_obj.id; } +/** + * media_type() - return the media object type + * + * @gobj: pointer to the media graph object + */ static inline enum media_gobj_type media_type(struct media_gobj *gobj) { return gobj->id >> MEDIA_BITS_PER_LOCAL_ID; @@ -263,6 +273,15 @@ static inline u32 media_gobj_gen_id(enum media_gobj_type type, u32 local_id) return id; } +/** + * is_media_entity_v4l2_io() - identify if the entity main function + * is a V4L2 I/O + * + * @entity: pointer to entity + * + * Return: true if the entity main function is one of the V4L2 I/O types + * (video, VBI or SDR radio); false otherwise. + */ static inline bool is_media_entity_v4l2_io(struct media_entity *entity) { if (!entity) @@ -278,6 +297,16 @@ static inline bool is_media_entity_v4l2_io(struct media_entity *entity) } } +/** + * is_media_entity_v4l2_subdev - return true if the entity main function is + * associated with the V4L2 API subdev usage + * + * @entity: pointer to entity + * + * This is an ancillary function used by subdev-based V4L2 drivers. + * It checks if the entity function is one of functions used by a V4L2 subdev, + * e. g. camera-relatef functions, analog TV decoder, TV tuner, V4L2 DSPs. + */ static inline bool is_media_entity_v4l2_subdev(struct media_entity *entity) { if (!entity) @@ -652,16 +681,43 @@ struct media_link * __must_check media_create_intf_link(struct media_entity *entity, struct media_interface *intf, u32 flags); +/** + * __media_remove_intf_link() - remove a single interface link + * + * @link: pointer to &media_link. + * + * Note: this is an unlocked version of media_remove_intf_link() + */ void __media_remove_intf_link(struct media_link *link); + +/** + * media_remove_intf_link() - remove a single interface link + * + * @link: pointer to &media_link. + * + * Note: prefer to use this one, instead of __media_remove_intf_link() + */ void media_remove_intf_link(struct media_link *link); + +/** + * __media_remove_intf_links() - remove all links associated with an interface + * + * @intf: pointer to &media_interface + * + * Note: this is an unlocked version of media_remove_intf_links(). + */ void __media_remove_intf_links(struct media_interface *intf); /** * media_remove_intf_links() - remove all links associated with an interface * * @intf: pointer to &media_interface * - * Note: this is called automatically when an entity is unregistered via + * Notes: + * + * this is called automatically when an entity is unregistered via * media_device_register_entity() and by media_devnode_remove(). + * + * Prefer to use this one, instead of __media_remove_intf_links(). */ void media_remove_intf_links(struct media_interface *intf);