From patchwork Tue Nov 4 09:55:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 5224611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5CB4F9F349 for ; Tue, 4 Nov 2014 10:00:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58377201D3 for ; Tue, 4 Nov 2014 10:00:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 455BB200CF for ; Tue, 4 Nov 2014 10:00:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XlasJ-0004Xy-HN; Tue, 04 Nov 2014 09:58:07 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xlaqx-0003VE-S2 for linux-arm-kernel@bombadil.infradead.org; Tue, 04 Nov 2014 09:56:43 +0000 Received: from down.free-electrons.com ([37.187.137.238] helo=mail.free-electrons.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xlaqv-0003zJ-5l for linux-arm-kernel@lists.infradead.org; Tue, 04 Nov 2014 09:56:42 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 6F7CB5DF; Tue, 4 Nov 2014 10:55:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost.localdomain (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id AB20E5DB; Tue, 4 Nov 2014 10:55:32 +0100 (CET) From: Boris Brezillon To: Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , linux-media@vger.kernel.org Subject: [PATCH 11/15] [media] Deprecate v4l2_mbus_pixelcode Date: Tue, 4 Nov 2014 10:55:06 +0100 Message-Id: <1415094910-15899-12-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415094910-15899-1-git-send-email-boris.brezillon@free-electrons.com> References: <1415094910-15899-1-git-send-email-boris.brezillon@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141104_045641_463411_9EEE0337 X-CRM114-Status: GOOD ( 18.91 ) X-Spam-Score: -1.8 (-) Cc: devel@driverdev.osuosl.org, Boris Brezillon , linux-doc@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Guennadi Liakhovetski , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The v4l2_mbus_pixelcode enum (or its values) should be replaced by the media_bus_format enum. Keep this enum in v4l2-mediabus.h and create a new header containing the v4l2_mbus_framefmt struct definition (which is not deprecated) so that we can add a #warning statement in v4l2-mediabus.h and hopefully encourage users to move to the new definitions. Replace inclusion of v4l2-mediabus.h with v4l2-mbus.h in all common headers and update the documentation Makefile to parse v4l2-mbus.h instead of v4l2-mediabus.h. Signed-off-by: Boris Brezillon --- Documentation/DocBook/media/Makefile | 2 +- include/media/v4l2-mediabus.h | 2 +- include/uapi/linux/Kbuild | 1 + include/uapi/linux/v4l2-mbus.h | 35 +++++++++++++++++++++++++++++++++++ include/uapi/linux/v4l2-mediabus.h | 26 ++++---------------------- include/uapi/linux/v4l2-subdev.h | 2 +- 6 files changed, 43 insertions(+), 25 deletions(-) create mode 100644 include/uapi/linux/v4l2-mbus.h diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile index 181b7f4..30a22fa 100644 --- a/Documentation/DocBook/media/Makefile +++ b/Documentation/DocBook/media/Makefile @@ -99,7 +99,7 @@ STRUCTS = \ $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/video.h) \ $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \ - $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) + $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mbus.h) ERRORS = \ E2BIG \ diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 4915621..fc6bdd3 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h @@ -11,7 +11,7 @@ #ifndef V4L2_MEDIABUS_H #define V4L2_MEDIABUS_H -#include +#include /* Parallel flags */ /* diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index b2c23f8..7b72720 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -408,6 +408,7 @@ header-y += uvcvideo.h header-y += v4l2-common.h header-y += v4l2-controls.h header-y += v4l2-dv-timings.h +header-y += v4l2-mbus.h header-y += v4l2-mediabus.h header-y += v4l2-subdev.h header-y += veth.h diff --git a/include/uapi/linux/v4l2-mbus.h b/include/uapi/linux/v4l2-mbus.h new file mode 100644 index 0000000..2778c6e --- /dev/null +++ b/include/uapi/linux/v4l2-mbus.h @@ -0,0 +1,35 @@ +/* + * Media Bus API header + * + * Copyright (C) 2009, Guennadi Liakhovetski + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __LINUX_V4L2_MBUS_H +#define __LINUX_V4L2_MBUS_H + +#include +#include +#include + +/** + * struct v4l2_mbus_framefmt - frame format on the media bus + * @width: frame width + * @height: frame height + * @code: data format code (from enum media_bus_format) + * @field: used interlacing type (from enum v4l2_field) + * @colorspace: colorspace of the data (from enum v4l2_colorspace) + */ +struct v4l2_mbus_framefmt { + __u32 width; + __u32 height; + __u32 code; + __u32 field; + __u32 colorspace; + __u32 reserved[7]; +}; + +#endif diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h index 5a3e797..a587eac 100644 --- a/include/uapi/linux/v4l2-mediabus.h +++ b/include/uapi/linux/v4l2-mediabus.h @@ -10,12 +10,12 @@ #ifndef __LINUX_V4L2_MEDIABUS_H #define __LINUX_V4L2_MEDIABUS_H +#ifndef __KERNEL__ -#include -#include -#include +#warning "Use v4l2-mbus.h instead of v4l2-mediabus.h" + +#include -#ifndef __KERNEL__ #define MEDIA_BUS_TO_V4L2_MBUS(x) V4L2_MBUS_FMT_ ## x = MEDIA_BUS_FMT_ ## x enum v4l2_mbus_pixelcode { @@ -104,22 +104,4 @@ enum v4l2_mbus_pixelcode { MEDIA_BUS_TO_V4L2_MBUS(AHSV8888_1X32), }; #endif /* __KERNEL__ */ - -/** - * struct v4l2_mbus_framefmt - frame format on the media bus - * @width: frame width - * @height: frame height - * @code: data format code (from enum v4l2_mbus_pixelcode) - * @field: used interlacing type (from enum v4l2_field) - * @colorspace: colorspace of the data (from enum v4l2_colorspace) - */ -struct v4l2_mbus_framefmt { - __u32 width; - __u32 height; - __u32 code; - __u32 field; - __u32 colorspace; - __u32 reserved[7]; -}; - #endif diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index 7f44f04..1a46d3b 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include /** * enum v4l2_subdev_format_whence - Media bus format type