Skip to content

Commit

Permalink
Merge pull request #1156 from sydarn/r33s-rumble
Browse files Browse the repository at this point in the history
r33s: port to rocknix-singleadc to get rumble
  • Loading branch information
sydarn authored Jan 17, 2025
2 parents 3a3aa48 + 33d897c commit 6ea27a1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/apps/gamecontrollerdb/config/gamecontrollerdb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
19009b4d4b4800000111000000010000,retrogame_joypad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
0300fcb7341200007856000000000000,JELOS Gamepad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
19009321b0c300000002000010000000,XU10 Gamepad,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,guide:b16,start:b9,dpleft:b14,dpdown:b13,dpright:b15,dpup:b12,leftshoulder:b4,lefttrigger:b7,rightshoulder:b5,righttrigger:b6,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
190014b3010000009178000000050000,r33s_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b12,dpdown:b11,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,
190014b301000000a20a000000010000,r33s_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b12,dpdown:b11,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,
1900e5914b4800007711000077010000,RGB20S Gamepad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b12,start:b13,dpleft:b10,dpdown:b9,dpright:b11,dpup:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b14,rightstick:b15,leftx:a0,lefty:a1,rightx:a2,righty:a3,
1900e7444b4800000111000034020000,rg552_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
03001a3447616d65466f726365204100,GameForce ACE Gamepad,a:b1,b:b0,dpdown:b13,dpleft:b14,+lefty:-a0,-leftx:-a1,+leftx:+a1,-lefty:+a0,leftshoulder:b5,leftstick:b10,lefttrigger:-a2,dpright:b15,+righty:+a4,-rightx:-a3,+rightx:+a3,-righty:-a4,rightshoulder:b6,rightstick:b11,righttrigger:-a5,back:b7,guide:b9,start:b8,dpup:b12,x:b3,y:b4,platform:Linux,
Expand Down
14 changes: 13 additions & 1 deletion packages/rocknix/sources/post-update
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ if [ $? -ne 0 ]; then
sed -i "/\[Core\]/a SkipIPL = True" $DINI
fi

# Fix GUID
# Fix GUID Arc
if echo ${QUIRK_DEVICE} | grep ARC; then
for file in "\
/storage/.config/emulationstation/es_input.cfg \
Expand All @@ -151,3 +151,15 @@ if echo ${QUIRK_DEVICE} | grep ARC; then
sed -i "s/1900d632010000000100000000010000/1900d632010000002c0a000000010000/g" $file
done
fi

# Fix GUID R33s
if echo ${QUIRK_DEVICE} | grep R33S; then
for file in "\
/storage/.config/emulationstation/es_input.cfg \
/storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt \
/storage/.config/yabasanshiro/input.cfg \
/storage/.config/yabasanshiro/keymapv2.json \
yabasanshiro/devices/keymapv2_rg_arc_joypad.json"; do
sed -i "s/190014b3010000009178000000050000/190014b301000000a20a000000010000/g" $file
done
fi
2 changes: 1 addition & 1 deletion packages/ui/emulationstation/config/common/es_input.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@
<input name="x" type="button" id="3" value="1" />
<input name="y" type="button" id="0" value="1" />
</inputConfig>
<inputConfig type="joystick" deviceName="r33s_joypad" deviceGUID="190014b3010000009178000000050000">
<inputConfig type="joystick" deviceName="r33s_joypad" deviceGUID="190014b301000000a20a000000010000">
<input name="a" type="button" id="1" value="1" />
<input name="b" type="button" id="0" value="1" />
<input name="down" type="button" id="11" value="1" />
Expand Down
23 changes: 15 additions & 8 deletions projects/Rockchip/patches/linux/RK3326/000-rk3326-dts.patch
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ new file mode 100644
index 000000000000..3bef2baf90a4
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3326-gameconsole-r33s.dts
@@ -0,0 +1,117 @@
@@ -0,0 +1,124 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * # Copyright (C) 2022-24 JELOS (https://github.com/JustEnoughLinuxOS)
Expand All @@ -356,9 +356,22 @@ index 000000000000..3bef2baf90a4
+ compatible = "gameconsole,r33s", "rockchip,rk3326";
+
+ builtin_gamepad: r33s_joypad {
+ compatible = "gpio-keys";
+ compatible = "rocknix-singleadc-joypad";
+ pinctrl-names = "default";
+ pinctrl-0 = <&btn_pins>;
+ joypad-name = "r33s_joypad";
+ joypad-product = <0x0AA2>;
+ joypad-revision = <0x0100>;
+ joypad-vendor = <0x0001>;
+
+ status = "okay";
+ amux-count = <0>;
+ /* poll device interval (ms), adc read interval */
+ poll-interval = <10>;
+ pwms = <&pwm0 0 1000000000 0>;
+ pwm-names = "enable";
+ rumble-boost-weak = <0x0000>;
+ rumble-boost-strong = <0x0000>;
+
+ button-sw1 {
+ gpios = <&gpio1 RK_PB4 GPIO_ACTIVE_LOW>;
Expand Down Expand Up @@ -431,12 +444,6 @@ index 000000000000..3bef2baf90a4
+ linux,code = <BTN_START>;
+ };
+ };
+
+ vibrator {
+ compatible = "pwm-vibrator";
+ pwms = <&pwm0 0 1000000 0>;
+ pwm-names = "enable";
+ };
+};
+
+&pinctrl {
Expand Down

0 comments on commit 6ea27a1

Please sign in to comment.