From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5928AC433EF for ; Tue, 1 Mar 2022 15:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/g79i6qWRLmJLY12OntETDkC9NldWvolAW1qpU5rEJs=; b=Y+2Wh75Fr8ITYI thV8CP2pHdGnIWG9dTcBipqtGhP/vdgofD/396w7ZCM0L/oQCdqoRi9mdXar7xkSccFKgs+iq5qPT DNub/ZydZzta/W2aB9nHKkk5L5RwgdfKMUDvhQ9xcX9yhywI4vxJRCR4lr2NRQwkNx1ojrQvMzu7M Ym5TO64KQ1wOKgzuxlX1SQJ8ct1hzFzg2SojduuV4v0evfhVsvsddMnQw36Ys35xUjVXT/eIOGelI 2J0PmUUAW6qpsZeRVVOnl+jr6Jw05ZflhXqOHBJn+iMHSu5fUxGvJSWfMlMdbvjJCjF41lO4Ph8td VY4Ukrt4fqPEMLtqyZZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nP42z-00HBk4-KJ; Tue, 01 Mar 2022 15:04:17 +0000 Received: from mail-oo1-f50.google.com ([209.85.161.50]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nP42v-00HBiZ-IL for linux-arm-kernel@lists.infradead.org; Tue, 01 Mar 2022 15:04:14 +0000 Received: by mail-oo1-f50.google.com with SMTP id 6-20020a4a0906000000b0031d7eb98d31so7285397ooa.10 for ; Tue, 01 Mar 2022 07:04:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NhjIkBmRmWHn6hZKiPp3QI3ZApNmYTsHEcY+J44OE9c=; b=AL6qs4i9owt+ubybqPs7GiV1VRyUYGLQdeY0eZ/6rUm+s4yD/guEJ0jOHtqnroMqRU /icY5MzDhtcIsZn+17KZoqkXTtscjgMZf1+LjtYdrObF7ohV+vspn5HYhunyJ9orpzv+ xBRu+AFcyC5kNWoGHr0dswe5uUgEBg+o/OvYWd55+VN1uEr+vt+D04it+Ibtg+Ky0lVc yrN6a0PN+gzzIRVOOthkWbdQDeEajlfDjrnIghw7ZlgAvCaFnp5GL6tIaukPAA2fdo9h 1OnNnxqmMMYpF1UzlAJ+zhAYy2eP3biNDHLh1esslpvfMIgIiAJwieAmnm7SokOC65q6 KxWw== X-Gm-Message-State: AOAM533aikKN/odyXLvuchhfPQMd8HLKqsAspHiQdX3726YfVj1rmhoG yomKpbAzRqfL0NGlpncC6A== X-Google-Smtp-Source: ABdhPJy7A8v8F+HtSBR12VZgXH/m9qLTLyWwHJy61CEzee5qeK2oioioloxMfwkgdMGKtQKMqrvOUQ== X-Received: by 2002:a05:6870:b88:b0:d7:7e6:7d52 with SMTP id lg8-20020a0568700b8800b000d707e67d52mr4104975oab.95.1646147051835; Tue, 01 Mar 2022 07:04:11 -0800 (PST) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id 100-20020a9d0eed000000b005af73c6f792sm6700792otj.6.2022.03.01.07.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 07:04:11 -0800 (PST) Received: (nullmailer pid 1233554 invoked by uid 1000); Tue, 01 Mar 2022 15:04:10 -0000 Date: Tue, 1 Mar 2022 09:04:10 -0600 From: Rob Herring To: Laurent Pinchart Cc: Sakari Ailus , devicetree@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jacopo Mondi , Eugen Hristev , Hugues Fruchet , Maxime Coquelin , Alexandre Torgue Subject: Re: [PATCH 1/2] dt-bindings: media: Add macros for video interface bus types Message-ID: References: <20220227203352.17314-1-laurent.pinchart@ideasonboard.com> <20220227203352.17314-2-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220301_070413_633885_7F43FDF8 X-CRM114-Status: GOOD ( 32.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Feb 27, 2022 at 11:16:28PM +0200, Laurent Pinchart wrote: > Hi Sakari, > > On Sun, Feb 27, 2022 at 11:07:23PM +0200, Sakari Ailus wrote: > > On Sun, Feb 27, 2022 at 10:33:51PM +0200, Laurent Pinchart wrote: > > > Add a new dt-bindings/media/video-interfaces.h header that defines > > > macros corresponding to the bus types from media/video-interfaces.yaml. > > > This allows avoiding hardcoded constants in device tree sources. > > > > > > Signed-off-by: Laurent Pinchart > > > --- > > > include/dt-bindings/media/video-interfaces.h | 16 ++++++++++++++++ > > > 1 file changed, 16 insertions(+) > > > create mode 100644 include/dt-bindings/media/video-interfaces.h > > > > > > diff --git a/include/dt-bindings/media/video-interfaces.h b/include/dt-bindings/media/video-interfaces.h > > > new file mode 100644 > > > index 000000000000..e38058e1cca7 > > > --- /dev/null > > > +++ b/include/dt-bindings/media/video-interfaces.h > > > @@ -0,0 +1,16 @@ > > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > > +/* > > > + * Copyright (C) 2022 Laurent Pinchart > > > + */ > > > + > > > +#ifndef __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__ > > > +#define __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__ > > > + > > > +#define MEDIA_BUS_TYPE_CSI2_CPHY 1 > > > +#define MEDIA_BUS_TYPE_CSI1 2 > > > +#define MEDIA_BUS_TYPE_CCP2 3 > > > +#define MEDIA_BUS_TYPE_CSI2_DPHY 4 > > > +#define MEDIA_BUS_TYPE_PARALLEL 5 > > > > I've been long thinkin of renaming "PARALLEL" as "BT.601" which it really > > is. I don't mind postponing that, but I think you could as well start here. > > Up to you. > > I think it's a good idea, but we then need to decide what to do with > other types of parallel buses. Let's start this discussion now, and > implement it in a patch on top of this series. 5 and what it means is an ABI. If it is ambiguous and needs to be more specific, then you need new numbers for all of those specific types. If it is just a rename, I prefer it is done from the start. > > Should this be somehow visible in video-interfaces.yaml? > > I wish we could use macros in .yaml files instead of numerical values, > but I don't think that's possible. I can do this: > > bus-type: > $ref: /schemas/types.yaml#/definitions/uint32 > enum: > - - 1 # MIPI CSI-2 C-PHY > - - 2 # MIPI CSI1 > - - 3 # CCP2 > - - 4 # MIPI CSI-2 D-PHY > - - 5 # Parallel > - - 6 # BT.656 > + - 1 # MIPI CSI-2 C-PHY (MEDIA_BUS_TYPE_CSI2_CPHY) > + - 2 # MIPI CSI1 (MEDIA_BUS_TYPE_CSI1) > + - 3 # CCP2 (MEDIA_BUS_TYPE_CCP2) > + - 4 # MIPI CSI-2 D-PHY (MEDIA_BUS_TYPE_CSI2_DPHY) > + - 5 # Parallel (MEDIA_BUS_TYPE_PARALLEL) > + - 6 # BT.656 (MEDIA_BUS_TYPE_BT656) Seems a bit redundant to have both comment text and define. The only part missing from the defines is 'MIPI'. > description: > - Data bus type. > + Data bus type. Use the macros listed above (defined in > + dt-bindings/video-interfaces.h) instead of numerical values. > > Any better proposal ? > > > > +#define MEDIA_BUS_TYPE_BT656 6 > > > + > > > +#endif /* __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__ */ > > -- > Regards, > > Laurent Pinchart > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel