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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF432C433FE for ; Sun, 27 Feb 2022 21:16:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230261AbiB0VRT (ORCPT ); Sun, 27 Feb 2022 16:17:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbiB0VRS (ORCPT ); Sun, 27 Feb 2022 16:17:18 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9868154FA6; Sun, 27 Feb 2022 13:16:41 -0800 (PST) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 85C64478; Sun, 27 Feb 2022 22:16:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1645996599; bh=2aKZBadYFJVtbrkVPJGHjuZik/GZIzErTWIDXZkTzb8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Evw2a9V/RZSu8QMlzm8XwVbUntBzP63MEo6saOgow4pQiWuBR+T/PMGDR/BzQ29XG qX23e55cDceq/Msdirfu3DweQG/hglB2LzuEwTCnqlYIR0seoQbwxlbRmUibCDr630 N3lQ2KCOoTw5nKewk4vjy1Hr0FDUkNZ0XgummOyg= Date: Sun, 27 Feb 2022 23:16:28 +0200 From: Laurent Pinchart To: Sakari Ailus Cc: devicetree@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , 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-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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. > 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) 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