diff mbox series

[v3,5/6] ARM: dts: renesas: Use new media bus type macros

Message ID 20220615221410.27459-6-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings: Add macros for video interface bus types | expand

Commit Message

Laurent Pinchart June 15, 2022, 10:14 p.m. UTC
Now that a header exists with macros for the media interface bus-type
values, replace hardcoding numerical constants with the corresponding
macros in the DT sources.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
 .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
 .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)

Comments

Lad, Prabhakar Nov. 18, 2022, 9:27 a.m. UTC | #1
Hi Laurent,

Thank you for the patch.

On Wed, Jun 15, 2022 at 11:21 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Now that a header exists with macros for the media interface bus-type
> values, replace hardcoding numerical constants with the corresponding
> macros in the DT sources.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
>  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
>  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
>  3 files changed, 13 insertions(+), 6 deletions(-)
>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar
Laurent Pinchart Jan. 14, 2023, 3:26 p.m. UTC | #2
Geert, could you please take this in your tree for v6.3 ? The two
patches that the DT changes depend on have been merged in v6.2.

On Thu, Jun 16, 2022 at 01:14:09AM +0300, Laurent Pinchart wrote:
> Now that a header exists with macros for the media interface bus-type
> values, replace hardcoding numerical constants with the corresponding
> macros in the DT sources.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
>  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
>  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
>  3 files changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> index 4e58c54cde17..33ac4bd1e63b 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> @@ -7,6 +7,9 @@
>   */
>  
>  /dts-v1/;
> +
> +#include <dt-bindings/media/video-interfaces.h>
> +
>  #include "r8a7742-iwg21d-q7.dts"
>  
>  / {
> @@ -242,7 +245,7 @@ port {
>  		vin0ep: endpoint {
>  			remote-endpoint = <&cam0ep>;
>  			bus-width = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>  		};
>  	};
>  };
> @@ -273,7 +276,7 @@ port {
>  		vin1ep: endpoint {
>  			remote-endpoint = <&cam1ep>;
>  			bus-width = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>  		};
>  	};
>  };
> @@ -305,7 +308,7 @@ vin2ep: endpoint {
>  			remote-endpoint = <&cam2ep>;
>  			bus-width = <8>;
>  			data-shift = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>  		};
>  	};
>  };
> @@ -335,7 +338,7 @@ port {
>  		vin3ep: endpoint {
>  			remote-endpoint = <&cam3ep>;
>  			bus-width = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>  		};
>  	};
>  };
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> index 40cef0b1d1e6..c73160df619d 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> @@ -7,6 +7,8 @@
>   * Copyright (C) 2020 Renesas Electronics Corp.
>   */
>  
> +#include <dt-bindings/media/video-interfaces.h>
> +
>  #define CAM_ENABLED	1
>  
>  &CAM_PARENT_I2C {
> @@ -26,7 +28,7 @@ port {
>  			CAM_EP: endpoint {
>  				bus-width = <8>;
>  				data-shift = <2>;
> -				bus-type = <6>;
> +				bus-type = <MEDIA_BUS_TYPE_BT656>;
>  				pclk-sample = <1>;
>  				remote-endpoint = <&VIN_EP>;
>  			};
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> index f5e77f024251..a7f5cfec64b8 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> @@ -7,6 +7,8 @@
>   * Copyright (C) 2020 Renesas Electronics Corp.
>   */
>  
> +#include <dt-bindings/media/video-interfaces.h>
> +
>  #define CAM_ENABLED	1
>  
>  &CAM_PARENT_I2C {
> @@ -21,7 +23,7 @@ ov7725@21 {
>  		port {
>  			CAM_EP: endpoint {
>  				bus-width = <8>;
> -				bus-type = <6>;
> +				bus-type = <MEDIA_BUS_TYPE_BT656>;
>  				remote-endpoint = <&VIN_EP>;
>  			};
>  		};
Geert Uytterhoeven Jan. 16, 2023, 10:24 a.m. UTC | #3
Hi Laurent,

CC linux-renesas-soc

On Sat, Jan 14, 2023 at 4:26 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Geert, could you please take this in your tree for v6.3 ? The two
> patches that the DT changes depend on have been merged in v6.2.

Thank you, I had missed these.

> On Thu, Jun 16, 2022 at 01:14:09AM +0300, Laurent Pinchart wrote:
> > Now that a header exists with macros for the media interface bus-type
> > values, replace hardcoding numerical constants with the corresponding
> > macros in the DT sources.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> > ---
> >  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
> >  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
> >  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
> >  3 files changed, 13 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > index 4e58c54cde17..33ac4bd1e63b 100644
> > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > @@ -7,6 +7,9 @@
> >   */
> >
> >  /dts-v1/;
> > +
> > +#include <dt-bindings/media/video-interfaces.h>
> > +
> >  #include "r8a7742-iwg21d-q7.dts"
> >
> >  / {
> > @@ -242,7 +245,7 @@ port {
> >               vin0ep: endpoint {
> >                       remote-endpoint = <&cam0ep>;
> >                       bus-width = <8>;
> > -                     bus-type = <6>;
> > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> >               };
> >       };
> >  };
> > @@ -273,7 +276,7 @@ port {
> >               vin1ep: endpoint {
> >                       remote-endpoint = <&cam1ep>;
> >                       bus-width = <8>;
> > -                     bus-type = <6>;
> > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> >               };
> >       };
> >  };
> > @@ -305,7 +308,7 @@ vin2ep: endpoint {
> >                       remote-endpoint = <&cam2ep>;
> >                       bus-width = <8>;
> >                       data-shift = <8>;
> > -                     bus-type = <6>;
> > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> >               };
> >       };
> >  };
> > @@ -335,7 +338,7 @@ port {
> >               vin3ep: endpoint {
> >                       remote-endpoint = <&cam3ep>;
> >                       bus-width = <8>;
> > -                     bus-type = <6>;
> > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> >               };
> >       };
> >  };
> > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > index 40cef0b1d1e6..c73160df619d 100644
> > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > @@ -7,6 +7,8 @@
> >   * Copyright (C) 2020 Renesas Electronics Corp.
> >   */
> >
> > +#include <dt-bindings/media/video-interfaces.h>

