diff mbox series

[v3,2/3] dt-bindings: Add header for the ingenic-drm driver bindings

Message ID 20190414200824.28348-2-paul@crapouillou.net (mailing list archive)
State New, archived
Headers show
Series [v3,1/3] dt-bindings: Add doc for the ingenic-drm driver | expand

Commit Message

Paul Cercueil April 14, 2019, 8:08 p.m. UTC
Add macros that can be used with the ingenic,lcd-mode property in the
devicetree node that corresponds to the ingenic-drm driver.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: Artur Rojek <contact@artur-rojek.eu>
---

Notes:
    v2: No change
    
    v3: s/_DRM//

 include/dt-bindings/display/ingenic,drm.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 include/dt-bindings/display/ingenic,drm.h

Comments

Rob Herring April 17, 2019, 1:47 p.m. UTC | #1
On Sun, Apr 14, 2019 at 3:08 PM Paul Cercueil <paul@crapouillou.net> wrote:
>
> Add macros that can be used with the ingenic,lcd-mode property in the
> devicetree node that corresponds to the ingenic-drm driver.

DRM is a Linuxism.

>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Tested-by: Artur Rojek <contact@artur-rojek.eu>
> ---
>
> Notes:
>     v2: No change
>
>     v3: s/_DRM//
>
>  include/dt-bindings/display/ingenic,drm.h | 28 ++++++++++++++++++++++++++++

DRM is a Linuxism...

>  1 file changed, 28 insertions(+)
>  create mode 100644 include/dt-bindings/display/ingenic,drm.h
>
> diff --git a/include/dt-bindings/display/ingenic,drm.h b/include/dt-bindings/display/ingenic,drm.h
> new file mode 100644
> index 000000000000..c749b8c346fc
> --- /dev/null
> +++ b/include/dt-bindings/display/ingenic,drm.h
> @@ -0,0 +1,28 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + *  Ingenic JZ47xx KMS driver

Pretty sure this file is not a KMS driver.

> + *
> + *  Copyright (C) 2019, Paul Cercueil <paul@crapouillou.net>
> + */
> +#ifndef __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
> +#define __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
> +
> +#define JZ_LCD_GENERIC_16BIT                   0
> +#define JZ_LCD_GENERIC_18BIT                   16

We have some generic properties for defining the bus width already.
Plus, in many cases this can be implied by the panel compatible. The
exceptions are cases such as when both the ctrlr and panel support
multiple modes.

> +
> +#define JZ_LCD_SPECIAL_TFT_1                   1
> +#define JZ_LCD_SPECIAL_TFT_2                   2
> +#define JZ_LCD_SPECIAL_TFT_3                   3
> +
> +#define JZ_LCD_NON_INTERLACED_TV_OUT           4
> +#define JZ_LCD_INTERLACED_TV_OUT               6

Wouldn't this be determined by the type of connector (composite vs.
s-video/component)

> +
> +#define JZ_LCD_SINGLE_COLOR_STN                        8
> +#define JZ_LCD_SINGLE_MONOCHROME_STN           9
> +#define JZ_LCD_DUAL_COLOR_STN                  10
> +#define JZ_LCD_DUAL_MONOCHROME_STN             11
> +
> +#define JZ_LCD_8BIT_SERIAL                     12
> +#define JZ_LCD_LCM                             13
> +
> +#endif /* __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__ */
> --
> 2.11.0
>
Rob Herring April 17, 2019, 1:52 p.m. UTC | #2
Paul, This mail bounced for me, but the other one on patch 1 didn't.

