diff mbox series

[1/3] dt-bindings: Add doc for the ingenic-drm driver

Message ID 20190228220756.20262-2-paul@crapouillou.net (mailing list archive)
State Not Applicable
Headers show
Series Ingenic JZ47xx KMS driver | expand

Commit Message

Paul Cercueil Feb. 28, 2019, 10:07 p.m. UTC
Add documentation for the devicetree bindings of the DRM driver for the
JZ47xx family of SoCs from Ingenic.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: Artur Rojek <contact@artur-rojek.eu>
---
 .../devicetree/bindings/display/ingenic,drm.txt    | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/ingenic,drm.txt

Comments

Sam Ravnborg March 1, 2019, 8:16 p.m. UTC | #1
Hi Paul.

Good to see work migrating fbdev => drm.

Following comments is based on experience while working on migrating
another driver from fbdev => drm.

On Thu, Feb 28, 2019 at 07:07:54PM -0300, Paul Cercueil wrote:
> Add documentation for the devicetree bindings of the DRM driver for the
> JZ47xx family of SoCs from Ingenic.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Tested-by: Artur Rojek <contact@artur-rojek.eu>
> ---
>  .../devicetree/bindings/display/ingenic,drm.txt    | 30 ++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/ingenic,drm.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/ingenic,drm.txt b/Documentation/devicetree/bindings/display/ingenic,drm.txt
> new file mode 100644
> index 000000000000..52a368ec35cd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/ingenic,drm.txt
> @@ -0,0 +1,30 @@
> +Ingenic JZ47xx DRM driver
> +
> +Required properties:
> +- compatible: one of:
> +  * ingenic,jz4740-drm
> +  * ingenic,jz4725b-drm
> +- reg: LCD registers location and length
The fbdev way of doing this was to hardcode register setttings.
In the drm world we read the configuration of the panel and let
this decide the actual configuration.

Note that no drm drivers supports stn displays and that there
is really no use for this these days. So you can skip the STN parts.

Also the modern way to specify a panel in the DT is using OF graph bindings.
You can find many examples how to do this.

I was there with the atmel LCDC driver (not in the kernel yet),
and had some challenges with this.

	Sam
Paul Cercueil March 1, 2019, 10:40 p.m. UTC | #2
Hi Sam, thanks for the feedback.

Le ven. 1 mars 2019 à 17:16, Sam Ravnborg <sam@ravnborg.org> a écrit :
> Hi Paul.
> 
> Good to see work migrating fbdev => drm.
> 
> Following comments is based on experience while working on migrating
> another driver from fbdev => drm.
> 
> On Thu, Feb 28, 2019 at 07:07:54PM -0300, Paul Cercueil wrote:
>>  Add documentation for the devicetree bindings of the DRM driver for 
>> the
>>  JZ47xx family of SoCs from Ingenic.
>> 
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  Tested-by: Artur Rojek <contact@artur-rojek.eu>
>>  ---
>>   .../devicetree/bindings/display/ingenic,drm.txt    | 30 
>> ++++++++++++++++++++++
>>   1 file changed, 30 insertions(+)
>>   create mode 100644 
>> Documentation/devicetree/bindings/display/ingenic,drm.txt
>> 
>>  diff --git 
>> a/Documentation/devicetree/bindings/display/ingenic,drm.txt 
>> b/Documentation/devicetree/bindings/display/ingenic,drm.txt
>>  new file mode 100644
>>  index 000000000000..52a368ec35cd
>>  --- /dev/null
>>  +++ b/Documentation/devicetree/bindings/display/ingenic,drm.txt
>>  @@ -0,0 +1,30 @@
>>  +Ingenic JZ47xx DRM driver
>>  +
>>  +Required properties:
>>  +- compatible: one of:
>>  +  * ingenic,jz4740-drm
>>  +  * ingenic,jz4725b-drm
>>  +- reg: LCD registers location and length
> The fbdev way of doing this was to hardcode register setttings.
> In the drm world we read the configuration of the panel and let
> this decide the actual configuration.
> 
> Note that no drm drivers supports stn displays and that there
> is really no use for this these days. So you can skip the STN parts.

STN panels aren't really my problem; but I have a board with a Sharp
LS020B1DD01D panel, which requires the LCD IP to be configured for a
"special 2" panel. I also have a board with a "smart" panel (ili9331)
that needs a special configuration in the IP. There is nothing in
the drm_panel interface that tells me what mode I should use for what
panel...

> Also the modern way to specify a panel in the DT is using OF graph 
> bindings.
> You can find many examples how to do this.

Ok, I was looking at the Tegra driver, which uses a "nvidia,panel" DT
property. I will change it to use the graph thing.

> I was there with the atmel LCDC driver (not in the kernel yet),
> and had some challenges with this.
> 
> 	Sam

Thanks,
-Paul
Linus Walleij March 8, 2019, 10:23 p.m. UTC | #3
On Fri, Mar 1, 2019 at 11:41 PM Paul Cercueil <paul@crapouillou.net> wrote:

> I also have a board with a "smart" panel (ili9331)
> that needs a special configuration in the IP. There is nothing in
> the drm_panel interface that tells me what mode I should use for what
> panel...

Is the ILI9331 anything similar to ILI9322 that I have a driver
for in drivers/gpu/drm/panel/panel-ilitek-ili9322.c?
I was hoping they would be similar and we ẃould be able
to just reuse that driver for more of them but I might be
mistaken.

Yours,
Linus Walleij
Rob Herring March 9, 2019, 12:23 a.m. UTC | #4
On Thu, Feb 28, 2019 at 4:08 PM Paul Cercueil <paul@crapouillou.net> wrote:
>
> Add documentation for the devicetree bindings of the DRM driver for the
> JZ47xx family of SoCs from Ingenic.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Tested-by: Artur Rojek <contact@artur-rojek.eu>
> ---
>  .../devicetree/bindings/display/ingenic,drm.txt    | 30 ++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/ingenic,drm.txt
>
> diff --git a/Documentation/devicetree/bindings/display/ingenic,drm.txt b/Documentation/devicetree/bindings/display/ingenic,drm.txt
> new file mode 100644
> index 000000000000..52a368ec35cd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/ingenic,drm.txt
> @@ -0,0 +1,30 @@
> +Ingenic JZ47xx DRM driver
> +
> +Required properties:
> +- compatible: one of:
> +  * ingenic,jz4740-drm
> +  * ingenic,jz4725b-drm

DRM is a kernel thing. What's the h/w called?

> +- reg: LCD registers location and length
> +- clocks: LCD pixclock and device clock specifiers.
> +          The device clock is only required on the JZ4740.
> +- clock-names: "lcd_pclk" and "lcd"
> +- interrupts: Specifies the interrupt line the LCD controller is connected to.
> +
> +Optional properties:
> +- ingenic,panel: phandle to a display panel, if one is present

Use the graph binding or a child node. See other bindings.

> +- ingenic,lcd-mode: LCD mode to use with the display panel.
> +                   See <dt-bindings/display/ingenic,drm.h> for all the
> +                   possible values.
> +
> +Example:
> +
> +lcd: lcd-controller@13050000 {
> +       compatible = "ingenic,jz4725b-drm";
> +       reg = <0x13050000 0x1000>;
> +
> +       interrupt-parent = <&intc>;
> +       interrupts = <31>;
> +
> +       clocks = <&cgu JZ4725B_CLK_LCD>;
> +       clock-names = "lcd";
> +};
> --
> 2.11.0
>
Paul Cercueil March 9, 2019, 12:33 p.m. UTC | #5
Hi Linus,

On Fri, Mar 8, 2019 at 11:23 PM, Linus Walleij 
<linus.walleij@linaro.org> wrote:
> On Fri, Mar 1, 2019 at 11:41 PM Paul Cercueil <paul@crapouillou.net 
> <mailto:paul@crapouillou.net>> wrote:
> 
>>  I also have a board with a "smart" panel (ili9331)
>>  that needs a special configuration in the IP. There is nothing in
>>  the drm_panel interface that tells me what mode I should use for 
>> what
>>  panel...
> 
> Is the ILI9331 anything similar to ILI9322 that I have a driver
> for in drivers/gpu/drm/panel/panel-ilitek-ili9322.c?
> I was hoping they would be similar and we ẃould be able
> to just reuse that driver for more of them but I might be
> mistaken.

That's a bit hard to tell right now, but from a quick look at the
datasheet, it looks quite different :(

-Paul
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/ingenic,drm.txt b/Documentation/devicetree/bindings/display/ingenic,drm.txt
new file mode 100644
index 000000000000..52a368ec35cd
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/ingenic,drm.txt
@@ -0,0 +1,30 @@ 
+Ingenic JZ47xx DRM driver
+
+Required properties:
+- compatible: one of:
+  * ingenic,jz4740-drm
+  * ingenic,jz4725b-drm
+- reg: LCD registers location and length
+- clocks: LCD pixclock and device clock specifiers.
+	   The device clock is only required on the JZ4740.
+- clock-names: "lcd_pclk" and "lcd"
+- interrupts: Specifies the interrupt line the LCD controller is connected to.
+
+Optional properties:
+- ingenic,panel: phandle to a display panel, if one is present
+- ingenic,lcd-mode: LCD mode to use with the display panel.
+		    See <dt-bindings/display/ingenic,drm.h> for all the
+		    possible values.
+
+Example:
+
+lcd: lcd-controller@13050000 {
+	compatible = "ingenic,jz4725b-drm";
+	reg = <0x13050000 0x1000>;
+
+	interrupt-parent = <&intc>;
+	interrupts = <31>;
+
+	clocks = <&cgu JZ4725B_CLK_LCD>;
+	clock-names = "lcd";
+};