This .dtsi file is only intended to be included by
arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts, which already has
the include.  Hence if you don't mind, I would like to drop this part
while applying  and queuing in renesas-devel for v6.3.

> > +
> >  #define CAM_ENABLED  1
> >
> >  &CAM_PARENT_I2C {
> > @@ -26,7 +28,7 @@ port {
> >                       CAM_EP: endpoint {
> >                               bus-width = <8>;
> >                               data-shift = <2>;
> > -                             bus-type = <6>;
> > +                             bus-type = <MEDIA_BUS_TYPE_BT656>;
> >                               pclk-sample = <1>;
> >                               remote-endpoint = <&VIN_EP>;
> >                       };
> > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > index f5e77f024251..a7f5cfec64b8 100644
> > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > @@ -7,6 +7,8 @@
> >   * Copyright (C) 2020 Renesas Electronics Corp.
> >   */
> >
> > +#include <dt-bindings/media/video-interfaces.h>

Likewise

> > +
> >  #define CAM_ENABLED  1
> >
> >  &CAM_PARENT_I2C {
> > @@ -21,7 +23,7 @@ ov7725@21 {
> >               port {
> >                       CAM_EP: endpoint {
> >                               bus-width = <8>;
> > -                             bus-type = <6>;
> > +                             bus-type = <MEDIA_BUS_TYPE_BT656>;
> >                               remote-endpoint = <&VIN_EP>;
> >                       };
> >               };

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Laurent Pinchart Jan. 16, 2023, 10:38 a.m. UTC | #4
Hi Geert,

On Mon, Jan 16, 2023 at 11:24:10AM +0100, Geert Uytterhoeven wrote:
> On Sat, Jan 14, 2023 at 4:26 PM Laurent Pinchart wrote:
> > Geert, could you please take this in your tree for v6.3 ? The two
> > patches that the DT changes depend on have been merged in v6.2.
> 
> Thank you, I had missed these.
> 
> > On Thu, Jun 16, 2022 at 01:14:09AM +0300, Laurent Pinchart wrote:
> > > Now that a header exists with macros for the media interface bus-type
> > > values, replace hardcoding numerical constants with the corresponding
> > > macros in the DT sources.
> > >
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > > ---
> > >  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
> > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
> > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
> > >  3 files changed, 13 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > index 4e58c54cde17..33ac4bd1e63b 100644
> > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > @@ -7,6 +7,9 @@
> > >   */
> > >
> > >  /dts-v1/;
> > > +
> > > +#include <dt-bindings/media/video-interfaces.h>
> > > +
> > >  #include "r8a7742-iwg21d-q7.dts"
> > >
> > >  / {
> > > @@ -242,7 +245,7 @@ port {
> > >               vin0ep: endpoint {
> > >                       remote-endpoint = <&cam0ep>;
> > >                       bus-width = <8>;
> > > -                     bus-type = <6>;
> > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > >               };
> > >       };
> > >  };
> > > @@ -273,7 +276,7 @@ port {
> > >               vin1ep: endpoint {
> > >                       remote-endpoint = <&cam1ep>;
> > >                       bus-width = <8>;
> > > -                     bus-type = <6>;
> > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > >               };
> > >       };
> > >  };
> > > @@ -305,7 +308,7 @@ vin2ep: endpoint {
> > >                       remote-endpoint = <&cam2ep>;
> > >                       bus-width = <8>;
> > >                       data-shift = <8>;
> > > -                     bus-type = <6>;
> > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > >               };
> > >       };
> > >  };
> > > @@ -335,7 +338,7 @@ port {
> > >               vin3ep: endpoint {
> > >                       remote-endpoint = <&cam3ep>;
> > >                       bus-width = <8>;
> > > -                     bus-type = <6>;
> > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > >               };
> > >       };
> > >  };
> > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > index 40cef0b1d1e6..c73160df619d 100644
> > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > @@ -7,6 +7,8 @@
> > >   * Copyright (C) 2020 Renesas Electronics Corp.
> > >   */
> > >
> > > +#include <dt-bindings/media/video-interfaces.h>
> 
> This .dtsi file is only intended to be included by
> arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts, which already has
> the include.  Hence if you don't mind, I would like to drop this part
> while applying  and queuing in renesas-devel for v6.3.

