blob: ff453336eab1d16fc67bada040fb9445f6629b9e [file] [log] [blame]
Tom Rini762f85b2024-07-20 11:15:10 -06001// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Copyright (C) 2024 Ryan Walklin <ryan@testtoast.com>.
4 * Copyright (C) 2024 Chris Morgan <macroalpha82@gmail.com>.
5 */
6
7#include "sun50i-h700-anbernic-rg35xx-plus.dts"
8
9/ {
10 model = "Anbernic RG35XX H";
11 compatible = "anbernic,rg35xx-h", "allwinner,sun50i-h700";
Tom Rini6b642ac2024-10-01 12:20:28 -060012
13 adc-joystick {
14 compatible = "adc-joystick";
15 io-channels = <&adc_mux 0>,
16 <&adc_mux 1>,
17 <&adc_mux 2>,
18 <&adc_mux 3>;
19 pinctrl-0 = <&joy_mux_pin>;
20 pinctrl-names = "default";
21 poll-interval = <60>;
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 axis@0 {
26 reg = <0>;
27 abs-flat = <32>;
28 abs-fuzz = <32>;
29 abs-range = <4096 0>;
30 linux,code = <ABS_X>;
31 };
32
33 axis@1 {
34 reg = <1>;
35 abs-flat = <32>;
36 abs-fuzz = <32>;
37 abs-range = <0 4096>;
38 linux,code = <ABS_Y>;
39 };
40
41 axis@2 {
42 reg = <2>;
43 abs-flat = <32>;
44 abs-fuzz = <32>;
45 abs-range = <0 4096>;
46 linux,code = <ABS_RX>;
47 };
48
49 axis@3 {
50 reg = <3>;
51 abs-flat = <32>;
52 abs-fuzz = <32>;
53 abs-range = <4096 0>;
54 linux,code = <ABS_RY>;
55 };
56 };
57
58 adc_mux: adc-mux {
59 compatible = "io-channel-mux";
60 channels = "left_x", "left_y", "right_x", "right_y";
61 #io-channel-cells = <1>;
62 io-channels = <&gpadc 0>;
63 io-channel-names = "parent";
64 mux-controls = <&gpio_mux>;
65 settle-time-us = <100>;
66 };
67
68 gpio_mux: mux-controller {
69 compatible = "gpio-mux";
70 mux-gpios = <&pio 8 1 GPIO_ACTIVE_LOW>,
71 <&pio 8 2 GPIO_ACTIVE_LOW>;
72 #mux-control-cells = <0>;
73 };
Tom Rini762f85b2024-07-20 11:15:10 -060074};
75
Tom Rini6b642ac2024-10-01 12:20:28 -060076&gpadc {
77 #address-cells = <1>;
78 #size-cells = <0>;
79 status = "okay";
80
81 channel@0 {
82 reg = <0>;
83 };
84};
85
Tom Rini762f85b2024-07-20 11:15:10 -060086&gpio_keys_gamepad {
87 button-thumbl {
88 label = "GPIO Thumb Left";
89 gpios = <&pio 4 8 GPIO_ACTIVE_LOW>; /* PE8 */
90 linux,input-type = <EV_KEY>;
91 linux,code = <BTN_THUMBL>;
92 };
93
94 button-thumbr {
95 label = "GPIO Thumb Right";
96 gpios = <&pio 4 9 GPIO_ACTIVE_LOW>; /* PE9 */
97 linux,input-type = <EV_KEY>;
98 linux,code = <BTN_THUMBR>;
99 };
100};
101
102&ehci1 {
103 status = "okay";
104};
105
106&ohci1 {
107 status = "okay";
108};
Tom Rini6b642ac2024-10-01 12:20:28 -0600109
110&pio {
111 joy_mux_pin: joy-mux-pin {
112 pins = "PI0";
113 function = "gpio_out";
114 };
115};