soysauce: wire speaker amp in DT and fix joypad controls

soysauce.dts: enable rockchip,use-ext-amplifier + spk-ctl-gpios on the
codec (drives patch 0060), set hp_det to pull-none so insertion is seen,
and bump the analog tuning 200 to 280. The Y3506 sticks only reach ~76%
of the declared range at full deflection, so partial pushes never crossed
the EmulationStation navigation threshold; the higher gain saturates the
axis and keeps menu scrolling responsive (R36S/eeclone pots reach full
range at 200, this is Y3506-specific).

Joypad userspace mapping (the analog/button wiring was never broken in
the kernel, the configs were):
- es_input.cfg: add a GO-Super Gamepad entry modelled on r36s_Gamepad,
  using leftanalog/rightanalog so both sticks navigate the menu. The old
  auto-generated entry mapped them as joystick1/joystick2, and
  joystick2up is hardcoded to volume in ViewController, so the right
  stick changed volume and the left stick did nothing.
- GO-Super Gamepad.cfg (RetroArch): the button indices were the RGB20S
  layout (select=12, start=13, dpad=8-11), which broke in-game Start,
  Select and the exit combo. Correct to the r36s layout (select=8,
  start=9, dpad=13-16, l3=11, r3=12, hotkey=8) and fix the vendor id.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Douglas Teles
2026-06-26 17:37:19 -03:00
parent 36f99fec2b
commit 9d89a01d4c
3 changed files with 77 additions and 22 deletions
@@ -54,7 +54,7 @@
joypad: odroidgo3-joypad {
/* All Y3506 (soysauce) boards we've seen use single-ADC + amux
* (amux-count=4, amux-channel-mapping=<3 2 0 1>) — that is the
* (amux-count=4, amux-channel-mapping=<3 2 0 1>), which is the
* archr-singleadc-joypad driver's wire protocol. The previous
* "archr-joypad" / "odroidgo3-joypad" compat strings bind to
* the multi-ADC driver, which ignores the amux-* props and
@@ -91,14 +91,24 @@
button-adc-fuzz = <32>;
button-adc-flat = <32>;
abs_x-p-tuning = <200>;
abs_x-n-tuning = <200>;
abs_y-p-tuning = <200>;
abs_y-n-tuning = <200>;
abs_rx-p-tuning = <200>;
abs_rx-n-tuning = <200>;
abs_ry-p-tuning = <200>;
abs_ry-n-tuning = <200>;
/*
* The Y3506 analog sticks only swing to ~76% of the declared
* range at full deflection with the default 200 gain (measured
* ~1365 of 1800 via evtest), so partial pushes never cross the
* EmulationStation navigation threshold and menu scrolling needs
* several flicks per item. Bump the gain so full deflection
* saturates the axis; games keep all but the top few percent of
* travel. The R36S/eeclone pots reach full range at 200, this is
* a Y3506-specific calibration.
*/
abs_x-p-tuning = <280>;
abs_x-n-tuning = <280>;
abs_y-p-tuning = <280>;
abs_y-n-tuning = <280>;
abs_rx-p-tuning = <280>;
abs_rx-n-tuning = <280>;
abs_ry-p-tuning = <280>;
abs_ry-n-tuning = <280>;
poll-interval = <10>;
@@ -207,9 +217,27 @@
};
&rk817_codec {
/*
* The loudspeaker is not on the rk817 class-D SPKO output; it hangs off
* the analog headphone output through an external amp enabled by
* spk-ctl-gpios. Tell the codec driver to route the speaker path through
* the headphone DACs and toggle that GPIO (see the rk817 ext-amplifier
* patch) instead of driving the unused class-D.
*/
rockchip,use-ext-amplifier;
spk-ctl-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
};
/*
* The shared r3xs hp-det pin uses pcfg_pull_down, which on this board pins the
* headphone-detect line low forever (insertion is never seen). The stock R35S
* DTB leaves it at pcfg_pull_none and lets the jack circuit drive the level, so
* override the pull here for the Soysauce only.
*/
&hp_det {
rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
};
&pinctrl {
btns {
btn_pins_vol: btn-pins-vol {
@@ -1,6 +1,6 @@
input_device = "GO-Super Gamepad"
input_driver = "udev"
input_vendor_id = "484B"
input_vendor_id = "0000"
input_product_id = "1100"
input_b_btn = "0"
@@ -12,16 +12,16 @@ input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_up_btn = "8"
input_down_btn = "9"
input_left_btn = "10"
input_right_btn = "11"
input_up_btn = "13"
input_down_btn = "14"
input_left_btn = "15"
input_right_btn = "16"
input_select_btn = "12"
input_start_btn = "13"
input_select_btn = "8"
input_start_btn = "9"
input_l3_btn = "14"
input_r3_btn = "15"
input_l3_btn = "11"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
@@ -35,16 +35,16 @@ input_r_y_minus_axis = "-3"
# Hotkeys
input_enable_hotkey_btn = "12"
input_exit_emulator_btn = "13"
input_enable_hotkey_btn = "8"
input_exit_emulator_btn = "9"
input_screenshot_btn = "0"
input_pause_toggle_btn = "1"
input_menu_toggle_btn = "2"
input_fps_toggle_btn = "3"
input_state_slot_increase_btn = "8"
input_state_slot_decrease_btn = "9"
input_state_slot_increase_btn = "13"
input_state_slot_decrease_btn = "14"
input_load_state_btn = "4"
input_save_state_btn = "5"
@@ -1705,6 +1705,33 @@
<input name="x" type="button" id="2" value="1" />
<input name="y" type="button" id="3" value="1" />
</inputConfig>
<inputConfig type="joystick" deviceName="GO-Super Gamepad" deviceGUID="1900bb3e474f2d537570657220476100">
<input name="a" type="button" id="1" value="1" />
<input name="b" type="button" id="0" value="1" />
<input name="down" type="button" id="14" value="1" />
<input name="hotkeyenable" type="button" id="10" value="1" />
<input name="left" type="button" id="15" value="1" />
<input name="leftanalogdown" type="axis" id="1" value="1" />
<input name="leftanalogleft" type="axis" id="0" value="-1" />
<input name="leftanalogright" type="axis" id="0" value="1" />
<input name="leftanalogup" type="axis" id="1" value="-1" />
<input name="leftshoulder" type="button" id="4" value="1" />
<input name="leftthumb" type="button" id="11" value="1" />
<input name="lefttrigger" type="button" id="6" value="1" />
<input name="right" type="button" id="16" value="1" />
<input name="rightanalogdown" type="axis" id="3" value="1" />
<input name="rightanalogleft" type="axis" id="2" value="-1" />
<input name="rightanalogright" type="axis" id="2" value="1" />
<input name="rightanalogup" type="axis" id="3" value="-1" />
<input name="rightshoulder" type="button" id="5" value="1" />
<input name="rightthumb" type="button" id="12" value="1" />
<input name="righttrigger" type="button" id="7" value="1" />
<input name="select" type="button" id="8" value="1" />
<input name="start" type="button" id="9" value="1" />
<input name="up" type="button" id="13" value="1" />
<input name="x" type="button" id="2" value="1" />
<input name="y" type="button" id="3" value="1" />
</inputConfig>
<inputConfig type="joystick" deviceName="r36s_Gamepad" deviceGUID="19003982010000008811000088010000">
<input name="a" type="button" id="1" value="1" />
<input name="b" type="button" id="0" value="1" />