treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / arm64 / boot / dts / allwinner / sun50i-a64-pinebook.dts
blob78c82a665c84a11c9de7a33e40e4aab67a98e792
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  */
8 /dts-v1/;
10 #include "sun50i-a64.dtsi"
12 #include <dt-bindings/gpio/gpio.h>
13 #include <dt-bindings/input/input.h>
14 #include <dt-bindings/pwm/pwm.h>
16 / {
17         model = "Pinebook";
18         compatible = "pine64,pinebook", "allwinner,sun50i-a64";
20         aliases {
21                 serial0 = &uart0;
22                 ethernet0 = &rtl8723cs;
23         };
25         vdd_bl: regulator@0 {
26                 compatible = "regulator-fixed";
27                 regulator-name = "bl-3v3";
28                 regulator-min-microvolt = <3300000>;
29                 regulator-max-microvolt = <3300000>;
30                 gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
31                 enable-active-high;
32         };
34         backlight: backlight {
35                 compatible = "pwm-backlight";
36                 pwms = <&pwm 0 50000 0>;
37                 brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
38                 default-brightness-level = <2>;
39                 enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
40                 power-supply = <&vdd_bl>;
41         };
43         chosen {
44                 stdout-path = "serial0:115200n8";
46                 framebuffer-lcd {
47                         panel-supply = <&reg_dc1sw>;
48                         dvdd25-supply = <&reg_dldo2>;
49                         dvdd12-supply = <&reg_fldo1>;
50                 };
51         };
53         gpio_keys {
54                 compatible = "gpio-keys";
56                 lid_switch {
57                         label = "Lid Switch";
58                         gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
59                         linux,input-type = <EV_SW>;
60                         linux,code = <SW_LID>;
61                         linux,can-disable;
62                         wakeup-source;
63                 };
64         };
66         reg_vcc3v3: vcc3v3 {
67                 compatible = "regulator-fixed";
68                 regulator-name = "vcc3v3";
69                 regulator-min-microvolt = <3300000>;
70                 regulator-max-microvolt = <3300000>;
71         };
73         wifi_pwrseq: wifi_pwrseq {
74                 compatible = "mmc-pwrseq-simple";
75                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
76         };
78         speaker_amp: audio-amplifier {
79                 compatible = "simple-audio-amplifier";
80                 /*
81                  * TODO This is actually a fixed regulator controlled by
82                  * the GPIO line on the PMIC. This should be corrected
83                  * once GPIO support is added for this PMIC.
84                  */
85                 VCC-supply = <&reg_ldo_io0>;
86                 enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
87                 sound-name-prefix = "Speaker Amp";
88         };
92 &codec {
93         status = "okay";
96 &codec_analog {
97         cpvdd-supply = <&reg_eldo1>;
98         status = "okay";
101 &dai {
102         status = "okay";
105 &ehci0 {
106         phys = <&usbphy 0>;
107         phy-names = "usb";
108         status = "okay";
111 &ehci1 {
112         status = "okay";
115 &mmc0 {
116         pinctrl-names = "default";
117         pinctrl-0 = <&mmc0_pins>;
118         vmmc-supply = <&reg_dcdc1>;
119         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
120         disable-wp;
121         bus-width = <4>;
122         status = "okay";
125 &mmc1 {
126         pinctrl-names = "default";
127         pinctrl-0 = <&mmc1_pins>;
128         vmmc-supply = <&reg_dldo4>;
129         vqmmc-supply = <&reg_eldo1>;
130         mmc-pwrseq = <&wifi_pwrseq>;
131         bus-width = <4>;
132         non-removable;
133         status = "okay";
135         rtl8723cs: wifi@1 {
136                 reg = <1>;
137         };
140 &mmc2 {
141         pinctrl-names = "default";
142         pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
143         vmmc-supply = <&reg_dcdc1>;
144         vqmmc-supply = <&reg_eldo1>;
145         bus-width = <8>;
146         non-removable;
147         cap-mmc-hw-reset;
148         mmc-hs200-1_8v;
149         status = "okay";
152 &ohci0 {
153         phys = <&usbphy 0>;
154         phy-names = "usb";
155         status = "okay";
158 &ohci1 {
159         status = "okay";
162 &pwm {
163         status = "okay";
166 &r_rsb {
167         status = "okay";
169         axp803: pmic@3a3 {
170                 compatible = "x-powers,axp803";
171                 reg = <0x3a3>;
172                 interrupt-parent = <&r_intc>;
173                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
174         };
177 /* The ANX6345 eDP-bridge is on r_i2c */
178 &r_i2c {
179         clock-frequency = <100000>;
180         pinctrl-names = "default";
181         pinctrl-0 = <&r_i2c_pl89_pins>;
182         status = "okay";
185 #include "axp803.dtsi"
187 &ac_power_supply {
188         status = "okay";
191 &battery_power_supply {
192         status = "okay";
195 &reg_aldo1 {
196         regulator-min-microvolt = <2800000>;
197         regulator-max-microvolt = <2800000>;
198         regulator-name = "vcc-csi";
201 &reg_aldo2 {
202         regulator-always-on;
203         regulator-min-microvolt = <1800000>;
204         regulator-max-microvolt = <3300000>;
205         regulator-name = "vcc-pl";
208 &reg_aldo3 {
209         regulator-always-on;
210         regulator-min-microvolt = <2700000>;
211         regulator-max-microvolt = <3300000>;
212         regulator-name = "vcc-pll-avcc";
215 &reg_dc1sw {
216         regulator-name = "vcc-lcd";
219 &reg_dcdc1 {
220         regulator-always-on;
221         regulator-min-microvolt = <3300000>;
222         regulator-max-microvolt = <3300000>;
223         regulator-name = "vcc-3v3";
226 &reg_dcdc2 {
227         regulator-always-on;
228         regulator-min-microvolt = <1000000>;
229         regulator-max-microvolt = <1300000>;
230         regulator-name = "vdd-cpux";
233 /* DCDC3 is polyphased with DCDC2 */
235 &reg_dcdc5 {
236         regulator-always-on;
237         regulator-min-microvolt = <1200000>;
238         regulator-max-microvolt = <1200000>;
239         regulator-name = "vcc-dram";
242 &reg_dcdc6 {
243         regulator-always-on;
244         regulator-min-microvolt = <1100000>;
245         regulator-max-microvolt = <1100000>;
246         regulator-name = "vdd-sys";
249 &reg_dldo1 {
250         regulator-min-microvolt = <3300000>;
251         regulator-max-microvolt = <3300000>;
252         regulator-name = "vcc-hdmi";
255 &reg_dldo2 {
256         regulator-min-microvolt = <2500000>;
257         regulator-max-microvolt = <2500000>;
258         regulator-name = "vcc-edp";
261 &reg_dldo3 {
262         regulator-min-microvolt = <3300000>;
263         regulator-max-microvolt = <3300000>;
264         regulator-name = "avdd-csi";
267 &reg_dldo4 {
268         regulator-min-microvolt = <3300000>;
269         regulator-max-microvolt = <3300000>;
270         regulator-name = "vcc-wifi";
273 &reg_eldo1 {
274         regulator-always-on;
275         regulator-min-microvolt = <1800000>;
276         regulator-max-microvolt = <1800000>;
277         regulator-name = "cpvdd";
280 &reg_eldo3 {
281         regulator-min-microvolt = <1800000>;
282         regulator-max-microvolt = <1800000>;
283         regulator-name = "vdd-1v8-csi";
286 &reg_fldo1 {
287         regulator-min-microvolt = <1200000>;
288         regulator-max-microvolt = <1200000>;
289         regulator-name = "vcc-1v2-hsic";
292 &reg_fldo2 {
293         regulator-always-on;
294         regulator-min-microvolt = <1100000>;
295         regulator-max-microvolt = <1100000>;
296         regulator-name = "vdd-cpus";
299 &reg_ldo_io0 {
300         regulator-min-microvolt = <3300000>;
301         regulator-max-microvolt = <3300000>;
302         regulator-name = "vcc-usb";
303         status = "okay";
306 &reg_rtc_ldo {
307         regulator-name = "vcc-rtc";
310 &simplefb_hdmi {
311         vcc-hdmi-supply = <&reg_dldo1>;
314 &sound {
315         status = "okay";
316         simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
317         simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
318                                     "Microphone", "Internal Microphone Right",
319                                     "Headphone", "Headphone Jack",
320                                     "Speaker", "Internal Speaker";
321         simple-audio-card,routing =
322                         "Left DAC", "AIF1 Slot 0 Left",
323                         "Right DAC", "AIF1 Slot 0 Right",
324                         "Speaker Amp INL", "LINEOUT",
325                         "Speaker Amp INR", "LINEOUT",
326                         "Internal Speaker", "Speaker Amp OUTL",
327                         "Internal Speaker", "Speaker Amp OUTR",
328                         "Headphone Jack", "HP",
329                         "AIF1 Slot 0 Left ADC", "Left ADC",
330                         "AIF1 Slot 0 Right ADC", "Right ADC",
331                         "Internal Microphone Left", "MBIAS",
332                         "MIC1", "Internal Microphone Left",
333                         "Internal Microphone Right", "HBIAS",
334                         "MIC2", "Internal Microphone Right";
337 &uart0 {
338         pinctrl-names = "default";
339         pinctrl-0 = <&uart0_pb_pins>;
340         status = "okay";
343 &usb_otg {
344         dr_mode = "host";
347 &usbphy {
348         usb0_vbus-supply = <&reg_ldo_io0>;
349         usb1_vbus-supply = <&reg_ldo_io0>;
350         status = "okay";