@@ -13,7 +13,7 @@ new file mode 100644
1313index 000000000..f2eca80b3
1414--- /dev/null
1515+++ b/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg34xx-sp.dts
16- @@ -0,0 +1,17 @@
16+ @@ -0,0 +1,112 @@
1717+ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
1818+ /*
1919+ * Copyright (C) 2024 Ryan Walklin <[email protected] >.@@ -26,11 +26,106 @@ index 000000000..f2eca80b3
2626+ model = "Anbernic RG34XX-SP";
2727+ compatible = "anbernic,rg34xx-sp", "allwinner,sun50i-h700";
2828+ rocknix-dt-id = "sun50i-h700-anbernic-rg34xx-sp";
29+ +
30+ + adc-joystick {
31+ + compatible = "adc-joystick";
32+ + io-channels = <&adc_mux 0>,
33+ + <&adc_mux 1>,
34+ + <&adc_mux 2>,
35+ + <&adc_mux 3>;
36+ + pinctrl-0 = <&joy_mux_pin>;
37+ + pinctrl-names = "default";
38+ + poll-interval = <60>;
39+ + #address-cells = <1>;
40+ + #size-cells = <0>;
41+ +
42+ + axis@0 {
43+ + reg = <0>;
44+ + abs-flat = <32>;
45+ + abs-fuzz = <32>;
46+ + abs-range = <4096 0>;
47+ + linux,code = <ABS_X>;
48+ + };
49+ +
50+ + axis@1 {
51+ + reg = <1>;
52+ + abs-flat = <32>;
53+ + abs-fuzz = <32>;
54+ + abs-range = <0 4096>;
55+ + linux,code = <ABS_Y>;
56+ + };
57+ +
58+ + axis@2 {
59+ + reg = <2>;
60+ + abs-flat = <32>;
61+ + abs-fuzz = <32>;
62+ + abs-range = <0 4096>;
63+ + linux,code = <ABS_RX>;
64+ + };
65+ +
66+ + axis@3 {
67+ + reg = <3>;
68+ + abs-flat = <32>;
69+ + abs-fuzz = <32>;
70+ + abs-range = <4096 0>;
71+ + linux,code = <ABS_RY>;
72+ + };
73+ + };
74+ +
75+ + adc_mux: adc-mux {
76+ + compatible = "io-channel-mux";
77+ + channels = "left_x", "left_y", "right_x", "right_y";
78+ + #io-channel-cells = <1>;
79+ + io-channels = <&gpadc 0>;
80+ + io-channel-names = "parent";
81+ + mux-controls = <&gpio_mux>;
82+ + settle-time-us = <100>;
83+ + };
84+ +
85+ + gpio_mux: mux-controller {
86+ + compatible = "gpio-mux";
87+ + mux-gpios = <&pio 8 1 GPIO_ACTIVE_LOW>, /* PI1 */
88+ + <&pio 8 2 GPIO_ACTIVE_LOW>; /* PI2 */
89+ + #mux-control-cells = <0>;
90+ + };
2991+ };
3092+
3193+ &panel {
3294+ compatible = "anbernic,rg34xx-sp-panel", "panel-mipi-dpi-spi";
3395+ };
96+ +
97+ + &gpadc {
98+ + #address-cells = <1>;
99+ + #size-cells = <0>;
100+ + status = "okay";
101+ +
102+ + channel@0 {
103+ + reg = <0>;
104+ + };
105+ + };
106+ +
107+ + &pio {
108+ + joy_mux_pin: joy-mux-pin {
109+ + pins = "PI0";
110+ + function = "gpio_out";
111+ + };
112+ + };
113+ +
114+ + &gpio_keys_gamepad {
115+ + button-thumbl {
116+ + label = "GPIO Thumb Left";
117+ + gpios = <&pio 4 8 GPIO_ACTIVE_LOW>; /* PE8 */
118+ + linux,input-type = <EV_KEY>;
119+ + linux,code = <BTN_THUMBL>;
120+ + };
121+ +
122+ + button-thumbr {
123+ + label = "GPIO Thumb Right";
124+ + gpios = <&pio 4 9 GPIO_ACTIVE_LOW>; /* PE9 */
125+ + linux,input-type = <EV_KEY>;
126+ + linux,code = <BTN_THUMBR>;
127+ + };
128+ + };
34129- -
351302.47.1
36131
0 commit comments