Identity
| Part | Volume up / Volume down buttons |
| Role | Two-button input via SARADC voltage divider |
| Bus / address | PinePhone Pro: RK3399 SARADC channel 1; PineTab2: RK3566/RK3568 SARADC channel 0 |
| GPIO / IRQ | None — sampled via SARADC; no per-key interrupts |
| Datasheet | RK3399 TRM, SARADC chapter §26 |
| Pine64 wiki | PinePhone Pro Hardware |
| Schematic | sheet 11 (SARADC_IN1 resistor divider) |
Status — ◐ partial
On PinePhone Pro, both volume buttons emit KEY_VOLUMEUP /
KEY_VOLUMEDOWN evdev events that Sway picks up and routes through its
volume-OSD pipeline. Live capture against a known-good kernel: idle
voltage rests around 1.79 V, vol-up pulls the line to 0–21 mV, vol-down
to 0.30–0.63 V — well-separated bands, no false hits during normal
handling. Driver added in 32e626d Add PPP SARADC volume keys and refresh status docs .
On PineTab2, the same consumer now has a compile-tested path against
the Linux DTS adc-keys node: io-channels = <&saradc 0>,
keyup-threshold-microvolt = <1800000>, KEY_VOLUMEUP at 297500 uV,
and KEY_VOLUMEDOWN at 1750 uV. The remaining work is hardware
proof, so the shared page is partial even though the PinePhone Pro
instance is working.
Driver
- Our tree:
src/sys/arm64/rockchip/rk_saradc.c(SARADC controller) andsrc/sys/arm64/rockchip/rk_adc_keys.c(button decoder). - Linux mainline:
drivers/iio/adc/rockchip_saradc.canddrivers/input/keyboard/adc-keys.c. - FreeBSD upstream: none — both drivers are in-tree only here.
rk_saradc exposes the Rockchip 10-bit SARADC as a small provider.
rk_adc_keys is a child consumer that takes (voltage, keycode)
thresholds from FDT and emits evdev events when the sampled channel is
closer to a key threshold than to keyup-threshold-microvolt.
For first tablet bring-up, dev.rk_adc_keys.0.* now includes the
channel, key-up threshold, button count, poll interval, per-button
keycodes/thresholds, last sample, the closest threshold, and the
sample-to-threshold delta. Those fields make it easy to tell whether a
PineTab2 failure is “SARADC did not attach”, “the key ladder voltage is
not where Linux said it should be”, or “evdev policy is missing”.
Open work
- Confirm PineTab2 channel 0 voltages on hardware and record the idle / VOL+ / VOL- bands here.
- Tune sample rate vs. wake latency — currently polls at a fixed cadence; could potentially gate on a coarse comparator if power becomes a concern.
Related
- Where we are now — sensors / input section, with the live voltage capture above.
- GPIO keys (power, ring, privacy switches) — sibling input subsystem on a different physical path.
- Hardware reference — full chip manifest.