.. | .. |
---|
1 | 1 | // 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> |
---|
7 | 4 | |
---|
8 | 5 | /dts-v1/; |
---|
9 | 6 | |
---|
10 | 7 | #include "sun50i-a64.dtsi" |
---|
| 8 | +#include "sun50i-a64-cpu-opp.dtsi" |
---|
11 | 9 | |
---|
12 | 10 | #include <dt-bindings/gpio/gpio.h> |
---|
| 11 | +#include <dt-bindings/input/gpio-keys.h> |
---|
13 | 12 | #include <dt-bindings/input/input.h> |
---|
14 | 13 | #include <dt-bindings/pwm/pwm.h> |
---|
15 | 14 | |
---|
.. | .. |
---|
28 | 27 | brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>; |
---|
29 | 28 | default-brightness-level = <2>; |
---|
30 | 29 | enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ |
---|
| 30 | + power-supply = <®_vbklt>; |
---|
31 | 31 | }; |
---|
32 | 32 | |
---|
33 | 33 | chosen { |
---|
34 | 34 | stdout-path = "serial0:115200n8"; |
---|
35 | | - |
---|
36 | | - framebuffer-lcd { |
---|
37 | | - panel-supply = <®_dc1sw>; |
---|
38 | | - dvdd25-supply = <®_dldo2>; |
---|
39 | | - dvdd12-supply = <®_fldo1>; |
---|
40 | | - }; |
---|
41 | 35 | }; |
---|
42 | 36 | |
---|
43 | 37 | gpio_keys { |
---|
.. | .. |
---|
50 | 44 | linux,code = <SW_LID>; |
---|
51 | 45 | linux,can-disable; |
---|
52 | 46 | wakeup-source; |
---|
| 47 | + wakeup-event-action = <EV_ACT_DEASSERTED>; |
---|
53 | 48 | }; |
---|
54 | 49 | }; |
---|
55 | 50 | |
---|
56 | | - reg_vcc3v3: vcc3v3 { |
---|
| 51 | + panel_edp: panel-edp { |
---|
| 52 | + compatible = "neweast,wjfh116008a"; |
---|
| 53 | + backlight = <&backlight>; |
---|
| 54 | + power-supply = <®_dc1sw>; |
---|
| 55 | + |
---|
| 56 | + port { |
---|
| 57 | + panel_edp_in: endpoint { |
---|
| 58 | + remote-endpoint = <&anx6345_out_edp>; |
---|
| 59 | + }; |
---|
| 60 | + }; |
---|
| 61 | + }; |
---|
| 62 | + |
---|
| 63 | + reg_vbklt: vbklt { |
---|
57 | 64 | 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; |
---|
61 | 79 | }; |
---|
62 | 80 | |
---|
63 | 81 | wifi_pwrseq: wifi_pwrseq { |
---|
64 | 82 | compatible = "mmc-pwrseq-simple"; |
---|
65 | 83 | reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ |
---|
66 | 84 | }; |
---|
| 85 | + |
---|
| 86 | + speaker_amp: audio-amplifier { |
---|
| 87 | + compatible = "simple-audio-amplifier"; |
---|
| 88 | + VCC-supply = <®_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 = <®_eldo1>; |
---|
| 101 | + status = "okay"; |
---|
| 102 | +}; |
---|
| 103 | + |
---|
| 104 | +&cpu0 { |
---|
| 105 | + cpu-supply = <®_dcdc2>; |
---|
| 106 | +}; |
---|
| 107 | + |
---|
| 108 | +&cpu1 { |
---|
| 109 | + cpu-supply = <®_dcdc2>; |
---|
| 110 | +}; |
---|
| 111 | + |
---|
| 112 | +&cpu2 { |
---|
| 113 | + cpu-supply = <®_dcdc2>; |
---|
| 114 | +}; |
---|
| 115 | + |
---|
| 116 | +&cpu3 { |
---|
| 117 | + cpu-supply = <®_dcdc2>; |
---|
| 118 | +}; |
---|
| 119 | + |
---|
| 120 | +&dai { |
---|
| 121 | + status = "okay"; |
---|
| 122 | +}; |
---|
| 123 | + |
---|
| 124 | +&de { |
---|
| 125 | + status = "okay"; |
---|
67 | 126 | }; |
---|
68 | 127 | |
---|
69 | 128 | &ehci0 { |
---|
.. | .. |
---|
74 | 133 | status = "okay"; |
---|
75 | 134 | }; |
---|
76 | 135 | |
---|
| 136 | +&mixer0 { |
---|
| 137 | + status = "okay"; |
---|
| 138 | +}; |
---|
| 139 | + |
---|
77 | 140 | &mmc0 { |
---|
78 | 141 | pinctrl-names = "default"; |
---|
79 | 142 | pinctrl-0 = <&mmc0_pins>; |
---|
80 | 143 | vmmc-supply = <®_dcdc1>; |
---|
81 | | - cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; |
---|
82 | | - cd-inverted; |
---|
| 144 | + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ |
---|
83 | 145 | disable-wp; |
---|
84 | 146 | bus-width = <4>; |
---|
85 | 147 | status = "okay"; |
---|
.. | .. |
---|
102 | 164 | |
---|
103 | 165 | &mmc2 { |
---|
104 | 166 | pinctrl-names = "default"; |
---|
105 | | - pinctrl-0 = <&mmc2_pins>; |
---|
| 167 | + pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>; |
---|
106 | 168 | vmmc-supply = <®_dcdc1>; |
---|
107 | 169 | vqmmc-supply = <®_eldo1>; |
---|
108 | 170 | max-frequency = <200000000>; |
---|
.. | .. |
---|
121 | 183 | status = "okay"; |
---|
122 | 184 | }; |
---|
123 | 185 | |
---|
| 186 | +&pio { |
---|
| 187 | + vcc-pc-supply = <®_eldo1>; |
---|
| 188 | + vcc-pd-supply = <®_dcdc1>; |
---|
| 189 | + vcc-pe-supply = <®_aldo1>; |
---|
| 190 | + vcc-pg-supply = <®_eldo1>; |
---|
| 191 | +}; |
---|
| 192 | + |
---|
124 | 193 | &pwm { |
---|
125 | 194 | 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 = <®_dldo2>; |
---|
| 208 | + dvdd12-supply = <®_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 = <®_aldo2>; |
---|
| 238 | + */ |
---|
126 | 239 | }; |
---|
127 | 240 | |
---|
128 | 241 | &r_rsb { |
---|
.. | .. |
---|
136 | 249 | }; |
---|
137 | 250 | }; |
---|
138 | 251 | |
---|
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 { |
---|
144 | 255 | status = "okay"; |
---|
145 | 256 | }; |
---|
146 | 257 | |
---|
147 | | -#include "axp803.dtsi" |
---|
| 258 | +&battery_power_supply { |
---|
| 259 | + status = "okay"; |
---|
| 260 | +}; |
---|
148 | 261 | |
---|
149 | 262 | ®_aldo1 { |
---|
150 | | - regulator-min-microvolt = <2800000>; |
---|
151 | | - regulator-max-microvolt = <2800000>; |
---|
152 | | - regulator-name = "vcc-csi"; |
---|
| 263 | + regulator-name = "vcc-pe"; |
---|
153 | 264 | }; |
---|
154 | 265 | |
---|
155 | 266 | ®_aldo2 { |
---|
.. | .. |
---|
212 | 323 | regulator-name = "vcc-edp"; |
---|
213 | 324 | }; |
---|
214 | 325 | |
---|
215 | | -®_dldo3 { |
---|
216 | | - regulator-min-microvolt = <3300000>; |
---|
217 | | - regulator-max-microvolt = <3300000>; |
---|
218 | | - regulator-name = "avdd-csi"; |
---|
219 | | -}; |
---|
220 | | - |
---|
221 | 326 | ®_dldo4 { |
---|
222 | 327 | regulator-min-microvolt = <3300000>; |
---|
223 | 328 | regulator-max-microvolt = <3300000>; |
---|
.. | .. |
---|
229 | 334 | regulator-min-microvolt = <1800000>; |
---|
230 | 335 | regulator-max-microvolt = <1800000>; |
---|
231 | 336 | regulator-name = "cpvdd"; |
---|
232 | | -}; |
---|
233 | | - |
---|
234 | | -®_eldo3 { |
---|
235 | | - regulator-min-microvolt = <1800000>; |
---|
236 | | - regulator-max-microvolt = <1800000>; |
---|
237 | | - regulator-name = "vdd-1v8-csi"; |
---|
238 | 337 | }; |
---|
239 | 338 | |
---|
240 | 339 | ®_fldo1 { |
---|
.. | .. |
---|
250 | 349 | regulator-name = "vdd-cpus"; |
---|
251 | 350 | }; |
---|
252 | 351 | |
---|
253 | | -®_ldo_io0 { |
---|
254 | | - regulator-min-microvolt = <3300000>; |
---|
255 | | - regulator-max-microvolt = <3300000>; |
---|
256 | | - regulator-name = "vcc-usb"; |
---|
257 | | - status = "okay"; |
---|
258 | | -}; |
---|
259 | | - |
---|
260 | 352 | ®_rtc_ldo { |
---|
261 | 353 | regulator-name = "vcc-rtc"; |
---|
| 354 | +}; |
---|
| 355 | + |
---|
| 356 | +&simplefb_lcd { |
---|
| 357 | + panel-supply = <®_dc1sw>; |
---|
| 358 | + dvdd25-supply = <®_dldo2>; |
---|
| 359 | + dvdd12-supply = <®_fldo1>; |
---|
262 | 360 | }; |
---|
263 | 361 | |
---|
264 | 362 | &simplefb_hdmi { |
---|
265 | 363 | vcc-hdmi-supply = <®_dldo1>; |
---|
266 | 364 | }; |
---|
267 | 365 | |
---|
| 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 | + |
---|
268 | 402 | &uart0 { |
---|
269 | 403 | pinctrl-names = "default"; |
---|
270 | | - pinctrl-0 = <&uart0_pins_a>; |
---|
| 404 | + pinctrl-0 = <&uart0_pb_pins>; |
---|
271 | 405 | status = "okay"; |
---|
272 | 406 | }; |
---|
273 | 407 | |
---|
.. | .. |
---|
276 | 410 | }; |
---|
277 | 411 | |
---|
278 | 412 | &usbphy { |
---|
279 | | - usb0_vbus-supply = <®_ldo_io0>; |
---|
280 | | - usb1_vbus-supply = <®_ldo_io0>; |
---|
| 413 | + usb0_vbus-supply = <®_vcc5v0>; |
---|
| 414 | + usb1_vbus-supply = <®_vcc5v0>; |
---|
281 | 415 | status = "okay"; |
---|
282 | 416 | }; |
---|