From: Rob Herring <robh@kernel.org> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>, devicetree@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jacopo Mondi <jacopo@jmondi.org>, Eugen Hristev <eugen.hristev@microchip.com>, Hugues Fruchet <hugues.fruchet@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com> Subject: Re: [PATCH 1/2] dt-bindings: media: Add macros for video interface bus types Date: Tue, 1 Mar 2022 09:04:10 -0600 [thread overview] Message-ID: <Yh416qrZr32PzMtJ@robh.at.kernel.org> (raw) In-Reply-To: <YhvqLL0LYWt2ryaE@pendragon.ideasonboard.com> 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 <laurent.pinchart@ideasonboard.com> > > > --- > > > 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 <laurent.pinchart@ideasonboard.com> > > > + */ > > > + > > > +#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 >
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>, devicetree@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jacopo Mondi <jacopo@jmondi.org>, Eugen Hristev <eugen.hristev@microchip.com>, Hugues Fruchet <hugues.fruchet@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com> Subject: Re: [PATCH 1/2] dt-bindings: media: Add macros for video interface bus types Date: Tue, 1 Mar 2022 09:04:10 -0600 [thread overview] Message-ID: <Yh416qrZr32PzMtJ@robh.at.kernel.org> (raw) In-Reply-To: <YhvqLL0LYWt2ryaE@pendragon.ideasonboard.com> 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 <laurent.pinchart@ideasonboard.com> > > > --- > > > 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 <laurent.pinchart@ideasonboard.com> > > > + */ > > > + > > > +#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
next prev parent reply other threads:[~2022-03-01 15:04 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-27 20:33 [PATCH 0/2] dt-bindings: Add macros for video interface bus types Laurent Pinchart 2022-02-27 20:33 ` Laurent Pinchart 2022-02-27 20:33 ` [PATCH 1/2] dt-bindings: media: " Laurent Pinchart 2022-02-27 20:33 ` Laurent Pinchart 2022-02-27 21:07 ` Sakari Ailus 2022-02-27 21:07 ` Sakari Ailus 2022-02-27 21:16 ` Laurent Pinchart 2022-02-27 21:16 ` Laurent Pinchart 2022-03-01 15:04 ` Rob Herring [this message] 2022-03-01 15:04 ` Rob Herring 2022-03-06 16:54 ` Laurent Pinchart 2022-03-06 16:54 ` Laurent Pinchart 2022-03-01 14:50 ` Rob Herring 2022-03-01 14:50 ` Rob Herring 2022-02-27 20:33 ` [PATCH 2/2] dt-bindings: Use new video interface bus type macros in examples Laurent Pinchart 2022-02-27 20:33 ` Laurent Pinchart
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=Yh416qrZr32PzMtJ@robh.at.kernel.org \ --to=robh@kernel.org \ --cc=alexandre.torgue@foss.st.com \ --cc=devicetree@vger.kernel.org \ --cc=eugen.hristev@microchip.com \ --cc=hugues.fruchet@foss.st.com \ --cc=jacopo@jmondi.org \ --cc=laurent.pinchart@ideasonboard.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-media@vger.kernel.org \ --cc=mcoquelin.stm32@gmail.com \ --cc=sakari.ailus@linux.intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.