ARM: dts: am57xx-idk: Add IDK displays and touchscreens
authorAndrew Davis <afd@ti.com>
Tue, 7 Mar 2023 16:17:15 +0000 (10:17 -0600)
committerTony Lindgren <tony@atomide.com>
Mon, 27 Mar 2023 08:07:13 +0000 (11:07 +0300)
This is a more interesting use of DT Overlays than the previous patches.
Here we have two touchscreen modules. Each is compatible with, and can be
attached to, either of the two AM57xx IDK development board variants
(AM571x or AM572x).

Due to the way the extension header was wired on the development boards,
the touch sensor on the touchscreen modules will connect to different
SoC pins when connected. For this the touch sensor is modeled as an
additional overlay that is specific to the development board for which it
is connected.

Basically the LCD overlay can be swapped, but the touchscreen overlay
that attaches to the LCD must be used with the corresponding base DT
and not to the LCD.

AM571x -\ /- osd101t2045.dtbo -\ /- am571x-idk-touchscreen.dtbo
         X                      X
AM572x -/ \- osd101t2587.dtbo -/ \- am572x-idk-touchscreen.dtbo

Signed-off-by: Andrew Davis <afd@ti.com>
Message-Id: <20230307161715.15209-4-afd@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/am571x-idk-touchscreen.dtso [new file with mode: 0644]
arch/arm/boot/dts/am572x-idk-touchscreen.dtso [new file with mode: 0644]
arch/arm/boot/dts/am57xx-idk-lcd-osd101t2045.dtso [new file with mode: 0644]
arch/arm/boot/dts/am57xx-idk-lcd-osd101t2587.dtso [new file with mode: 0644]

index c1297fd..ad06ab3 100644 (file)
@@ -1006,8 +1006,12 @@ dtb-$(CONFIG_SOC_DRA7XX) += \
        am57xx-cl-som-am57x.dtb \
        am57xx-sbc-am57x.dtb \
        am572x-idk.dtb \
+       am572x-idk-touchscreen.dtbo \
        am571x-idk.dtb \
+       am571x-idk-touchscreen.dtbo \
        am574x-idk.dtb \
+       am57xx-idk-lcd-osd101t2045.dtbo \
+       am57xx-idk-lcd-osd101t2587.dtbo \
        dra7-evm.dtb \
        dra72-evm.dtb \
        dra72-evm-revc.dtb \
diff --git a/arch/arm/boot/dts/am571x-idk-touchscreen.dtso b/arch/arm/boot/dts/am571x-idk-touchscreen.dtso
new file mode 100644 (file)
index 0000000..c051ee6
--- /dev/null
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+&i2c1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       touchscreen: edt-ft5506@38 {
+               compatible = "edt,edt-ft5506", "edt,edt-ft5x06";
+
+               reg = <0x38>;
+
+               interrupt-parent = <&gpio5>;
+               interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
+
+               /* GPIO line is inverted before going to touch panel */
+               reset-gpios = <&gpio6 15 GPIO_ACTIVE_LOW>;
+
+               touchscreen-size-x = <1920>;
+               touchscreen-size-y = <1200>;
+
+               wakeup-source;
+       };
+};
diff --git a/arch/arm/boot/dts/am572x-idk-touchscreen.dtso b/arch/arm/boot/dts/am572x-idk-touchscreen.dtso
new file mode 100644 (file)
index 0000000..573e932
--- /dev/null
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+&i2c1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       touchscreen: edt-ft5506@38 {
+               compatible = "edt,edt-ft5506", "edt,edt-ft5x06";
+
+               reg = <0x38>;
+
+               interrupt-parent = <&gpio3>;
+               interrupts = <14 IRQ_TYPE_EDGE_FALLING>;
+
+               /* GPIO line is inverted before going to touch panel */
+               reset-gpios = <&gpio6 15 GPIO_ACTIVE_LOW>;
+
+               touchscreen-size-x = <1920>;
+               touchscreen-size-y = <1200>;
+
+               wakeup-source;
+       };
+};
diff --git a/arch/arm/boot/dts/am57xx-idk-lcd-osd101t2045.dtso b/arch/arm/boot/dts/am57xx-idk-lcd-osd101t2045.dtso
new file mode 100644 (file)
index 0000000..25d74e9
--- /dev/null
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       aliases {
+               display0 = "/display";
+               display1 = "/connector";
+       };
+
+       lcd_bl: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&ecap0 0 50000 1>;
+               brightness-levels = <0 51 53 56 62 75 101 152 255>;
+               default-brightness-level = <8>;
+       };
+};
+
+&dsi_bridge {
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       lcd: display {
+               compatible = "osddisplays,osd101t2045-53ts";
+               reg = <0>;
+
+               label = "lcd";
+
+               backlight = <&lcd_bl>;
+
+               port {
+                       lcd_in: endpoint {
+                               remote-endpoint = <&dsi_out>;
+                       };
+               };
+       };
+};
+
+&dsi_bridge_ports {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       port@1 {
+               reg = <1>;
+               dsi_out: endpoint {
+                       remote-endpoint = <&lcd_in>;
+               };
+       };
+};
+
+&epwmss0 {
+       status = "okay";
+};
+
+&ecap0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/am57xx-idk-lcd-osd101t2587.dtso b/arch/arm/boot/dts/am57xx-idk-lcd-osd101t2587.dtso
new file mode 100644 (file)
index 0000000..8cea7ba
--- /dev/null
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+&{/} {
+       aliases {
+               display0 = "/display";
+               display1 = "/connector";
+       };
+
+       lcd_bl: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&ecap0 0 50000 1>;
+               brightness-levels = <0 51 53 56 62 75 101 152 255>;
+               default-brightness-level = <8>;
+       };
+};
+
+&dsi_bridge {
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       lcd: display {
+               compatible = "osddisplays,osd101t2587-53ts";
+               reg = <0>;
+
+               label = "lcd";
+
+               backlight = <&lcd_bl>;
+
+               port {
+                       lcd_in: endpoint {
+                               remote-endpoint = <&dsi_out>;
+                       };
+               };
+       };
+};
+
+&dsi_bridge_ports {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       port@1 {
+               reg = <1>;
+               dsi_out: endpoint {
+                       remote-endpoint = <&lcd_in>;
+               };
+       };
+};
+
+&epwmss0 {
+       status = "okay";
+};
+
+&ecap0 {
+       status = "okay";
+};