1// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2/*
3 * Copyright (c) Toradex
4 *
5 * Toradex Capacitive Touch Display 7" on Aquila DSI_1.
6 * Used on Development Board (J44), DSI_1 is exposed via a Samtec LSS-130
7 * connector, and requires the Toradex DSI Display Adapter to convert to
8 * FFC/FPC connector.
9 *
10 * https://developer.toradex.com/hardware/accessories/displays/capacitive-touch-display-7inch-dsi
11 * https://www.toradex.com/accessories/capacitive-touch-display-7-inch-dsi
12 * https://developer.toradex.com/hardware/accessories/add-ons/dsi-display-adapter
13 * https://www.toradex.com/accessories/verdin-dsi-display-adapter
14 */
15
16/dts-v1/;
17/plugin/;
18
19#include <dt-bindings/gpio/gpio.h>
20#include <dt-bindings/interrupt-controller/irq.h>
21
22&{/} {
23	backlight_pwm3: backlight-pwm3 {
24		compatible = "pwm-backlight";
25		brightness-levels = <0 45 63 88 119 158 203 255>;
26		default-brightness-level = <4>;
27		/* Aquila PWM_3_DSI (AQUILA B46) */
28		pwms = <&main_ehrpwm5 0 6666667 0>;
29	};
30
31	panel-lvds-bridge {
32		compatible = "riverdi,rvt70hslnwca0", "panel-lvds";
33		backlight = <&backlight_pwm3>;
34		data-mapping = "vesa-24";
35		height-mm = <86>;
36		width-mm = <154>;
37
38		panel-timing {
39			clock-frequency = <51200000>;
40			de-active = <1>;
41			hactive = <1024>;
42			hback-porch = <100 100 100>;
43			hfront-porch = <16 160 216>;
44			hsync-active = <0>;
45			hsync-len = <1 60 140>;
46			pixelclk-active = <1>;
47			vactive = <600>;
48			vback-porch = <13 13 13>;
49			vfront-porch = <1 12 127>;
50			vsync-active = <0>;
51			vsync-len = <1 10 20>;
52		};
53
54		port {
55			panel_lvds_bridge_in: endpoint {
56				remote-endpoint = <&dsi_lvds_bridge_out>;
57			};
58		};
59	};
60};
61
62&dphy_tx0 {
63	status = "okay";
64};
65
66&dsi0 {
67	status = "okay";
68};
69
70&dsi0_ports {
71	#address-cells = <1>;
72	#size-cells = <0>;
73
74	port@0 {
75		reg = <0>;
76
77		dsi0_out: endpoint {
78			remote-endpoint = <&dsi_lvds_bridge_in>;
79		};
80	};
81
82	port@1 {
83		reg = <1>;
84
85		dsi0_in: endpoint {
86			remote-endpoint = <&dpi2_out>;
87		};
88	};
89};
90
91&dss_ports {
92	#address-cells = <1>;
93	#size-cells = <0>;
94
95	port@2 {
96		reg = <2>;
97
98		dpi2_out: endpoint {
99			remote-endpoint = <&dsi0_in>;
100		};
101	};
102};
103
104/* I2C on DSI Connector Pin #52 and #54 */
105&i2c_dsi_1 {
106	#address-cells = <1>;
107	#size-cells = <0>;
108
109	bridge@2c {
110		compatible = "ti,sn65dsi83";
111		reg = <0x2c>;
112		pinctrl-names = "default";
113		pinctrl-0 = <&pinctrl_gpio_20_dsi_1>;
114		/* Aquila GPIO_20_DSI_1 (AQUILA B45) */
115		enable-gpios = <&main_gpio0 18 GPIO_ACTIVE_HIGH>;
116
117		ports {
118			#address-cells = <1>;
119			#size-cells = <0>;
120
121			port@0 {
122				reg = <0>;
123
124				dsi_lvds_bridge_in: endpoint {
125					remote-endpoint = <&dsi0_out>;
126					data-lanes = <1 2 3 4>;
127				};
128			};
129
130			port@2 {
131				reg = <2>;
132
133				dsi_lvds_bridge_out: endpoint {
134					remote-endpoint = <&panel_lvds_bridge_in>;
135				};
136			};
137		};
138	};
139
140	touchscreen@41 {
141		compatible = "ilitek,ili2132";
142		reg = <0x41>;
143		pinctrl-names = "default";
144		pinctrl-0 = <&pinctrl_gpio_17_dsi_1>, <&pinctrl_gpio_18_dsi_1>;
145		/* Aquila GPIO_17_DSI_1 (AQUILA B42) */
146		interrupt-parent = <&main_gpio0>;
147		/*
148		 * Data-ready pulse is ~200 us; either edge can be used,
149		 * use the rising edge because the falling edge is noisy.
150		 */
151		interrupts = <12 IRQ_TYPE_EDGE_RISING>;
152		/* Aquila GPIO_18_DSI_1 (AQUILA B43) */
153		reset-gpios = <&main_gpio0 31 GPIO_ACTIVE_LOW>;
154	};
155};
156