Isn't it better to include headers as needed to avoid depending on
indirect includes ?

> > > +
> > >  #define CAM_ENABLED  1
> > >
> > >  &CAM_PARENT_I2C {
> > > @@ -26,7 +28,7 @@ port {
> > >                       CAM_EP: endpoint {
> > >                               bus-width = <8>;
> > >                               data-shift = <2>;
> > > -                             bus-type = <6>;
> > > +                             bus-type = <MEDIA_BUS_TYPE_BT656>;
> > >                               pclk-sample = <1>;
> > >                               remote-endpoint = <&VIN_EP>;
> > >                       };
> > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > > index f5e77f024251..a7f5cfec64b8 100644
> > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > > @@ -7,6 +7,8 @@
> > >   * Copyright (C) 2020 Renesas Electronics Corp.
> > >   */
> > >
> > > +#include <dt-bindings/media/video-interfaces.h>
> 
> Likewise
> 
> > > +
> > >  #define CAM_ENABLED  1
> > >
> > >  &CAM_PARENT_I2C {
> > > @@ -21,7 +23,7 @@ ov7725@21 {
> > >               port {
> > >                       CAM_EP: endpoint {
> > >                               bus-width = <8>;
> > > -                             bus-type = <6>;
> > > +                             bus-type = <MEDIA_BUS_TYPE_BT656>;
> > >                               remote-endpoint = <&VIN_EP>;
> > >                       };
> > >               };
Geert Uytterhoeven Jan. 16, 2023, 10:44 a.m. UTC | #5
Hi Laurent,

On Mon, Jan 16, 2023 at 11:38 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Mon, Jan 16, 2023 at 11:24:10AM +0100, Geert Uytterhoeven wrote:
> > On Sat, Jan 14, 2023 at 4:26 PM Laurent Pinchart wrote:
> > > Geert, could you please take this in your tree for v6.3 ? The two
> > > patches that the DT changes depend on have been merged in v6.2.
> >
> > Thank you, I had missed these.
> >
> > > On Thu, Jun 16, 2022 at 01:14:09AM +0300, Laurent Pinchart wrote:
> > > > Now that a header exists with macros for the media interface bus-type
> > > > values, replace hardcoding numerical constants with the corresponding
> > > > macros in the DT sources.
> > > >
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > > > ---
> > > >  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
> > > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
> > > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
> > > >  3 files changed, 13 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > index 4e58c54cde17..33ac4bd1e63b 100644
> > > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > @@ -7,6 +7,9 @@
> > > >   */
> > > >
> > > >  /dts-v1/;
> > > > +
> > > > +#include <dt-bindings/media/video-interfaces.h>
> > > > +
> > > >  #include "r8a7742-iwg21d-q7.dts"
> > > >
> > > >  / {
> > > > @@ -242,7 +245,7 @@ port {
> > > >               vin0ep: endpoint {
> > > >                       remote-endpoint = <&cam0ep>;
> > > >                       bus-width = <8>;
> > > > -                     bus-type = <6>;
> > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > >               };
> > > >       };
> > > >  };
> > > > @@ -273,7 +276,7 @@ port {
> > > >               vin1ep: endpoint {
> > > >                       remote-endpoint = <&cam1ep>;
> > > >                       bus-width = <8>;
> > > > -                     bus-type = <6>;
> > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > >               };
> > > >       };
> > > >  };
> > > > @@ -305,7 +308,7 @@ vin2ep: endpoint {
> > > >                       remote-endpoint = <&cam2ep>;
> > > >                       bus-width = <8>;
> > > >                       data-shift = <8>;
> > > > -                     bus-type = <6>;
> > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > >               };
> > > >       };
> > > >  };
> > > > @@ -335,7 +338,7 @@ port {
> > > >               vin3ep: endpoint {
> > > >                       remote-endpoint = <&cam3ep>;
> > > >                       bus-width = <8>;
> > > > -                     bus-type = <6>;
> > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > >               };
> > > >       };
> > > >  };
> > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > index 40cef0b1d1e6..c73160df619d 100644
> > > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > @@ -7,6 +7,8 @@
> > > >   * Copyright (C) 2020 Renesas Electronics Corp.
> > > >   */
> > > >
> > > > +#include <dt-bindings/media/video-interfaces.h>
> >
> > This .dtsi file is only intended to be included by
> > arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts, which already has
> > the include.  Hence if you don't mind, I would like to drop this part
> > while applying  and queuing in renesas-devel for v6.3.
>
> Isn't it better to include headers as needed to avoid depending on
> indirect includes ?

In general, I agree.
In this particular case, (the multiple inclusions of) the
r8a7742-iwg21d-q7-dbcm-ov*-single.dtsi files are tied very intimately
to r8a7742-iwg21d-q7-dbcm-ca.dts.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Laurent Pinchart Jan. 16, 2023, 10:49 a.m. UTC | #6
On Mon, Jan 16, 2023 at 11:44:13AM +0100, Geert Uytterhoeven wrote:
> On Mon, Jan 16, 2023 at 11:38 AM Laurent Pinchart wrote:
> > On Mon, Jan 16, 2023 at 11:24:10AM +0100, Geert Uytterhoeven wrote:
> > > On Sat, Jan 14, 2023 at 4:26 PM Laurent Pinchart wrote:
> > > > Geert, could you please take this in your tree for v6.3 ? The two
> > > > patches that the DT changes depend on have been merged in v6.2.
> > >
> > > Thank you, I had missed these.
> > >
> > > > On Thu, Jun 16, 2022 at 01:14:09AM +0300, Laurent Pinchart wrote:
> > > > > Now that a header exists with macros for the media interface bus-type
> > > > > values, replace hardcoding numerical constants with the corresponding
> > > > > macros in the DT sources.
> > > > >
> > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > >
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >
> > > > > ---
> > > > >  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
> > > > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
> > > > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
> > > > >  3 files changed, 13 insertions(+), 6 deletions(-)
> > > > >
> > > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > > index 4e58c54cde17..33ac4bd1e63b 100644
> > > > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > > @@ -7,6 +7,9 @@
> > > > >   */
> > > > >
> > > > >  /dts-v1/;
> > > > > +
> > > > > +#include <dt-bindings/media/video-interfaces.h>
> > > > > +
> > > > >  #include "r8a7742-iwg21d-q7.dts"
> > > > >
> > > > >  / {
> > > > > @@ -242,7 +245,7 @@ port {
> > > > >               vin0ep: endpoint {
> > > > >                       remote-endpoint = <&cam0ep>;
> > > > >                       bus-width = <8>;
> > > > > -                     bus-type = <6>;
> > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > >               };
> > > > >       };
> > > > >  };
> > > > > @@ -273,7 +276,7 @@ port {
> > > > >               vin1ep: endpoint {
> > > > >                       remote-endpoint = <&cam1ep>;
> > > > >                       bus-width = <8>;
> > > > > -                     bus-type = <6>;
> > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > >               };
> > > > >       };
> > > > >  };
> > > > > @@ -305,7 +308,7 @@ vin2ep: endpoint {
> > > > >                       remote-endpoint = <&cam2ep>;
> > > > >                       bus-width = <8>;
> > > > >                       data-shift = <8>;
> > > > > -                     bus-type = <6>;
> > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > >               };
> > > > >       };
> > > > >  };
> > > > > @@ -335,7 +338,7 @@ port {
> > > > >               vin3ep: endpoint {
> > > > >                       remote-endpoint = <&cam3ep>;
> > > > >                       bus-width = <8>;
> > > > > -                     bus-type = <6>;
> > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > >               };
> > > > >       };
> > > > >  };
> > > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > > index 40cef0b1d1e6..c73160df619d 100644
> > > > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > > @@ -7,6 +7,8 @@
> > > > >   * Copyright (C) 2020 Renesas Electronics Corp.
> > > > >   */
> > > > >
> > > > > +#include <dt-bindings/media/video-interfaces.h>
> > >
> > > This .dtsi file is only intended to be included by
> > > arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts, which already has
> > > the include.  Hence if you don't mind, I would like to drop this part
> > > while applying  and queuing in renesas-devel for v6.3.
> >
> > Isn't it better to include headers as needed to avoid depending on
> > indirect includes ?
> 
> In general, I agree.
> In this particular case, (the multiple inclusions of) the
> r8a7742-iwg21d-q7-dbcm-ov*-single.dtsi files are tied very intimately
> to r8a7742-iwg21d-q7-dbcm-ca.dts.

