Appendix · reference

ADC keys (volume up / down)

Resistor-divider buttons decoded by rk_adc_keys on PinePhone Pro and PineTab2.

Identity

PartVolume up / Volume down buttons
RoleTwo-button input via SARADC voltage divider
Bus / addressPinePhone Pro: RK3399 SARADC channel 1; PineTab2: RK3566/RK3568 SARADC channel 0
GPIO / IRQNone — sampled via SARADC; no per-key interrupts
DatasheetRK3399 TRM, SARADC chapter §26
Pine64 wikiPinePhone Pro Hardware
Schematicsheet 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

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