On Wed, Apr 17, 2019 at 8:47 AM Rob Herring <robh+dt@kernel.org> wrote:
>
> On Sun, Apr 14, 2019 at 3:08 PM Paul Cercueil <paul@crapouillou.net> wrote:
> >
> > Add macros that can be used with the ingenic,lcd-mode property in the
> > devicetree node that corresponds to the ingenic-drm driver.
>
> DRM is a Linuxism.
>
> >
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > Tested-by: Artur Rojek <contact@artur-rojek.eu>
> > ---
> >
> > Notes:
> >     v2: No change
> >
> >     v3: s/_DRM//
> >
> >  include/dt-bindings/display/ingenic,drm.h | 28 ++++++++++++++++++++++++++++
>
> DRM is a Linuxism...
>
> >  1 file changed, 28 insertions(+)
> >  create mode 100644 include/dt-bindings/display/ingenic,drm.h
> >
> > diff --git a/include/dt-bindings/display/ingenic,drm.h b/include/dt-bindings/display/ingenic,drm.h
> > new file mode 100644
> > index 000000000000..c749b8c346fc
> > --- /dev/null
> > +++ b/include/dt-bindings/display/ingenic,drm.h
> > @@ -0,0 +1,28 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + *  Ingenic JZ47xx KMS driver
>
> Pretty sure this file is not a KMS driver.
>
> > + *
> > + *  Copyright (C) 2019, Paul Cercueil <paul@crapouillou.net>
> > + */
> > +#ifndef __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
> > +#define __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
> > +
> > +#define JZ_LCD_GENERIC_16BIT                   0
> > +#define JZ_LCD_GENERIC_18BIT                   16
>
> We have some generic properties for defining the bus width already.
> Plus, in many cases this can be implied by the panel compatible. The
> exceptions are cases such as when both the ctrlr and panel support
> multiple modes.
>
> > +
> > +#define JZ_LCD_SPECIAL_TFT_1                   1
> > +#define JZ_LCD_SPECIAL_TFT_2                   2
> > +#define JZ_LCD_SPECIAL_TFT_3                   3
> > +
> > +#define JZ_LCD_NON_INTERLACED_TV_OUT           4
> > +#define JZ_LCD_INTERLACED_TV_OUT               6
>
> Wouldn't this be determined by the type of connector (composite vs.
> s-video/component)
>
> > +
> > +#define JZ_LCD_SINGLE_COLOR_STN                        8
> > +#define JZ_LCD_SINGLE_MONOCHROME_STN           9
> > +#define JZ_LCD_DUAL_COLOR_STN                  10
> > +#define JZ_LCD_DUAL_MONOCHROME_STN             11
> > +
> > +#define JZ_LCD_8BIT_SERIAL                     12
> > +#define JZ_LCD_LCM                             13
> > +
> > +#endif /* __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__ */
> > --
> > 2.11.0
> >
Ezequiel Garcia April 20, 2019, 12:23 p.m. UTC | #3
On Wed, 17 Apr 2019 at 10:48, Rob Herring <robh+dt@kernel.org> wrote:
>
> On Sun, Apr 14, 2019 at 3:08 PM Paul Cercueil <paul@crapouillou.net> wrote:
> >
> > Add macros that can be used with the ingenic,lcd-mode property in the
> > devicetree node that corresponds to the ingenic-drm driver.
>
> DRM is a Linuxism.
>
> >
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > Tested-by: Artur Rojek <contact@artur-rojek.eu>
> > ---
> >
> > Notes:
> >     v2: No change
> >
> >     v3: s/_DRM//
> >
> >  include/dt-bindings/display/ingenic,drm.h | 28 ++++++++++++++++++++++++++++
>
> DRM is a Linuxism...
>
> >  1 file changed, 28 insertions(+)
> >  create mode 100644 include/dt-bindings/display/ingenic,drm.h
> >
> > diff --git a/include/dt-bindings/display/ingenic,drm.h b/include/dt-bindings/display/ingenic,drm.h
> > new file mode 100644
> > index 000000000000..c749b8c346fc
> > --- /dev/null
> > +++ b/include/dt-bindings/display/ingenic,drm.h
> > @@ -0,0 +1,28 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + *  Ingenic JZ47xx KMS driver
>
> Pretty sure this file is not a KMS driver.
>
> > + *
> > + *  Copyright (C) 2019, Paul Cercueil <paul@crapouillou.net>
> > + */
> > +#ifndef __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
> > +#define __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
> > +
> > +#define JZ_LCD_GENERIC_16BIT                   0
> > +#define JZ_LCD_GENERIC_18BIT                   16
>
> We have some generic properties for defining the bus width already.
> Plus, in many cases this can be implied by the panel compatible. The
> exceptions are cases such as when both the ctrlr and panel support
> multiple modes.
>

In the same direction as Rob's comment, I'd like to see these decoupled
from the register value.

Ideally, we'd like to reuse this driver and its bindings for JZ4780,
and these values are already different.

Thanks!
Paul Cercueil April 22, 2019, 4:13 p.m. UTC | #4
Hi,