I'd still prefer keeping the #include here, but you're the maintainer
:-)
Geert Uytterhoeven Jan. 16, 2023, 11:23 a.m. UTC | #7
Hi Laurent,

On Mon, Jan 16, 2023 at 11:49 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Mon, Jan 16, 2023 at 11:44:13AM +0100, Geert Uytterhoeven wrote:
> > On Mon, Jan 16, 2023 at 11:38 AM Laurent Pinchart wrote:
> > > On Mon, Jan 16, 2023 at 11:24:10AM +0100, Geert Uytterhoeven wrote:
> > > > On Sat, Jan 14, 2023 at 4:26 PM Laurent Pinchart wrote:
> > > > > Geert, could you please take this in your tree for v6.3 ? The two
> > > > > patches that the DT changes depend on have been merged in v6.2.
> > > >
> > > > Thank you, I had missed these.
> > > >
> > > > > On Thu, Jun 16, 2022 at 01:14:09AM +0300, Laurent Pinchart wrote:
> > > > > > Now that a header exists with macros for the media interface bus-type
> > > > > > values, replace hardcoding numerical constants with the corresponding
> > > > > > macros in the DT sources.
> > > > > >
> > > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > >
> > > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > >
> > > > > > ---
> > > > > >  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
> > > > > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
> > > > > >  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
> > > > > >  3 files changed, 13 insertions(+), 6 deletions(-)
> > > > > >
> > > > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > > > index 4e58c54cde17..33ac4bd1e63b 100644
> > > > > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > > > > > @@ -7,6 +7,9 @@
> > > > > >   */
> > > > > >
> > > > > >  /dts-v1/;
> > > > > > +
> > > > > > +#include <dt-bindings/media/video-interfaces.h>
> > > > > > +
> > > > > >  #include "r8a7742-iwg21d-q7.dts"
> > > > > >
> > > > > >  / {
> > > > > > @@ -242,7 +245,7 @@ port {
> > > > > >               vin0ep: endpoint {
> > > > > >                       remote-endpoint = <&cam0ep>;
> > > > > >                       bus-width = <8>;
> > > > > > -                     bus-type = <6>;
> > > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > > >               };
> > > > > >       };
> > > > > >  };
> > > > > > @@ -273,7 +276,7 @@ port {
> > > > > >               vin1ep: endpoint {
> > > > > >                       remote-endpoint = <&cam1ep>;
> > > > > >                       bus-width = <8>;
> > > > > > -                     bus-type = <6>;
> > > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > > >               };
> > > > > >       };
> > > > > >  };
> > > > > > @@ -305,7 +308,7 @@ vin2ep: endpoint {
> > > > > >                       remote-endpoint = <&cam2ep>;
> > > > > >                       bus-width = <8>;
> > > > > >                       data-shift = <8>;
> > > > > > -                     bus-type = <6>;
> > > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > > >               };
> > > > > >       };
> > > > > >  };
> > > > > > @@ -335,7 +338,7 @@ port {
> > > > > >               vin3ep: endpoint {
> > > > > >                       remote-endpoint = <&cam3ep>;
> > > > > >                       bus-width = <8>;
> > > > > > -                     bus-type = <6>;
> > > > > > +                     bus-type = <MEDIA_BUS_TYPE_BT656>;
> > > > > >               };
> > > > > >       };
> > > > > >  };
> > > > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > > > index 40cef0b1d1e6..c73160df619d 100644
> > > > > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > > > > > @@ -7,6 +7,8 @@
> > > > > >   * Copyright (C) 2020 Renesas Electronics Corp.
> > > > > >   */
> > > > > >
> > > > > > +#include <dt-bindings/media/video-interfaces.h>
> > > >
> > > > This .dtsi file is only intended to be included by
> > > > arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts, which already has
> > > > the include.  Hence if you don't mind, I would like to drop this part
> > > > while applying  and queuing in renesas-devel for v6.3.
> > >
> > > Isn't it better to include headers as needed to avoid depending on
> > > indirect includes ?
> >
> > In general, I agree.
> > In this particular case, (the multiple inclusions of) the
> > r8a7742-iwg21d-q7-dbcm-ov*-single.dtsi files are tied very intimately
> > to r8a7742-iwg21d-q7-dbcm-ca.dts.
>
> I'd still prefer keeping the #include here, but you're the maintainer
> :-)

