kernel/rv1106: SARADC VERIFIED — fixed -22 (vref-supply, not clk)

The saradc -22 was regulator_get_voltage on a dummy vref (no vref-supply in
DT), not the clk divider. Added vcc_1v8 fixed 1.8V regulator + vref-supply
(matching the vendor 86-panel). iio:device0 now reads both channels
(in_voltage0_raw=1023, in_voltage1_raw=246) — the adc-keys path works.

Five drivers verified this run: wifi, TRNG, OTP, GMAC, SARADC.
adc/SARADC-FIX.md; DRIVER-PARITY updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
This commit is contained in:
BFE Engineering
2026-08-25 01:01:24 -06:00
co-authored by Claude Opus 4.8
parent c7ba8781a4
commit 5aedb5e966
3 changed files with 32 additions and 1 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ c8a3, not just compiled.
| I2C (dw-apb, ff460000=i2c3) | ff460000.i2c | mainline | ✅ batch1 (i2c-3) |
| watchdog (dw-wdt, ff5a0000) | ff5a0000.watchdog | mainline | ✅ batch1 (watchdog0) |
| tsadc thermal (ff3c8000) | rockchip_thermal | ported (data+init+macros) | ✅ soc-thermal reads 39.8°C |
| SARADC (ff3c0000) | ff3c0000.saradc | ported (2-ch v2 data) | 🔨 driver added; probe -22 (clk-rate) |
| SARADC (ff3c0000) | ff3c0000.saradc | ported (2-ch v2 data) | ✅ iio:device0 reads 2ch (adc-keys); fixed -22 via vref-supply |
| TRNG (rng@ff448000) | rockchip,trngv1 | mainline (rk3588 IP) | ✅ /dev/hwrng, real entropy (`rng-otp/`) |
| OTP/nvmem (ff3d0000) | rockchip,rv1106-otp | ported (px30_otp_read) | ✅ rockchip-otp0, reads chip id |
| GMAC (ffa80000) | rockchip,rv1106-gmac | ported (dwmac-rk rv1106_ops) | ✅ eth0 Link Up 100M/Full (`gmac/`) |
@@ -0,0 +1,19 @@
# SARADC — ✅ VERIFIED on warden-c8a3 (2026-08-25); the -22 was vref, not clk
The rockchip_saradc probe failed `-22` NOT at clk_set_rate (no "failed to set
adc clk rate" ever printed) but at `regulator_get_voltage(info->vref)` — with no
`vref-supply` in DT the driver got a **dummy** regulator, and
`regulator_get_voltage(dummy)` returns -EINVAL, which probe returns directly (so
only the generic "probe failed with error -22" showed). The earlier
clk-rv1106-divider theory was wrong (the divider is HIWORD settable, xin24m is
registered; clk_set_rate would clamp, not fail).
**Fix (DT only):** add the 1.8 V reference the vendor 86-panel uses —
```dts
/ { vcc_1v8: vcc-1v8 { compatible = "regulator-fixed"; regulator-name = "vcc_1v8";
regulator-always-on; regulator-boot-on;
regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; }; };
&saradc { vref-supply = <&vcc_1v8>; status = "okay"; };
```
**Evidence:** `iio:device0` (`ff3c0000.saradc`), `in_voltage0_raw=1023`,
`in_voltage1_raw=246` — both channels read real analog values (the adc-keys path).
@@ -30,6 +30,17 @@
pinctrl-names = "default";
reset-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_LOW>;
};
/* SARADC voltage reference (1.8V) — the driver reads this for scale;
without it saradc probes -22 (regulator_get_voltage on the dummy). */
vcc_1v8: vcc-1v8 {
compatible = "regulator-fixed";
regulator-name = "vcc_1v8";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};
};
/* --- console --- */
@@ -76,6 +87,7 @@
};
&saradc {
vref-supply = <&vcc_1v8>;
status = "okay";
};