* [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
2020-03-30 15:42 ` [RFC v3 1/8] dt-bindings: display: convert ingenic,lcd.txt to ingenic,lcd.yaml Rob Herring
2020-04-09 7:25 ` Sam Ravnborg
2020-03-29 17:35 ` [RFC v3 2/8] drm: ingenic-drm: add MODULE_DEVICE_TABLE H. Nikolaus Schaller
` (6 subsequent siblings)
7 siblings, 2 replies; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel
and add compatible: jz4780-lcd, including an example how to
configure both lcd controllers.
Also fix the clock names and examples.
Based on work by Paul Cercueil <paul@crapouillou.net> and
Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
---
.../bindings/display/ingenic,lcd.txt | 45 ------
.../bindings/display/ingenic,lcd.yaml | 128 ++++++++++++++++++
2 files changed, 128 insertions(+), 45 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.txt
create mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.yaml
diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.txt b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
deleted file mode 100644
index 01e3261defb6..000000000000
--- a/Documentation/devicetree/bindings/display/ingenic,lcd.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-Ingenic JZ47xx LCD driver
-
-Required properties:
-- compatible: one of:
- * ingenic,jz4740-lcd
- * ingenic,jz4725b-lcd
- * ingenic,jz4770-lcd
-- 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.
-
-Example:
-
-panel {
- compatible = "sharp,ls020b1dd01d";
-
- backlight = <&backlight>;
- power-supply = <&vcc>;
-
- port {
- panel_input: endpoint {
- remote-endpoint = <&panel_output>;
- };
- };
-};
-
-
-lcd: lcd-controller@13050000 {
- compatible = "ingenic,jz4725b-lcd";
- reg = <0x13050000 0x1000>;
-
- interrupt-parent = <&intc>;
- interrupts = <31>;
-
- clocks = <&cgu JZ4725B_CLK_LCD>;
- clock-names = "lcd";
-
- port {
- panel_output: endpoint {
- remote-endpoint = <&panel_input>;
- };
- };
-};
diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.yaml b/Documentation/devicetree/bindings/display/ingenic,lcd.yaml
new file mode 100644
index 000000000000..8b6467cfc191
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/ingenic,lcd.yaml
@@ -0,0 +1,128 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/ingenic,lcd.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bindings for Ingenic JZ4780 LCD Controller
+
+maintainers:
+ - Paul Cercueil <paul@crapouillou.net>
+
+description: |
+ LCD Controller is the Display Controller for the Ingenic JZ47xx SoC
+
+properties:
+ compatible:
+ oneOf:
+ - const: ingenic,jz4725b-lcd
+ - const: ingenic,jz4740-lcd
+ - const: ingenic,jz4770-lcd
+ - const: ingenic,jz4780-lcd
+
+ reg:
+ maxItems: 1
+ description: LCD registers location and length
+
+ interrupts:
+ maxItems: 1
+ description: Specifies the interrupt provided by parent
+
+ clocks:
+ maxItems: 2
+ description: Clock specifiers for LCD pixclock and device clock.
+ The device clock is only required on the JZ4740 and JZ4780
+
+ clock-names:
+ items:
+ - const: lcd
+ - const: lcd_pclk
+
+ port:
+ type: object
+ description: |
+ A port node with endpoint definitions as defined in
+ Documentation/devicetree/bindings/media/video-interfaces.txt
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+ - port
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/jz4725b-cgu.h>
+
+ panel {
+ compatible = "sharp,ls020b1dd01d";
+
+ backlight = <&backlight>;
+ power-supply = <&vcc>;
+
+ port {
+ panel_input: endpoint {
+ remote-endpoint = <&panel_output>;
+ };
+ };
+ };
+
+ lcd: lcd-controller@13050000 {
+ compatible = "ingenic,jz4725b-lcd";
+ reg = <0x13050000 0x1000>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <31>;
+
+ clocks = <&cgu JZ4725B_CLK_LCD>;
+ clock-names = "lcd", "lcd_pclk";
+
+ port {
+ panel_output: endpoint {
+ remote-endpoint = <&panel_input>;
+ };
+ };
+ };
+
+ - |
+ #include <dt-bindings/clock/jz4780-cgu.h>
+
+ lcdc0: lcdc0@13050000 {
+ compatible = "ingenic,jz4780-lcd";
+ reg = <0x13050000 0x1800>;
+
+ clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD0PIXCLK>;
+ clock-names = "lcd", "lcd_pclk";
+
+ interrupt-parent = <&intc>;
+ interrupts = <31>;
+
+ jz4780_lcd_out: port {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ jz4780_out_hdmi: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&hdmi_in_lcd>;
+ };
+ };
+ };
+
+ lcdc1: lcdc1@130a0000 {
+ compatible = "ingenic,jz4780-lcd";
+ reg = <0x130a0000 0x1800>;
+
+ clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD1PIXCLK>;
+ clock-names = "lcd", "lcd_pclk";
+
+ interrupt-parent = <&intc>;
+ interrupts = <31>;
+
+ status = "disabled";
+ };
+
+...
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [RFC v3 1/8] dt-bindings: display: convert ingenic,lcd.txt to ingenic,lcd.yaml
2020-03-29 17:35 ` [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml H. Nikolaus Schaller
@ 2020-03-30 15:42 ` Rob Herring
2020-03-30 16:33 ` [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml H. Nikolaus Schaller
2020-04-09 7:25 ` Sam Ravnborg
1 sibling, 1 reply; 15+ messages in thread
From: Rob Herring @ 2020-03-30 15:42 UTC (permalink / raw)
To: H. Nikolaus Schaller
Cc: devicetree, Paul Boddie, Kees Cook, Geert Uytterhoeven,
David Airlie, H. Nikolaus Schaller, mips-creator-ci20-dev,
linux-kernel, dri-devel, linux-mips, Paul Cercueil, linux-gpio,
Thomas Bogendoerfer, Eric W. Biederman, Miquel Raynal,
letux-kernel
On Sun, 29 Mar 2020 19:35:47 +0200, "H. Nikolaus Schaller" wrote:
> and add compatible: jz4780-lcd, including an example how to
> configure both lcd controllers.
>
> Also fix the clock names and examples.
>
> Based on work by Paul Cercueil <paul@crapouillou.net> and
> Sam Ravnborg <sam@ravnborg.org>
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org
> ---
> .../bindings/display/ingenic,lcd.txt | 45 ------
> .../bindings/display/ingenic,lcd.yaml | 128 ++++++++++++++++++
> 2 files changed, 128 insertions(+), 45 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.txt
> create mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/ingenic,lcd.example.dt.yaml: lcd-controller@13050000: clocks: [[4294967295, 9]] is too short
See https://patchwork.ozlabs.org/patch/1263508
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml
2020-03-30 15:42 ` [RFC v3 1/8] dt-bindings: display: convert ingenic,lcd.txt to ingenic,lcd.yaml Rob Herring
@ 2020-03-30 16:33 ` H. Nikolaus Schaller
0 siblings, 0 replies; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-30 16:33 UTC (permalink / raw)
To: Paul Cercueil
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Paul Boddie, Kees Cook, Geert Uytterhoeven, David Airlie,
MIPS Creator CI20 Development, Linux Kernel Mailing List,
open list:DRM PANEL DRIVERS, linux-mips, open list:GPIO SUBSYSTEM,
Thomas Bogendoerfer, Eric W. Biederman, Miquel Raynal,
Discussions about the Letux Kernel
Hi Paul,
> Am 30.03.2020 um 17:42 schrieb Rob Herring <robh@kernel.org>:
>
> On Sun, 29 Mar 2020 19:35:47 +0200, "H. Nikolaus Schaller" wrote:
>> and add compatible: jz4780-lcd, including an example how to
>> configure both lcd controllers.
>>
>> Also fix the clock names and examples.
>>
>> Based on work by Paul Cercueil <paul@crapouillou.net> and
>> Sam Ravnborg <sam@ravnborg.org>
>>
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>> Cc: Rob Herring <robh@kernel.org>
>> Cc: devicetree@vger.kernel.org
>> ---
>> .../bindings/display/ingenic,lcd.txt | 45 ------
>> .../bindings/display/ingenic,lcd.yaml | 128 ++++++++++++++++++
>> 2 files changed, 128 insertions(+), 45 deletions(-)
>> delete mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.txt
>> create mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.yaml
>>
>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/ingenic,lcd.example.dt.yaml: lcd-controller@13050000: clocks: [[4294967295, 9]] is too short
>
> See https://patchwork.ozlabs.org/patch/1263508
If I read the message correctly, I think there should be 2 clocks specified in
the jz4725b-lcd example and not just
clocks = <&cgu JZ4725B_CLK_LCD>;
Unfortunately the jz4725b.dtsi does not seem to be upstream or in linux-next so
I don't know if it works without lcd_pclk or not.
If there is really just one clock, we need to modify the clocks and clock-names
schema and add minItems: 1 and maxItems: 2 to allow for this flexibility.
Otherwise we have to fix the example. Do you have some git with an up-to-date
jz4725b.dtsi to look at?
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure dt-schema is up to date:
>
> pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
+++ :)
>
> Please check and re-submit.
Sure, since it is a RFC.
BR and thanks,
Nikolaus
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml
2020-03-29 17:35 ` [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml H. Nikolaus Schaller
2020-03-30 15:42 ` [RFC v3 1/8] dt-bindings: display: convert ingenic,lcd.txt to ingenic,lcd.yaml Rob Herring
@ 2020-04-09 7:25 ` Sam Ravnborg
[not found] ` <F4F5D267-A538-444B-9DCA-EA87AC798FB3@goldelico.com>
1 sibling, 1 reply; 15+ messages in thread
From: Sam Ravnborg @ 2020-04-09 7:25 UTC (permalink / raw)
To: H. Nikolaus Schaller
Cc: Mark Rutland, Paul Boddie, Geert Uytterhoeven, David Airlie,
dri-devel, linux-mips, Paul Cercueil, Miquel Raynal, Andi Kleen,
Paul Burton, Krzysztof Kozlowski, mips-creator-ci20-dev,
devicetree, Kees Cook, linux-gpio, Rob Herring, letux-kernel,
Thomas Bogendoerfer, linux-kernel, Ralf Baechle,
Eric W. Biederman
Hi Nikolaus
Some comments below that will result in a simplee binding that passes
the checks.
Thanks for pushing this.
Sam
On Sun, Mar 29, 2020 at 07:35:47PM +0200, H. Nikolaus Schaller wrote:
> and add compatible: jz4780-lcd, including an example how to
> configure both lcd controllers.
>
> Also fix the clock names and examples.
>
> Based on work by Paul Cercueil <paul@crapouillou.net> and
> Sam Ravnborg <sam@ravnborg.org>
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org
> ---
> .../bindings/display/ingenic,lcd.txt | 45 ------
> .../bindings/display/ingenic,lcd.yaml | 128 ++++++++++++++++++
> 2 files changed, 128 insertions(+), 45 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.txt
> create mode 100644 Documentation/devicetree/bindings/display/ingenic,lcd.yaml
>
> diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.txt b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> deleted file mode 100644
> index 01e3261defb6..000000000000
> --- a/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -Ingenic JZ47xx LCD driver
> -
> -Required properties:
> -- compatible: one of:
> - * ingenic,jz4740-lcd
> - * ingenic,jz4725b-lcd
> - * ingenic,jz4770-lcd
> -- 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.
> -
> -Example:
> -
> -panel {
> - compatible = "sharp,ls020b1dd01d";
> -
> - backlight = <&backlight>;
> - power-supply = <&vcc>;
> -
> - port {
> - panel_input: endpoint {
> - remote-endpoint = <&panel_output>;
> - };
> - };
> -};
> -
> -
> -lcd: lcd-controller@13050000 {
> - compatible = "ingenic,jz4725b-lcd";
> - reg = <0x13050000 0x1000>;
> -
> - interrupt-parent = <&intc>;
> - interrupts = <31>;
> -
> - clocks = <&cgu JZ4725B_CLK_LCD>;
> - clock-names = "lcd";
> -
> - port {
> - panel_output: endpoint {
> - remote-endpoint = <&panel_input>;
> - };
> - };
> -};
> diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.yaml b/Documentation/devicetree/bindings/display/ingenic,lcd.yaml
> new file mode 100644
> index 000000000000..8b6467cfc191
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/ingenic,lcd.yaml
> @@ -0,0 +1,128 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/ingenic,lcd.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Bindings for Ingenic JZ4780 LCD Controller
> +
> +maintainers:
> + - Paul Cercueil <paul@crapouillou.net>
> +
> +description: |
> + LCD Controller is the Display Controller for the Ingenic JZ47xx SoC
> +
> +properties:
> + compatible:
> + oneOf:
> + - const: ingenic,jz4725b-lcd
> + - const: ingenic,jz4740-lcd
> + - const: ingenic,jz4770-lcd
> + - const: ingenic,jz4780-lcd
> +
> + reg:
> + maxItems: 1
> + description: LCD registers location and length
> +
> + interrupts:
> + maxItems: 1
> + description: Specifies the interrupt provided by parent
> +
> + clocks:
> + maxItems: 2
> + description: Clock specifiers for LCD pixclock and device clock.
> + The device clock is only required on the JZ4740 and JZ4780
> +
> + clock-names:
> + items:
> + - const: lcd
> + - const: lcd_pclk
> +
> + port:
> + type: object
> + description: |
> + A port node with endpoint definitions as defined in
> + Documentation/devicetree/bindings/media/video-interfaces.txt
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - clock-names
> + - port
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/jz4725b-cgu.h>
> +
> + panel {
> + compatible = "sharp,ls020b1dd01d";
> +
> + backlight = <&backlight>;
> + power-supply = <&vcc>;
> +
> + port {
> + panel_input: endpoint {
> + remote-endpoint = <&panel_output>;
> + };
> + };
> + };
The panel part is not needed - better to drop it.
> +
> + lcd: lcd-controller@13050000 {
> + compatible = "ingenic,jz4725b-lcd";
> + reg = <0x13050000 0x1000>;
> +
> + interrupt-parent = <&intc>;
> + interrupts = <31>;
> +
> + clocks = <&cgu JZ4725B_CLK_LCD>;
> + clock-names = "lcd", "lcd_pclk";
> +
> + port {
> + panel_output: endpoint {
> + remote-endpoint = <&panel_input>;
> + };
> + };
> + };
We know this example will not pass the check, as there is only
one clock specified.
I suggest to drop this example.
If it later turns out that jz4725b only have one clock, then the binding
needs to be updated. But the best guess is that the example is wrong.
The example below for jz4780-lcd cover all relevant parts - so
just keep it as the only example.
> +
> + - |
> + #include <dt-bindings/clock/jz4780-cgu.h>
> +
> + lcdc0: lcdc0@13050000 {
Name this lcdc
And drop "lcdc0@13050000" as this is not relevant for this example.
Remember - the examples exist to explain the binding. They are
just examples.
> + compatible = "ingenic,jz4780-lcd";
> + reg = <0x13050000 0x1800>;
> +
> + clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD0PIXCLK>;
> + clock-names = "lcd", "lcd_pclk";
> +
> + interrupt-parent = <&intc>;
> + interrupts = <31>;
> +
> + jz4780_lcd_out: port {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + jz4780_out_hdmi: endpoint@0 {
> + reg = <0>;
> + remote-endpoint = <&hdmi_in_lcd>;
> + };
> + };
> + };
> +
And drop this as it does not add anything extra.
> + lcdc1: lcdc1@130a0000 {
> + compatible = "ingenic,jz4780-lcd";
> + reg = <0x130a0000 0x1800>;
> +
> + clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD1PIXCLK>;
> + clock-names = "lcd", "lcd_pclk";
> +
> + interrupt-parent = <&intc>;
> + interrupts = <31>;
> +
> + status = "disabled";
> + };
Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [RFC v3 2/8] drm: ingenic-drm: add MODULE_DEVICE_TABLE
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
2020-05-04 1:32 ` Paul Cercueil
2020-03-29 17:35 ` [RFC v3 3/8] drm: ingenic-drm: add support for ingenic,jz4780-lcd H. Nikolaus Schaller
` (5 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel
so that the driver can load by matching the device tree
if compiled as module.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
drivers/gpu/drm/ingenic/ingenic-drm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index 6d47ef7b148c..bcba2f024842 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -843,6 +843,7 @@ static const struct of_device_id ingenic_drm_of_match[] = {
{ .compatible = "ingenic,jz4770-lcd", .data = &jz4770_soc_info },
{ /* sentinel */ },
};
+MODULE_DEVICE_TABLE(of, ingenic_drm_of_match);
static struct platform_driver ingenic_drm_driver = {
.driver = {
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [RFC v3 2/8] drm: ingenic-drm: add MODULE_DEVICE_TABLE
2020-03-29 17:35 ` [RFC v3 2/8] drm: ingenic-drm: add MODULE_DEVICE_TABLE H. Nikolaus Schaller
@ 2020-05-04 1:32 ` Paul Cercueil
0 siblings, 0 replies; 15+ messages in thread
From: Paul Cercueil @ 2020-05-04 1:32 UTC (permalink / raw)
To: H. Nikolaus Schaller
Cc: Mark Rutland, Paul Boddie, Geert Uytterhoeven, David Airlie,
dri-devel, linux-mips, Miquel Raynal, Andi Kleen, Paul Burton,
Krzysztof Kozlowski, mips-creator-ci20-dev, devicetree, Kees Cook,
linux-gpio, Rob Herring, letux-kernel, Thomas Bogendoerfer,
linux-kernel, Ralf Baechle, Eric W. Biederman
Hi Nikolaus,
Le dim. 29 mars 2020 à 19:35, H. Nikolaus Schaller <hns@goldelico.com>
a écrit :
> so that the driver can load by matching the device tree
> if compiled as module.
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Please add:
Cc: stable@vger.kernel.org # v5.3+
Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx SoCs")
And re-send this patch alone, then I can merge it ASAP.
Cheers,
-Paul
> ---
> drivers/gpu/drm/ingenic/ingenic-drm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c
> b/drivers/gpu/drm/ingenic/ingenic-drm.c
> index 6d47ef7b148c..bcba2f024842 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
> @@ -843,6 +843,7 @@ static const struct of_device_id
> ingenic_drm_of_match[] = {
> { .compatible = "ingenic,jz4770-lcd", .data = &jz4770_soc_info },
> { /* sentinel */ },
> };
> +MODULE_DEVICE_TABLE(of, ingenic_drm_of_match);
>
> static struct platform_driver ingenic_drm_driver = {
> .driver = {
> --
> 2.25.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [RFC v3 3/8] drm: ingenic-drm: add support for ingenic,jz4780-lcd
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 1/8] dt-bindings: display: convert ingenic, lcd.txt to ingenic, lcd.yaml H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 2/8] drm: ingenic-drm: add MODULE_DEVICE_TABLE H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 4/8] dt-bindings: display: add ingenic-jz4780-hdmi DT Schema H. Nikolaus Schaller
` (4 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel
This adds jz_soc_info and a compatible string for the jz4780
lcd controller.
Note that the jz4780 lcdc is a superset of the jz4740 lcdc
and the additional functions are not used if they stay
uninitialized.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
drivers/gpu/drm/ingenic/ingenic-drm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index bcba2f024842..82c28ef1ac02 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -837,10 +837,17 @@ static const struct jz_soc_info jz4770_soc_info = {
.max_height = 720,
};
+static const struct jz_soc_info jz4780_soc_info = {
+ .needs_dev_clk = true,
+ .max_width = 4096,
+ .max_height = 2048,
+};
+
static const struct of_device_id ingenic_drm_of_match[] = {
{ .compatible = "ingenic,jz4740-lcd", .data = &jz4740_soc_info },
{ .compatible = "ingenic,jz4725b-lcd", .data = &jz4725b_soc_info },
{ .compatible = "ingenic,jz4770-lcd", .data = &jz4770_soc_info },
+ { .compatible = "ingenic,jz4780-lcd", .data = &jz4780_soc_info },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, ingenic_drm_of_match);
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC v3 4/8] dt-bindings: display: add ingenic-jz4780-hdmi DT Schema
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
` (2 preceding siblings ...)
2020-03-29 17:35 ` [RFC v3 3/8] drm: ingenic-drm: add support for ingenic,jz4780-lcd H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
2020-04-09 7:12 ` Sam Ravnborg
2020-03-29 17:35 ` [RFC v3 5/8] drm: ingenic: add jz4780 Synopsys HDMI driver H. Nikolaus Schaller
` (3 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel, Sam Ravnborg
From: Sam Ravnborg <sam@ravnborg.org>
Add DT bindings for the hdmi driver for the Ingenic JZ4780 SoC.
Based on .txt binding from Zubair Lutfullah Kakakhel
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
---
.../bindings/display/ingenic-jz4780-hdmi.yaml | 82 +++++++++++++++++++
1 file changed, 82 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
diff --git a/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml b/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
new file mode 100644
index 000000000000..a545ff8704eb
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/ingenic-jz4780-hdmi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bindings for Ingenic JZ4780 HDMI Transmitter
+
+maintainers:
+ - H. Nikolaus Schaller <hns@goldelico.com>
+
+description: |
+ The HDMI Transmitter in the Ingenic JZ4780 is a Synopsys DesignWare HDMI 1.4
+ TX controller IP with accompanying PHY IP.
+
+allOf:
+ - $ref: panel/panel-common.yaml#
+
+properties:
+ compatible:
+ items:
+ - const: ingenic,jz4780-hdmi
+
+ reg:
+ maxItems: 1
+ description: the address & size of the LCD controller registers
+
+ reg-io-width:
+ const: 4
+
+ interrupts:
+ maxItems: 1
+ description: Specifies the interrupt provided by parent
+
+ clocks:
+ maxItems: 2
+ description: Clock specifiers for isrf and iahb clocks
+
+ clock-names:
+ items:
+ - const: isfr
+ - const: iahb
+
+ ddc-i2c-bus: true
+ ports: true
+
+required:
+ - compatible
+ - clocks
+ - clock-names
+ - ports
+ - reg-io-width
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/jz4780-cgu.h>
+
+ hdmi: hdmi@10180000 {
+ compatible = "ingenic,jz4780-hdmi";
+ reg = <0x10180000 0x8000>;
+ reg-io-width = <4>;
+ ddc-i2c-bus = <&i2c4>;
+ interrupt-parent = <&intc>;
+ interrupts = <3>;
+ clocks = <&cgu JZ4780_CLK_HDMI>, <&cgu JZ4780_CLK_AHB0>;
+ clock-names = "isfr", "iahb";
+
+ ports {
+ hdmi_in: port {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ hdmi_in_lcd: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&jz4780_out_hdmi>;
+ };
+ };
+ };
+ };
+
+...
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [RFC v3 4/8] dt-bindings: display: add ingenic-jz4780-hdmi DT Schema
2020-03-29 17:35 ` [RFC v3 4/8] dt-bindings: display: add ingenic-jz4780-hdmi DT Schema H. Nikolaus Schaller
@ 2020-04-09 7:12 ` Sam Ravnborg
0 siblings, 0 replies; 15+ messages in thread
From: Sam Ravnborg @ 2020-04-09 7:12 UTC (permalink / raw)
To: H. Nikolaus Schaller
Cc: Mark Rutland, Paul Boddie, Geert Uytterhoeven, David Airlie,
dri-devel, linux-mips, Paul Cercueil, Miquel Raynal, Andi Kleen,
Paul Burton, Krzysztof Kozlowski, mips-creator-ci20-dev,
devicetree, Kees Cook, linux-gpio, Rob Herring, letux-kernel,
Thomas Bogendoerfer, linux-kernel, Ralf Baechle,
Eric W. Biederman
Hi Nikolaus.
On Sun, Mar 29, 2020 at 07:35:50PM +0200, H. Nikolaus Schaller wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
>
> Add DT bindings for the hdmi driver for the Ingenic JZ4780 SoC.
> Based on .txt binding from Zubair Lutfullah Kakakhel
>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org
There is a few mistakes that originate from my original patch - sorry.
> ---
> .../bindings/display/ingenic-jz4780-hdmi.yaml | 82 +++++++++++++++++++
> 1 file changed, 82 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
>
> diff --git a/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml b/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
> new file mode 100644
> index 000000000000..a545ff8704eb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/ingenic-jz4780-hdmi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Bindings for Ingenic JZ4780 HDMI Transmitter
> +
> +maintainers:
> + - H. Nikolaus Schaller <hns@goldelico.com>
> +
> +description: |
> + The HDMI Transmitter in the Ingenic JZ4780 is a Synopsys DesignWare HDMI 1.4
> + TX controller IP with accompanying PHY IP.
> +
> +allOf:
> + - $ref: panel/panel-common.yaml#
panel-common is only supposed to be used by panels.
There is a few users in display/ but this is bindings that are
candidates to be moved to panel/ - and this binding describes a
display controller and not a panel.
> +
> +properties:
> + compatible:
> + items:
> + - const: ingenic,jz4780-hdmi
> +
> + reg:
> + maxItems: 1
> + description: the address & size of the LCD controller registers
> +
> + reg-io-width:
> + const: 4
> +
> + interrupts:
> + maxItems: 1
> + description: Specifies the interrupt provided by parent
> +
> + clocks:
> + maxItems: 2
> + description: Clock specifiers for isrf and iahb clocks
> +
> + clock-names:
> + items:
> + - const: isfr
> + - const: iahb
> +
> + ddc-i2c-bus: true
> + ports: true
As we no longer rely on panel-common this needs to be fully specified -
for example like this:
ddc-i2c-bus:
$ref: /schemas/types.yaml#/definitions/phandle
description: phandle to the I2C bus that is connected to DDC
ports:
type: object
description: |
A ports node with endpoint definitions as defined in
Documentation/devicetree/bindings/media/video-interfaces.txt.
Thanks for taking care of this binding.
Sam
> +
> +required:
> + - compatible
> + - clocks
> + - clock-names
> + - ports
> + - reg-io-width
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/jz4780-cgu.h>
> +
> + hdmi: hdmi@10180000 {
> + compatible = "ingenic,jz4780-hdmi";
> + reg = <0x10180000 0x8000>;
> + reg-io-width = <4>;
> + ddc-i2c-bus = <&i2c4>;
> + interrupt-parent = <&intc>;
> + interrupts = <3>;
> + clocks = <&cgu JZ4780_CLK_HDMI>, <&cgu JZ4780_CLK_AHB0>;
> + clock-names = "isfr", "iahb";
> +
> + ports {
> + hdmi_in: port {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + hdmi_in_lcd: endpoint@0 {
> + reg = <0>;
> + remote-endpoint = <&jz4780_out_hdmi>;
> + };
> + };
> + };
> + };
> +
> +...
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [RFC v3 5/8] drm: ingenic: add jz4780 Synopsys HDMI driver
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
` (3 preceding siblings ...)
2020-03-29 17:35 ` [RFC v3 4/8] dt-bindings: display: add ingenic-jz4780-hdmi DT Schema H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 6/8] MIPS: DTS: jz4780: account for Synopsys HDMI driver and LCD controller H. Nikolaus Schaller
` (2 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel
From: Paul Boddie <paul@boddie.org.uk>
A specialisation of the generic Synopsys HDMI driver is employed for JZ4780
HDMI support. This requires a new driver, plus device tree and configuration
modifications.
Signed-off-by: Paul Boddie <paul@boddie.org.uk>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
drivers/gpu/drm/ingenic/Kconfig | 8 ++
drivers/gpu/drm/ingenic/Makefile | 1 +
drivers/gpu/drm/ingenic/dw_hdmi-jz4780.c | 120 +++++++++++++++++++++++
3 files changed, 129 insertions(+)
create mode 100644 drivers/gpu/drm/ingenic/dw_hdmi-jz4780.c
diff --git a/drivers/gpu/drm/ingenic/Kconfig b/drivers/gpu/drm/ingenic/Kconfig
index d82c3d37ec9c..44bfd0d35af1 100644
--- a/drivers/gpu/drm/ingenic/Kconfig
+++ b/drivers/gpu/drm/ingenic/Kconfig
@@ -14,3 +14,11 @@ config DRM_INGENIC
Choose this option for DRM support for the Ingenic SoCs.
If M is selected the module will be called ingenic-drm.
+
+config DRM_DW_HDMI_JZ4780
+ tristate "HDMI Support for Ingenic JZ4780"
+ depends on DRM_INGENIC
+ depends on OF
+ select DRM_DW_HDMI
+ help
+ Choose this option for HDMI output from the Ingenic JZ4780.
diff --git a/drivers/gpu/drm/ingenic/Makefile b/drivers/gpu/drm/ingenic/Makefile
index 11cac42ce0bb..238383de63c7 100644
--- a/drivers/gpu/drm/ingenic/Makefile
+++ b/drivers/gpu/drm/ingenic/Makefile
@@ -1 +1,2 @@
obj-$(CONFIG_DRM_INGENIC) += ingenic-drm.o
+obj-$(CONFIG_DRM_DW_HDMI_JZ4780) += dw_hdmi-jz4780.o
diff --git a/drivers/gpu/drm/ingenic/dw_hdmi-jz4780.c b/drivers/gpu/drm/ingenic/dw_hdmi-jz4780.c
new file mode 100644
index 000000000000..fa379e337263
--- /dev/null
+++ b/drivers/gpu/drm/ingenic/dw_hdmi-jz4780.c
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
+ *
+ * Derived from dw_hdmi-imx.c with i.MX portions removed.
+ * Probe and remove operations derived from rcar_dw_hdmi.c.
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+
+#include <drm/bridge/dw_hdmi.h>
+#include <drm/drm_of.h>
+
+static const struct dw_hdmi_mpll_config jz4780_mpll_cfg[] = {
+ { 45250000, { { 0x01e0, 0x0000 },
+ { 0x21e1, 0x0000 },
+ { 0x41e2, 0x0000 } } },
+ { 92500000, { { 0x0140, 0x0005 },
+ { 0x2141, 0x0005 },
+ { 0x4142, 0x0005 } } },
+ { 148500000, { { 0x00a0, 0x000a },
+ { 0x20a1, 0x000a },
+ { 0x40a2, 0x000a } } },
+ { 216000000, { { 0x00a0, 0x000a },
+ { 0x2001, 0x000f },
+ { 0x4002, 0x000f } } },
+ { ~0UL, { { 0x0000, 0x0000 },
+ { 0x0000, 0x0000 },
+ { 0x0000, 0x0000 } } }
+};
+
+static const struct dw_hdmi_curr_ctrl jz4780_cur_ctr[] = {
+ /*pixelclk bpp8 bpp10 bpp12 */
+ { 54000000, { 0x091c, 0x091c, 0x06dc } },
+ { 58400000, { 0x091c, 0x06dc, 0x06dc } },
+ { 72000000, { 0x06dc, 0x06dc, 0x091c } },
+ { 74250000, { 0x06dc, 0x0b5c, 0x091c } },
+ { 118800000, { 0x091c, 0x091c, 0x06dc } },
+ { 216000000, { 0x06dc, 0x0b5c, 0x091c } },
+ { ~0UL, { 0x0000, 0x0000, 0x0000 } },
+};
+
+/*
+ * Resistance term 133Ohm Cfg
+ * PREEMP config 0.00
+ * TX/CK level 10
+ */
+static const struct dw_hdmi_phy_config jz4780_phy_config[] = {
+ /*pixelclk symbol term vlev */
+ { 216000000, 0x800d, 0x0005, 0x01ad},
+ { ~0UL, 0x0000, 0x0000, 0x0000}
+};
+
+static enum drm_mode_status
+jz4780_hdmi_mode_valid(struct drm_connector *con,
+ const struct drm_display_mode *mode)
+{
+ if (mode->clock < 13500)
+ return MODE_CLOCK_LOW;
+ /* FIXME: Hardware is capable of 270MHz, but setup data is missing. */
+ if (mode->clock > 216000)
+ return MODE_CLOCK_HIGH;
+
+ return MODE_OK;
+}
+
+static struct dw_hdmi_plat_data jz4780_dw_hdmi_plat_data = {
+ .mpll_cfg = jz4780_mpll_cfg,
+ .cur_ctr = jz4780_cur_ctr,
+ .phy_config = jz4780_phy_config,
+ .mode_valid = jz4780_hdmi_mode_valid,
+};
+
+static const struct of_device_id jz4780_dw_hdmi_dt_ids[] = {
+ { .compatible = "ingenic,jz4780-dw-hdmi" },
+ { /* Sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, jz4780_dw_hdmi_dt_ids);
+
+static int jz4780_dw_hdmi_probe(struct platform_device *pdev)
+{
+ struct dw_hdmi *hdmi;
+
+ hdmi = dw_hdmi_probe(pdev, &jz4780_dw_hdmi_plat_data);
+ if (IS_ERR(hdmi))
+ return PTR_ERR(hdmi);
+
+ platform_set_drvdata(pdev, hdmi);
+
+ return 0;
+}
+
+static int jz4780_dw_hdmi_remove(struct platform_device *pdev)
+{
+ struct dw_hdmi *hdmi = platform_get_drvdata(pdev);
+
+ dw_hdmi_remove(hdmi);
+
+ return 0;
+}
+
+static struct platform_driver jz4780_dw_hdmi_platform_driver = {
+ .probe = jz4780_dw_hdmi_probe,
+ .remove = jz4780_dw_hdmi_remove,
+ .driver = {
+ .name = "dw-hdmi-jz4780",
+ .of_match_table = jz4780_dw_hdmi_dt_ids,
+ },
+};
+
+module_platform_driver(jz4780_dw_hdmi_platform_driver);
+
+MODULE_AUTHOR("Andy Yan <andy.yan@rock-chips.com>");
+MODULE_AUTHOR("Yakir Yang <ykk@rock-chips.com>");
+MODULE_AUTHOR("Paul Boddie <paul@boddie.org.uk>");
+MODULE_DESCRIPTION("Ingenic JZ4780 DW-HDMI Driver Extension");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:dw-hdmi-jz4780");
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC v3 6/8] MIPS: DTS: jz4780: account for Synopsys HDMI driver and LCD controller
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
` (4 preceding siblings ...)
2020-03-29 17:35 ` [RFC v3 5/8] drm: ingenic: add jz4780 Synopsys HDMI driver H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 7/8] MIPS: DTS: CI20: add HDMI setup H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 8/8] MIPS: CI20: defconfig: configure for DRM_DW_HDMI_JZ4780 H. Nikolaus Schaller
7 siblings, 0 replies; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel
From: Paul Boddie <paul@boddie.org.uk>
A specialisation of the generic Synopsys HDMI driver is employed for JZ4780
HDMI support. This requires a new driver, plus device tree and configuration
modifications.
Signed-off-by: Paul Boddie <paul@boddie.org.uk>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
arch/mips/boot/dts/ingenic/jz4780.dtsi | 46 ++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi b/arch/mips/boot/dts/ingenic/jz4780.dtsi
index bb89653d16a3..73776514bbe5 100644
--- a/arch/mips/boot/dts/ingenic/jz4780.dtsi
+++ b/arch/mips/boot/dts/ingenic/jz4780.dtsi
@@ -434,4 +434,50 @@ bch: bch@134d0000 {
status = "disabled";
};
+
+ hdmi: hdmi@10180000 {
+ compatible = "ingenic,jz4780-dw-hdmi";
+ reg = <0x10180000 0x8000>;
+ reg-io-width = <4>;
+
+ clocks = <&cgu JZ4780_CLK_HDMI>, <&cgu JZ4780_CLK_AHB0>;
+ clock-names = "isfr" , "iahb";
+
+ assigned-clocks = <&cgu JZ4780_CLK_HDMI>;
+ assigned-clock-rates = <27000000>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <3>;
+
+ /* ddc-i2c-bus = <&i2c4>; */
+
+ status = "disabled";
+ };
+
+ lcdc0: lcdc0@13050000 {
+ compatible = "ingenic,jz4780-lcd";
+ reg = <0x13050000 0x1800>;
+
+ clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD0PIXCLK>;
+ clock-names = "lcd", "lcd_pclk";
+
+ interrupt-parent = <&intc>;
+ interrupts = <31>;
+
+ status = "disabled";
+ };
+
+ lcdc1: lcdc1@130a0000 {
+ compatible = "ingenic,jz4780-lcd";
+ reg = <0x130a0000 0x1800>;
+
+ clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD1PIXCLK>;
+ clock-names = "lcd", "lcd_pclk";
+
+ interrupt-parent = <&intc>;
+ interrupts = <31>;
+
+ status = "disabled";
+ };
+
};
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC v3 7/8] MIPS: DTS: CI20: add HDMI setup
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
` (5 preceding siblings ...)
2020-03-29 17:35 ` [RFC v3 6/8] MIPS: DTS: jz4780: account for Synopsys HDMI driver and LCD controller H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
2020-03-29 17:35 ` [RFC v3 8/8] MIPS: CI20: defconfig: configure for DRM_DW_HDMI_JZ4780 H. Nikolaus Schaller
7 siblings, 0 replies; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel
From: Paul Boddie <paul@boddie.org.uk>
We need to hook up
* HDMI power regulator
* HDMI connector
* DDC pinmux
* HDMI and LCD endpoint connections
Signed-off-by: Paul Boddie <paul@boddie.org.uk>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
arch/mips/boot/dts/ingenic/ci20.dts | 64 +++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/arch/mips/boot/dts/ingenic/ci20.dts b/arch/mips/boot/dts/ingenic/ci20.dts
index c340f947baa0..97e09382ebd7 100644
--- a/arch/mips/boot/dts/ingenic/ci20.dts
+++ b/arch/mips/boot/dts/ingenic/ci20.dts
@@ -62,6 +62,28 @@ eth0_power: fixedregulator@0 {
enable-active-high;
};
+ hdmi_power: fixedregulator@2 {
+ compatible = "regulator-fixed";
+ regulator-name = "hdmi_power";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpa 25 GPIO_ACTIVE_LOW>;
+ enable-active-high;
+ regulator-always-on;
+ };
+
+ hdmi_out: connector {
+ compatible = "hdmi-connector";
+ label = "HDMI OUT";
+ type = "a";
+
+ port {
+ hdmi_con: endpoint {
+ remote-endpoint = <&dw_hdmi_out>;
+ };
+ };
+ };
+
wlan0_power: fixedregulator@1 {
compatible = "regulator-fixed";
regulator-name = "wlan0_power";
@@ -435,6 +457,12 @@ pins_i2c4: i2c4 {
bias-disable;
};
+ pins_hdmi_ddc: hdmi_ddc {
+ function = "hdmi-ddc";
+ groups = "hdmi-ddc";
+ bias-disable;
+ };
+
pins_nemc: nemc {
function = "nemc";
groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe";
@@ -471,3 +499,39 @@ &tcu {
assigned-clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER1>;
assigned-clock-rates = <3000000>, <3000000>;
};
+
+&hdmi {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pins_hdmi_ddc>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ dw_hdmi_in: endpoint {
+ remote-endpoint = <&lcd_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ dw_hdmi_out: endpoint {
+ remote-endpoint = <&hdmi_con>;
+ };
+ };
+ };
+};
+
+&lcdc0 {
+ status = "okay";
+
+ port {
+ lcd_out: endpoint {
+ remote-endpoint = <&dw_hdmi_in>;
+ };
+ };
+};
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC v3 8/8] MIPS: CI20: defconfig: configure for DRM_DW_HDMI_JZ4780
2020-03-29 17:35 [RFC v3 0/8] MIPS: CI20: add HDMI out support H. Nikolaus Schaller
` (6 preceding siblings ...)
2020-03-29 17:35 ` [RFC v3 7/8] MIPS: DTS: CI20: add HDMI setup H. Nikolaus Schaller
@ 2020-03-29 17:35 ` H. Nikolaus Schaller
7 siblings, 0 replies; 15+ messages in thread
From: H. Nikolaus Schaller @ 2020-03-29 17:35 UTC (permalink / raw)
To: Paul Cercueil, Paul Boddie, David Airlie, Daniel Vetter,
Rob Herring, Mark Rutland, Ralf Baechle, Paul Burton,
Linus Walleij, Andi Kleen, Krzysztof Kozlowski,
Geert Uytterhoeven, Eric W. Biederman, H. Nikolaus Schaller,
Miquel Raynal, Thomas Bogendoerfer, Kees Cook
Cc: devicetree, linux-kernel, dri-devel, linux-mips, linux-gpio,
mips-creator-ci20-dev, letux-kernel
We configure them as loadable modules by default.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
arch/mips/configs/ci20_defconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
index be41df2a81fb..3f733a555cb2 100644
--- a/arch/mips/configs/ci20_defconfig
+++ b/arch/mips/configs/ci20_defconfig
@@ -103,6 +103,9 @@ CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_JZ4740=y
CONFIG_DMADEVICES=y
CONFIG_DMA_JZ4780=y
+CONFIG_DRM=m
+CONFIG_DRM_DW_HDMI_JZ4780=m
+CONFIG_DRM_DW_HDMI=m
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_MEMORY=y
CONFIG_EXT4_FS=y
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread