summaryrefslogtreecommitdiff
path: root/arch/arm64/boot/dts/rockchip/rk3326-odroid-go3.dts
blob: 842efbaf1a6a7dec4c6ebe7f46511ddb57235467 (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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2019 Hardkernel Co., Ltd
 * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH
 * Copyright (c) 2022 Maya Matuszczyk <maccraft123mc@gmail.com>
 */

/dts-v1/;
#include "rk3326-odroid-go.dtsi"

/ {
	model = "ODROID-GO Super";
	compatible = "hardkernel,rk3326-odroid-go3", "rockchip,rk3326";

	joystick_mux_controller: mux-controller {
		compatible = "gpio-mux";
		pinctrl = <&mux_en_pins>;
		#mux-control-cells = <0>;

		mux-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>,
			    <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
	};

	joystick_mux: adc-mux {
		compatible = "io-channel-mux";
		io-channels = <&saradc 1>;
		io-channel-names = "parent";
		#io-channel-cells = <1>;

		mux-controls = <&joystick_mux_controller>;
		channels = "0", "1", "2", "3";
	};

	analog_sticks: adc-joystick {
		compatible = "adc-joystick";
		io-channels = <&joystick_mux 0>,
			      <&joystick_mux 1>,
			      <&joystick_mux 2>,
			      <&joystick_mux 3>;
		poll-interval = <60>;
		#address-cells = <1>;
		#size-cells = <0>;

		axis@0 {
			reg = <0>;
			abs-flat = <10>;
			abs-fuzz = <10>;
			abs-range = <180 800>;
			linux,code = <ABS_X>;
		};

		axis@1 {
			reg = <1>;
			abs-flat = <10>;
			abs-fuzz = <10>;
			abs-range = <180 800>;
			linux,code = <ABS_RX>;
		};

		axis@2 {
			reg = <2>;
			abs-flat = <10>;
			abs-fuzz = <10>;
			abs-range = <180 800>;
			linux,code = <ABS_Y>;
		};

		axis@3 {
			reg = <3>;
			abs-flat = <10>;
			abs-fuzz = <10>;
			abs-range = <180 800>;
			linux,code = <ABS_RY>;
		};
	};

	battery: battery {
		compatible = "simple-battery";
		charge-full-design-microamp-hours = <4000000>;
		charge-term-current-microamp = <300000>;
		constant-charge-current-max-microamp = <2000000>;
		constant-charge-voltage-max-microvolt = <4200000>;
		factory-internal-resistance-micro-ohms = <180000>;
		voltage-max-design-microvolt = <4100000>;
		voltage-min-design-microvolt = <3500000>;

		ocv-capacity-celsius = <20>;
		ocv-capacity-table-0 =  <4046950 100>, <4001920 95>, <3967900 90>, <3919950 85>,
					<3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>,
					<3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>,
					<3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>,
					<3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>,
					<3574170 0>;
	};

	gpio-keys-vol {
		compatible = "gpio-keys";
		autorepeat;
		pinctrl-0 = <&btn_pins_vol>;
		pinctrl-names = "default";

		button-vol-down {
			gpios = <&gpio2 RK_PA1 GPIO_ACTIVE_LOW>;
			label = "VOLUMEDOWN";
			linux,code = <KEY_VOLUMEDOWN>;
		};

		button-volume-up {
			gpios = <&gpio2 RK_PA0 GPIO_ACTIVE_LOW>;
			label = "VOLUMEUP";
			linux,code = <KEY_VOLUMEUP>;
		};
	};
};

/* f1 and f2 conflict with volume buttons */
/delete-node/ &btn_f1;
/delete-node/ &btn_f2;

&builtin_gamepad {
	button-sw19 {
		gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>;
		label = "SELECT";
		linux,code = <BTN_SELECT>;
	};
	/* note that TR2 and TL2 are swapped */
	button-sw20 {
		gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
		label = "TOP-RIGHT 2";
		linux,code = <BTN_TR2>;
	};
	button-sw21 {
		gpios = <&gpio3 RK_PB2 GPIO_ACTIVE_LOW>;
		label = "TOP-LEFT 2";
		linux,code = <BTN_TL2>;
	};
	button-sw22 {
		gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
		label = "START";
		linux,code = <BTN_START>;
	};
};

&internal_display {
	status = "disabled";
};

&rk817_charger {
	monitored-battery = <&battery>;
};

&pinctrl {
	btns {
		btn_pins: btn-pins {
			rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
					<1 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>,
					<1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
					<1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>,
					<1 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>,
					<1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>,
					<1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>,
					<1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>,
					<2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
					<2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>,
					<2 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>,
					<2 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>,
					<2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
					<2 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>,
					<3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>,
					<3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>,
					<3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>,
					<3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>;
		};
		btn_pins_vol: btn-pins-vol {
			rockchip,pins = <2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>,
					<2 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	joystick {
		mux_en_pins: mux-pins {
			rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_output_low>;
		};
	};
};