From 5aedb5e9661e2a78145525022245beed2ff23dec Mon Sep 17 00:00:00 2001 From: BFE Engineering Date: Tue, 25 Aug 2026 01:01:24 -0600 Subject: [PATCH] =?UTF-8?q?kernel/rv1106:=20SARADC=20VERIFIED=20=E2=80=94?= =?UTF-8?q?=20fixed=20-22=20(vref-supply,=20not=20clk)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf --- kernel/rv1106-enablement/DRIVER-PARITY.md | 2 +- kernel/rv1106-enablement/adc/SARADC-FIX.md | 19 +++++++++++++++++++ .../rv1106-enablement/dts/rv1106-warden.dts | 12 ++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 kernel/rv1106-enablement/adc/SARADC-FIX.md diff --git a/kernel/rv1106-enablement/DRIVER-PARITY.md b/kernel/rv1106-enablement/DRIVER-PARITY.md index f549023..ce55c7d 100644 --- a/kernel/rv1106-enablement/DRIVER-PARITY.md +++ b/kernel/rv1106-enablement/DRIVER-PARITY.md @@ -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/`) | diff --git a/kernel/rv1106-enablement/adc/SARADC-FIX.md b/kernel/rv1106-enablement/adc/SARADC-FIX.md new file mode 100644 index 0000000..d293cda --- /dev/null +++ b/kernel/rv1106-enablement/adc/SARADC-FIX.md @@ -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). diff --git a/kernel/rv1106-enablement/dts/rv1106-warden.dts b/kernel/rv1106-enablement/dts/rv1106-warden.dts index 30d38c0..8aa3833 100644 --- a/kernel/rv1106-enablement/dts/rv1106-warden.dts +++ b/kernel/rv1106-enablement/dts/rv1106-warden.dts @@ -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"; };