Le sam. 20 avril 2019 à 14:23, Ezequiel Garcia 
<ezequiel@vanguardiasur.com.ar> a écrit :
> On Wed, 17 Apr 2019 at 10:48, Rob Herring <robh+dt@kernel.org> wrote:
>> 
>>  On Sun, Apr 14, 2019 at 3:08 PM Paul Cercueil 
>> <paul@crapouillou.net> wrote:
>>  >
>>  > Add macros that can be used with the ingenic,lcd-mode property in 
>> the
>>  > devicetree node that corresponds to the ingenic-drm driver.
>> 
>>  DRM is a Linuxism.
>> 
>>  >
>>  > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  > Tested-by: Artur Rojek <contact@artur-rojek.eu>
>>  > ---
>>  >
>>  > Notes:
>>  >     v2: No change
>>  >
>>  >     v3: s/_DRM//
>>  >
>>  >  include/dt-bindings/display/ingenic,drm.h | 28 
>> ++++++++++++++++++++++++++++
>> 
>>  DRM is a Linuxism...
>> 
>>  >  1 file changed, 28 insertions(+)
>>  >  create mode 100644 include/dt-bindings/display/ingenic,drm.h
>>  >
>>  > diff --git a/include/dt-bindings/display/ingenic,drm.h 
>> b/include/dt-bindings/display/ingenic,drm.h
>>  > new file mode 100644
>>  > index 000000000000..c749b8c346fc
>>  > --- /dev/null
>>  > +++ b/include/dt-bindings/display/ingenic,drm.h
>>  > @@ -0,0 +1,28 @@
>>  > +/* SPDX-License-Identifier: GPL-2.0 */
>>  > +/*
>>  > + *  Ingenic JZ47xx KMS driver
>> 
>>  Pretty sure this file is not a KMS driver.
>> 
>>  > + *
>>  > + *  Copyright (C) 2019, Paul Cercueil <paul@crapouillou.net>
>>  > + */
>>  > +#ifndef __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
>>  > +#define __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
>>  > +
>>  > +#define JZ_LCD_GENERIC_16BIT                   0
>>  > +#define JZ_LCD_GENERIC_18BIT                   16
>> 
>>  We have some generic properties for defining the bus width already.
>>  Plus, in many cases this can be implied by the panel compatible. The
>>  exceptions are cases such as when both the ctrlr and panel support
>>  multiple modes.
>> 
> 
> In the same direction as Rob's comment, I'd like to see these 
> decoupled
> from the register value.
> 
> Ideally, we'd like to reuse this driver and its bindings for JZ4780,
> and these values are already different.

Well they are not any different on the JZ4780, I just checked on the 
manual.
But yes, I don't mind getting rid of that devicetree property and its
corresponding bindings file.

The major problem is that we don't have a way to map some of the values 
there
to DRM macros. I sumitted a PR to add a MEDIA_BUS_FMT_RGB888_3X8_BE bus 
format
(that I could detect to support 8-bit serial TFT panels, which is what 
the
Ben Nanonote uses), but I miss a way to detect the special* TFT panels.
I will leave these aside for now, but I want to support them eventually.

Thanks,
-Paul

* "special" TFT panels have extra pins (CLS, SPL, REV, PS) and seem to 
be a
thing from Sharp. Ingenic SoCs (as well as i.MX SoCs) have the required
hardware to drive these panels.

> Thanks!
> --
> Ezequiel García, VanguardiaSur
> www.vanguardiasur.com.ar
diff mbox series

Patch

diff --git a/include/dt-bindings/display/ingenic,drm.h b/include/dt-bindings/display/ingenic,drm.h
new file mode 100644
index 000000000000..c749b8c346fc
--- /dev/null
+++ b/include/dt-bindings/display/ingenic,drm.h
@@ -0,0 +1,28 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *  Ingenic JZ47xx KMS driver
+ *
+ *  Copyright (C) 2019, Paul Cercueil <paul@crapouillou.net>
+ */
+#ifndef __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
+#define __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__
+
+#define JZ_LCD_GENERIC_16BIT			0
+#define JZ_LCD_GENERIC_18BIT			16
+
+#define JZ_LCD_SPECIAL_TFT_1			1
+#define JZ_LCD_SPECIAL_TFT_2			2
+#define JZ_LCD_SPECIAL_TFT_3			3
+
+#define JZ_LCD_NON_INTERLACED_TV_OUT		4
+#define JZ_LCD_INTERLACED_TV_OUT		6
+
+#define JZ_LCD_SINGLE_COLOR_STN			8
+#define JZ_LCD_SINGLE_MONOCHROME_STN		9
+#define JZ_LCD_DUAL_COLOR_STN			10
+#define JZ_LCD_DUAL_MONOCHROME_STN		11
+
+#define JZ_LCD_8BIT_SERIAL			12
+#define JZ_LCD_LCM				13
+
+#endif /* __INCLUDE_DT_BINDINGS_DISPLAY_INGENIC_DRM_H__ */