1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 Hardkernel Co., Ltd
4 * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH
5 * Copyright (c) 2022 Maya Matuszczyk <maccraft123mc@gmail.com>
6 */
7
8/dts-v1/;
9#include "rk3326-odroid-go.dtsi"
10
11/ {
12	model = "ODROID-GO Advance Black Edition";
13	compatible = "hardkernel,rk3326-odroid-go2-v11", "rockchip,rk3326";
14
15	aliases {
16		mmc1 = &sdio;
17	};
18
19	analog_sticks: adc-joystick {
20		compatible = "adc-joystick";
21		io-channels = <&saradc 1>,
22			      <&saradc 2>;
23		poll-interval = <60>;
24		#address-cells = <1>;
25		#size-cells = <0>;
26
27		axis@0 {
28			reg = <0>;
29			abs-flat = <10>;
30			abs-fuzz = <10>;
31			abs-range = <172 772>;
32			linux,code = <ABS_X>;
33			};
34
35		axis@1 {
36			reg = <1>;
37			abs-flat = <10>;
38			abs-fuzz = <10>;
39			abs-range = <278 815>;
40			linux,code = <ABS_Y>;
41		};
42	};
43
44	battery: battery {
45		compatible = "simple-battery";
46		charge-full-design-microamp-hours = <3000000>;
47		charge-term-current-microamp = <300000>;
48		constant-charge-current-max-microamp = <2000000>;
49		constant-charge-voltage-max-microvolt = <4200000>;
50		factory-internal-resistance-micro-ohms = <180000>;
51		voltage-max-design-microvolt = <4100000>;
52		voltage-min-design-microvolt = <3500000>;
53
54		ocv-capacity-celsius = <20>;
55		ocv-capacity-table-0 =  <4046950 100>, <4001920 95>, <3967900 90>, <3919950 85>,
56					<3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>,
57					<3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>,
58					<3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>,
59					<3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>,
60					<3574170 0>;
61	};
62
63	wifi_pwrseq: wifi-pwrseq {
64		compatible = "mmc-pwrseq-simple";
65		pinctrl-names = "default";
66		pinctrl-0 = <&wifi_pwrseq_pins>;
67		reset-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>;
68	};
69};
70
71&builtin_gamepad {
72	button-sw20 {
73		gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
74		label = "TOP-LEFT 2";
75		linux,code = <BTN_TL2>;
76	};
77	button-sw21 {
78		gpios = <&gpio3 RK_PB2 GPIO_ACTIVE_LOW>;
79		label = "TOP-RIGHT 2";
80		linux,code = <BTN_TR2>;
81	};
82};
83
84&internal_display {
85	compatible = "elida,kd35t133";
86	iovcc-supply = <&vcc_lcd>;
87	vdd-supply = <&vcc_lcd>;
88};
89
90&rk817 {
91	regulators {
92		vcc_wifi: LDO_REG9 {
93			regulator-name = "vcc_wifi";
94			regulator-min-microvolt = <3300000>;
95			regulator-max-microvolt = <3300000>;
96
97			regulator-state-mem {
98				regulator-on-in-suspend;
99				regulator-suspend-microvolt = <3300000>;
100			};
101		};
102	};
103};
104
105&rk817_charger {
106	monitored-battery = <&battery>;
107};
108
109&sdio {
110	bus-width = <4>;
111	cap-sd-highspeed;
112	cap-sdio-irq;
113	disable-wp;
114	keep-power-in-suspend;
115	mmc-pwrseq = <&wifi_pwrseq>;
116	non-removable;
117	vmmc-supply = <&vcc_wifi>;
118	#address-cells = <1>;
119	#size-cells = <0>;
120	status = "okay";
121
122	esp8089: wifi@1 {
123		compatible = "esp,esp8089";
124		reg = <1>;
125	};
126};
127
128&pinctrl {
129	btns {
130		btn_pins: btn-pins {
131			rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
132					<1 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>,
133					<1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
134					<1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>,
135					<1 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>,
136					<1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>,
137					<1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>,
138					<1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>,
139					<2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>,
140					<2 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>,
141					<2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
142					<2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>,
143					<2 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>,
144					<2 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>,
145					<2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
146					<2 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>,
147					<3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>,
148					<3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>;
149		};
150	};
151
152	wifi {
153		wifi_pwrseq_pins: wifi-pwrseq-pins {
154			rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>,
155					<3 RK_PB6 RK_FUNC_GPIO &pcfg_output_high>;
156		};
157	};
158};
159