From patchwork Wed Aug 2 21:45:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 709438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93937C00528 for ; Wed, 2 Aug 2023 21:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233793AbjHBVrw (ORCPT ); Wed, 2 Aug 2023 17:47:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233757AbjHBVr1 (ORCPT ); Wed, 2 Aug 2023 17:47:27 -0400 Received: from mgamail.intel.com (unknown [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 979A13C25 for ; Wed, 2 Aug 2023 14:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691012808; x=1722548808; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zLZsEP9m7c0aA3XJAE3/+rd++V0bB/KkiYVa0+jwjCY=; b=fU+rS6IMMkvrOE2E/9MMLsnaVUMS9IZ+lM0obna9KUcT1kx3r/KW0tBU c2ID/hzAoGwRRDD2v4jc712aOQ6dqBekia+Zu6k+xsTplfwAfyBnP7V4B +NNQaIjRah0O9Rh9kBc9CLA4H8QnuDfiD/zlkEamAYO9G8B9QNlfi+uqX E5+eXVmb8Er9e7uxGGM4ryRMwrcqA90Jy6iD/E0k7Es/3fIZc2osnRhII vVwF8XwlCfwElBzzmiY7vS7WCivyYzgl3Krz9xiz8PCyM61CuLXzRvLEv 7MqJQF0MWdyO/MPFLi4SBMmjnlfyW95gLUTYUx2g/kRmcGhUWr676vfBu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="372442076" X-IronPort-AV: E=Sophos;i="6.01,250,1684825200"; d="scan'208";a="372442076" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 14:46:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="853009376" X-IronPort-AV: E=Sophos;i="6.01,250,1684825200"; d="scan'208";a="853009376" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 14:46:09 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 872B7120BBA; Thu, 3 Aug 2023 00:46:06 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Laurent Pinchart , tomi.valkeinen@ideasonboard.com, bingbu.cao@intel.com, hongju.wang@intel.com, hverkuil@xs4all.nl, Andrey Konovalov , Jacopo Mondi , Dmitry Perchanov Subject: [PATCH v2 7/9] media: uapi: Add a macro to tell whether an mbus code is metadata Date: Thu, 3 Aug 2023 00:45:54 +0300 Message-Id: <20230802214556.180589-8-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230802214556.180589-1-sakari.ailus@linux.intel.com> References: <20230802214556.180589-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a macro to tell whether a given mbus code is metadata. Signed-off-by: Sakari Ailus --- include/uapi/linux/media-bus-format.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h index 9ee031397372..2486b4178c5f 100644 --- a/include/uapi/linux/media-bus-format.h +++ b/include/uapi/linux/media-bus-format.h @@ -182,4 +182,7 @@ #define MEDIA_BUS_FMT_META_20 0x8006 #define MEDIA_BUS_FMT_META_24 0x8007 +#define MEDIA_BUS_FMT_IS_META(code) \ + ((code) & 0xf000 == 0x7000 || (code) & 0xf000 == 0x8000) + #endif /* __LINUX_MEDIA_BUS_FORMAT_H */