summaryrefslogtreecommitdiff
path: root/arch/arm64/boot/dts/rockchip/rk3399-puma-mipidsi.dts
blob: 29203aa16e1798e9cd59752fc837ae10fd66e015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
 * Theobroma Systems RK3399-Q7 "Puma" with MIPI-DSI enabled instead of HDMI
 */
#include "rk3399-puma.dts"

/ {
	backlight: backlight {
		compatible = "gpio-backlight";
		// GPIO4_C2 = Q7_LVDS_BLT_CTRL. Set high to enable the backlight. Use PWM to regulate brightness.
		gpios = <&gpio4 18 GPIO_ACTIVE_HIGH>;
		default-on;
	};
};

&hdmi {
        status = "disabled";
};

&route_hdmi {
        status = "disabled";
};

&route_mipi {
	status = "okay";
	// default in rk3399-linux.dtsi: connect = <&vopb_out_mipi>;
};

&mipi_dsi {
	status = "okay";
	panel {
		compatible ="simple-panel-dsi";
		reg = <0>;
		backlight = <&backlight>;
		// GPIO2_A2 = SEL_EDP_1V8. Set low to switch the hardware mux from eDP to DSI.
		enable-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
		// GPIO4_D6 = LVDS_PPEN. Set low to send the panel into reset.
		reset-gpios = <&gpio4 30 GPIO_ACTIVE_LOW>;
		// Keep reset low for X milliseconds
		reset-delay-ms = <10>;

		dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
				MIPI_DSI_MODE_VIDEO_SYNC_PULSE)>;
		dsi,format = <MIPI_DSI_FMT_RGB888>;
		dsi,lanes = <4>;
		status = "okay";

		panel-init-sequence = [
			15 01 02 cd aa
			15 01 02 30 00
			15 01 02 5e 03
			15 01 02 32 00
			15 01 02 33 25
			15 01 02 65 08
			15 01 02 3a 10
			15 01 02 36 49
			15 01 02 67 82
			15 01 02 69 27
			15 01 02 6c 27
			15 01 02 6d 14
			39 01 09 55 09 09 09 09 09 09 09 09
			39 01 11 56 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09
			15 01 02 6b 00
			15 01 02 58 08
			15 01 02 73 30
			15 01 02 74 10
			15 01 02 77 00
			15 01 02 68 00
			15 01 02 28 28
			39 01 05 57 00 00 09 09
			15 01 02 41 46
			15 01 02 4e 50
			15 01 02 4f 55
			15 01 02 63 04
			39 01 14 53 1f 1a 17 13 12 12 14 15 15 10 0d 0b 0b 0c 0d 0a 08 03 00
			39 01 14 54 1f 1a 17 13 12 12 14 15 15 10 0d 0b 0b 0c 0d 0a 08 03 00
			15 01 02 29 10
			15 01 02 2e 03
			15 01 02 78 67
			15 01 02 76 36
			15 01 02 47 18
			15 01 02 2d 31
			15 01 02 50 d0
			15 01 02 48 66
			15 01 02 3f 00
			15 01 02 31 01
			15 01 02 4d 00
		];


		display-timings {
			native-mode = <&timing0>;
			timing0: timing0 {
				clock-frequency = <71900000>;
				hactive = <800>;
				vactive = <1280>;
				hback-porch = <24>;
				hfront-porch = <72>;
				vback-porch = <10>;
				vfront-porch = <12>;
				hsync-len = <24>;
				vsync-len = <2>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <1>;
				pixelclk-active = <1>;
			};
		};
	};
};

&i2c1 {
	gsl1680 {
		compatible = "silead,gsl1680";
		reg = <0x40>;
		// GPIO2_B3 = CSI_MCLK = gpio2 23
		interrupt-parent = <&gpio2>;
		interrupts = <23 IRQ_TYPE_LEVEL_LOW>; // TODO THIS IS PROBABLY WRONG
		// GPIO1_C7 = LVDS_BLEN = gpio1 23
		power-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
		touchscreen-size-x = <1720>;
		touchscreen-size-y = <1150>;
		touchscreen-swapped-x-y;
		touchscreen-inverted-x;
		touchscreen-inverted-y;

		silead,max-fingers = <5>;
		// Place into /lib/firmware/silead
		firmware-name = "elcom-plain.fw";
	};
};