OK, will keep them.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
index 4e58c54cde17..33ac4bd1e63b 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
@@ -7,6 +7,9 @@ 
  */
 
 /dts-v1/;
+
+#include <dt-bindings/media/video-interfaces.h>
+
 #include "r8a7742-iwg21d-q7.dts"
 
 / {
@@ -242,7 +245,7 @@  port {
 		vin0ep: endpoint {
 			remote-endpoint = <&cam0ep>;
 			bus-width = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
@@ -273,7 +276,7 @@  port {
 		vin1ep: endpoint {
 			remote-endpoint = <&cam1ep>;
 			bus-width = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
@@ -305,7 +308,7 @@  vin2ep: endpoint {
 			remote-endpoint = <&cam2ep>;
 			bus-width = <8>;
 			data-shift = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
@@ -335,7 +338,7 @@  port {
 		vin3ep: endpoint {
 			remote-endpoint = <&cam3ep>;
 			bus-width = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
index 40cef0b1d1e6..c73160df619d 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
@@ -7,6 +7,8 @@ 
  * Copyright (C) 2020 Renesas Electronics Corp.
  */
 
+#include <dt-bindings/media/video-interfaces.h>
+
 #define CAM_ENABLED	1
 
 &CAM_PARENT_I2C {
@@ -26,7 +28,7 @@  port {
 			CAM_EP: endpoint {
 				bus-width = <8>;
 				data-shift = <2>;
-				bus-type = <6>;
+				bus-type = <MEDIA_BUS_TYPE_BT656>;
 				pclk-sample = <1>;
 				remote-endpoint = <&VIN_EP>;
 			};
diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
index f5e77f024251..a7f5cfec64b8 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
@@ -7,6 +7,8 @@ 
  * Copyright (C) 2020 Renesas Electronics Corp.
  */
 
+#include <dt-bindings/media/video-interfaces.h>
+
 #define CAM_ENABLED	1
 
 &CAM_PARENT_I2C {
@@ -21,7 +23,7 @@  ov7725@21 {
 		port {
 			CAM_EP: endpoint {
 				bus-width = <8>;
-				bus-type = <6>;
+				bus-type = <MEDIA_BUS_TYPE_BT656>;
 				remote-endpoint = <&VIN_EP>;
 			};
 		};