hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
....@@ -1,15 +1,14 @@
11 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
-/*
3
- * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
4
- * Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
5
- *
6
- */
2
+// Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
3
+// Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
74
85 /dts-v1/;
96
107 #include "sun50i-a64.dtsi"
8
+#include "sun50i-a64-cpu-opp.dtsi"
119
1210 #include <dt-bindings/gpio/gpio.h>
11
+#include <dt-bindings/input/gpio-keys.h>
1312 #include <dt-bindings/input/input.h>
1413 #include <dt-bindings/pwm/pwm.h>
1514
....@@ -28,16 +27,11 @@
2827 brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
2928 default-brightness-level = <2>;
3029 enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
30
+ power-supply = <&reg_vbklt>;
3131 };
3232
3333 chosen {
3434 stdout-path = "serial0:115200n8";
35
-
36
- framebuffer-lcd {
37
- panel-supply = <&reg_dc1sw>;
38
- dvdd25-supply = <&reg_dldo2>;
39
- dvdd12-supply = <&reg_fldo1>;
40
- };
4135 };
4236
4337 gpio_keys {
....@@ -50,20 +44,85 @@
5044 linux,code = <SW_LID>;
5145 linux,can-disable;
5246 wakeup-source;
47
+ wakeup-event-action = <EV_ACT_DEASSERTED>;
5348 };
5449 };
5550
56
- reg_vcc3v3: vcc3v3 {
51
+ panel_edp: panel-edp {
52
+ compatible = "neweast,wjfh116008a";
53
+ backlight = <&backlight>;
54
+ power-supply = <&reg_dc1sw>;
55
+
56
+ port {
57
+ panel_edp_in: endpoint {
58
+ remote-endpoint = <&anx6345_out_edp>;
59
+ };
60
+ };
61
+ };
62
+
63
+ reg_vbklt: vbklt {
5764 compatible = "regulator-fixed";
58
- regulator-name = "vcc3v3";
59
- regulator-min-microvolt = <3300000>;
60
- regulator-max-microvolt = <3300000>;
65
+ regulator-name = "vbklt";
66
+ regulator-min-microvolt = <18000000>;
67
+ regulator-max-microvolt = <18000000>;
68
+ gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
69
+ enable-active-high;
70
+ };
71
+
72
+ reg_vcc5v0: vcc5v0 {
73
+ compatible = "regulator-fixed";
74
+ regulator-name = "vcc5v0";
75
+ regulator-min-microvolt = <5000000>;
76
+ regulator-max-microvolt = <5000000>;
77
+ gpio = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
78
+ enable-active-high;
6179 };
6280
6381 wifi_pwrseq: wifi_pwrseq {
6482 compatible = "mmc-pwrseq-simple";
6583 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
6684 };
85
+
86
+ speaker_amp: audio-amplifier {
87
+ compatible = "simple-audio-amplifier";
88
+ VCC-supply = <&reg_vcc5v0>;
89
+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
90
+ sound-name-prefix = "Speaker Amp";
91
+ };
92
+
93
+};
94
+
95
+&codec {
96
+ status = "okay";
97
+};
98
+
99
+&codec_analog {
100
+ cpvdd-supply = <&reg_eldo1>;
101
+ status = "okay";
102
+};
103
+
104
+&cpu0 {
105
+ cpu-supply = <&reg_dcdc2>;
106
+};
107
+
108
+&cpu1 {
109
+ cpu-supply = <&reg_dcdc2>;
110
+};
111
+
112
+&cpu2 {
113
+ cpu-supply = <&reg_dcdc2>;
114
+};
115
+
116
+&cpu3 {
117
+ cpu-supply = <&reg_dcdc2>;
118
+};
119
+
120
+&dai {
121
+ status = "okay";
122
+};
123
+
124
+&de {
125
+ status = "okay";
67126 };
68127
69128 &ehci0 {
....@@ -74,12 +133,15 @@
74133 status = "okay";
75134 };
76135
136
+&mixer0 {
137
+ status = "okay";
138
+};
139
+
77140 &mmc0 {
78141 pinctrl-names = "default";
79142 pinctrl-0 = <&mmc0_pins>;
80143 vmmc-supply = <&reg_dcdc1>;
81
- cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
82
- cd-inverted;
144
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
83145 disable-wp;
84146 bus-width = <4>;
85147 status = "okay";
....@@ -102,7 +164,7 @@
102164
103165 &mmc2 {
104166 pinctrl-names = "default";
105
- pinctrl-0 = <&mmc2_pins>;
167
+ pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
106168 vmmc-supply = <&reg_dcdc1>;
107169 vqmmc-supply = <&reg_eldo1>;
108170 max-frequency = <200000000>;
....@@ -121,8 +183,59 @@
121183 status = "okay";
122184 };
123185
186
+&pio {
187
+ vcc-pc-supply = <&reg_eldo1>;
188
+ vcc-pd-supply = <&reg_dcdc1>;
189
+ vcc-pe-supply = <&reg_aldo1>;
190
+ vcc-pg-supply = <&reg_eldo1>;
191
+};
192
+
124193 &pwm {
125194 status = "okay";
195
+};
196
+
197
+&r_i2c {
198
+ clock-frequency = <100000>;
199
+ pinctrl-names = "default";
200
+ pinctrl-0 = <&r_i2c_pl89_pins>;
201
+ status = "okay";
202
+
203
+ anx6345: anx6345@38 {
204
+ compatible = "analogix,anx6345";
205
+ reg = <0x38>;
206
+ reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
207
+ dvdd25-supply = <&reg_dldo2>;
208
+ dvdd12-supply = <&reg_fldo1>;
209
+
210
+ ports {
211
+ #address-cells = <1>;
212
+ #size-cells = <0>;
213
+
214
+ anx6345_in: port@0 {
215
+ reg = <0>;
216
+ anx6345_in_tcon0: endpoint {
217
+ remote-endpoint = <&tcon0_out_anx6345>;
218
+ };
219
+ };
220
+
221
+ anx6345_out: port@1 {
222
+ reg = <1>;
223
+ anx6345_out_edp: endpoint {
224
+ remote-endpoint = <&panel_edp_in>;
225
+ };
226
+ };
227
+ };
228
+ };
229
+};
230
+
231
+&r_pio {
232
+ /*
233
+ * FIXME: We can't add that supply for now since it would
234
+ * create a circular dependency between pinctrl, the regulator
235
+ * and the RSB Bus.
236
+ *
237
+ * vcc-pl-supply = <&reg_aldo2>;
238
+ */
126239 };
127240
128241 &r_rsb {
....@@ -136,20 +249,18 @@
136249 };
137250 };
138251
139
-/* The ANX6345 eDP-bridge is on r_i2c */
140
-&r_i2c {
141
- clock-frequency = <100000>;
142
- pinctrl-names = "default";
143
- pinctrl-0 = <&r_i2c_pins_a>;
252
+#include "axp803.dtsi"
253
+
254
+&ac_power_supply {
144255 status = "okay";
145256 };
146257
147
-#include "axp803.dtsi"
258
+&battery_power_supply {
259
+ status = "okay";
260
+};
148261
149262 &reg_aldo1 {
150
- regulator-min-microvolt = <2800000>;
151
- regulator-max-microvolt = <2800000>;
152
- regulator-name = "vcc-csi";
263
+ regulator-name = "vcc-pe";
153264 };
154265
155266 &reg_aldo2 {
....@@ -212,12 +323,6 @@
212323 regulator-name = "vcc-edp";
213324 };
214325
215
-&reg_dldo3 {
216
- regulator-min-microvolt = <3300000>;
217
- regulator-max-microvolt = <3300000>;
218
- regulator-name = "avdd-csi";
219
-};
220
-
221326 &reg_dldo4 {
222327 regulator-min-microvolt = <3300000>;
223328 regulator-max-microvolt = <3300000>;
....@@ -229,12 +334,6 @@
229334 regulator-min-microvolt = <1800000>;
230335 regulator-max-microvolt = <1800000>;
231336 regulator-name = "cpvdd";
232
-};
233
-
234
-&reg_eldo3 {
235
- regulator-min-microvolt = <1800000>;
236
- regulator-max-microvolt = <1800000>;
237
- regulator-name = "vdd-1v8-csi";
238337 };
239338
240339 &reg_fldo1 {
....@@ -250,24 +349,59 @@
250349 regulator-name = "vdd-cpus";
251350 };
252351
253
-&reg_ldo_io0 {
254
- regulator-min-microvolt = <3300000>;
255
- regulator-max-microvolt = <3300000>;
256
- regulator-name = "vcc-usb";
257
- status = "okay";
258
-};
259
-
260352 &reg_rtc_ldo {
261353 regulator-name = "vcc-rtc";
354
+};
355
+
356
+&simplefb_lcd {
357
+ panel-supply = <&reg_dc1sw>;
358
+ dvdd25-supply = <&reg_dldo2>;
359
+ dvdd12-supply = <&reg_fldo1>;
262360 };
263361
264362 &simplefb_hdmi {
265363 vcc-hdmi-supply = <&reg_dldo1>;
266364 };
267365
366
+&sound {
367
+ status = "okay";
368
+ simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
369
+ simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
370
+ "Microphone", "Internal Microphone Right",
371
+ "Headphone", "Headphone Jack",
372
+ "Speaker", "Internal Speaker";
373
+ simple-audio-card,routing =
374
+ "Left DAC", "DACL",
375
+ "Right DAC", "DACR",
376
+ "Speaker Amp INL", "LINEOUT",
377
+ "Speaker Amp INR", "LINEOUT",
378
+ "Internal Speaker", "Speaker Amp OUTL",
379
+ "Internal Speaker", "Speaker Amp OUTR",
380
+ "Headphone Jack", "HP",
381
+ "ADCL", "Left ADC",
382
+ "ADCR", "Right ADC",
383
+ "Internal Microphone Left", "MBIAS",
384
+ "MIC1", "Internal Microphone Left",
385
+ "Internal Microphone Right", "HBIAS",
386
+ "MIC2", "Internal Microphone Right";
387
+};
388
+
389
+&tcon0 {
390
+ pinctrl-names = "default";
391
+ pinctrl-0 = <&lcd_rgb666_pins>;
392
+
393
+ status = "okay";
394
+};
395
+
396
+&tcon0_out {
397
+ tcon0_out_anx6345: endpoint {
398
+ remote-endpoint = <&anx6345_in_tcon0>;
399
+ };
400
+};
401
+
268402 &uart0 {
269403 pinctrl-names = "default";
270
- pinctrl-0 = <&uart0_pins_a>;
404
+ pinctrl-0 = <&uart0_pb_pins>;
271405 status = "okay";
272406 };
273407
....@@ -276,7 +410,7 @@
276410 };
277411
278412 &usbphy {
279
- usb0_vbus-supply = <&reg_ldo_io0>;
280
- usb1_vbus-supply = <&reg_ldo_io0>;
413
+ usb0_vbus-supply = <&reg_vcc5v0>;
414
+ usb1_vbus-supply = <&reg_vcc5v0>;
281415 status = "okay";
282416 };