| 1 |
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 |
/* |
| 3 |
* Copyright (C) 2024 Ryan Walklin <[email protected]>. |
| 4 |
* Copyright (C) 2024 Chris Morgan <[email protected]>. |
| 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"; |
| 12 |
|
| 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 |
}; |
| 74 |
|
| 75 |
reg_vcc3v8_usb: regulator-vcc3v8-usb { |
| 76 |
compatible = "regulator-fixed"; |
| 77 |
enable-active-high; |
| 78 |
gpio = <&pio 4 5 GPIO_ACTIVE_HIGH>; /* PE5 */ |
| 79 |
regulator-min-microvolt = <3800000>; |
| 80 |
regulator-max-microvolt = <3800000>; |
| 81 |
regulator-name = "vcc3v8-usb"; |
| 82 |
}; |
| 83 |
|
| 84 |
reg_vcc5v0_usb: regulator-vcc5v0-usb { |
| 85 |
compatible = "regulator-fixed"; |
| 86 |
enable-active-high; |
| 87 |
gpio = <&pio 8 7 GPIO_ACTIVE_HIGH>; /* PI7 */ |
| 88 |
regulator-min-microvolt = <5000000>; |
| 89 |
regulator-max-microvolt = <5000000>; |
| 90 |
regulator-name = "vcc5v0-usb"; |
| 91 |
vin-supply = <®_vcc3v8_usb>; |
| 92 |
}; |
| 93 |
}; |
| 94 |
|
| 95 |
&gpadc { |
| 96 |
#address-cells = <1>; |
| 97 |
#size-cells = <0>; |
| 98 |
status = "okay"; |
| 99 |
|
| 100 |
channel@0 { |
| 101 |
reg = <0>; |
| 102 |
}; |
| 103 |
}; |
| 104 |
|
| 105 |
&gpio_keys_gamepad { |
| 106 |
button-thumbl { |
| 107 |
label = "GPIO Thumb Left"; |
| 108 |
gpios = <&pio 4 8 GPIO_ACTIVE_LOW>; /* PE8 */ |
| 109 |
linux,input-type = <EV_KEY>; |
| 110 |
linux,code = <BTN_THUMBL>; |
| 111 |
}; |
| 112 |
|
| 113 |
button-thumbr { |
| 114 |
label = "GPIO Thumb Right"; |
| 115 |
gpios = <&pio 4 9 GPIO_ACTIVE_LOW>; /* PE9 */ |
| 116 |
linux,input-type = <EV_KEY>; |
| 117 |
linux,code = <BTN_THUMBR>; |
| 118 |
}; |
| 119 |
}; |
| 120 |
|
| 121 |
&ehci1 { |
| 122 |
status = "okay"; |
| 123 |
}; |
| 124 |
|
| 125 |
&ohci1 { |
| 126 |
status = "okay"; |
| 127 |
}; |
| 128 |
|
| 129 |
&pio { |
| 130 |
joy_mux_pin: joy-mux-pin { |
| 131 |
pins = "PI0"; |
| 132 |
function = "gpio_out"; |
| 133 |
}; |
| 134 |
}; |
| 135 |
|
| 136 |
&usbphy { |
| 137 |
usb1_vbus-supply = <®_vcc5v0_usb>; |
| 138 |
}; |