[PATCH v5 0/6] nfc: s3fwrn5: support the S3NRN4V variant
From: Jorijn van der Graaf <hidden>
Date: 2026-08-11 22:02:07
Also in:
linux-arm-msm, linux-devicetree, lkml, oe-linux-nfc
This adds support for the Samsung S3NRN4V, a later part in the Samsung NCI NFC controller line the s3fwrn5 driver covers, found e.g. on the Fairphone 6 (SM7635). The S3NRN4V differs from the already-supported parts in three ways: it ships with working firmware, and its bootloader reports a hardware version the driver has no flash base address for (so the firmware download step is skipped); it loads its RF calibration data through a different proprietary command (DUAL_OPTION); and its reference clock speed is set with the single-byte FW_CFG form the vendor HAL uses on this generation. Patches 1-2 are preparatory cleanups from the v2 review; patch 3 adds the compatible to the binding and documents the PVDD supply; patch 4 makes the driver enable that supply; patch 5 implements the variant; patch 6 adds the Fairphone 6 board nodes -- included so the hardware can be tested, per David's v2 request; it depends on patch 3 and is expected to be picked up via the qcom tree (linux-arm-msm) once the binding has landed. Tested on a Fairphone 6 running a milos-mainline kernel: reader mode polls and reads ISO 14443-4 tags reliably, from a fresh boot and across driver reloads, with the calibration files present and also absent (the chip keeps its stored calibration and still reads). The v5 changes were re-verified on the device: tag reads, with the version-gate skip taking the restructured exit path. The test kernel is v7.1.2-based; its net/nfc differs from this base only in the UART transport (nci/uart.c), which this driver does not use. David, the calibration scheme follows our v2 exchange: fixed chip-scoped paths, with a DT table selector deferred until a second table set exists. If you'd rather have the selector now (samsung,calibration-variant, or the generic firmware-name), say so and the next revision will add it. The two questions we put to Luca in the v2 thread (calibration-table variance, linux-firmware submission) are still open; nothing here depends on them. Changes in v5: - Collect Krzysztof's Reviewed-by on patches 1 and 3. - Patch 4: drop the redundant regulator-framework sentence from the commit message and state why the uart phy is not converted (Krzysztof). - Patch 5: restructure the exit labels so failures before the allocation no longer pass through kvfree(), drop the update-announcement print, and log success at dev_dbg() (all Krzysztof). - Rebase onto the nfc tree's current for-next, which was rebased since v4 (the nci parse-hardening and data.c commits v4's cover referenced are no longer in for-next after the rebase); patch 1's referenced commit id updated to the rebased tree (777fd2dab446, was 9739e07fdb29). Changes in v4 (full list in the lore thread): - Drop clk-req-gpios and the driver's clock-gating machinery (A/B tested as functionless) and reference the buffer the chip is wired to (RPMH_LN_BB_CLK2 -- Luca; verified load-bearing). - New patch 4 consuming the binding's pvdd-supply. - FW_CFG from the ->init hook and the DUAL_OPTION upload version-gated on GET_VER, both matching the vendor stack; board DTS style (Konrad). v4: https://lore.kernel.org/20260807021001.239389-1-jorijnvdgraaf@catcrafts.net (local) v3: https://lore.kernel.org/20260726222405.153008-1-jorijnvdgraaf@catcrafts.net (local) v2: https://lore.kernel.org/20260705190621.128257-1-jorijnvdgraaf@catcrafts.net (local) v1: https://lore.kernel.org/20260703202601.78563-1-jorijnvdgraaf@catcrafts.net (local) Jorijn van der Graaf (6): nfc: s3fwrn5: drop of_match_ptr() from the I2C driver nfc: s3fwrn5: use the "s3fwrn5_i2c" string literal directly dt-bindings: net: nfc: samsung,s3fwrn5: add the S3NRN4V nfc: s3fwrn5: enable the PVDD supply nfc: s3fwrn5: support the S3NRN4V variant arm64: dts: qcom: milos-fairphone-fp6: Add NFC .../bindings/net/nfc/samsung,s3fwrn5.yaml | 19 +- .../boot/dts/qcom/milos-fairphone-fp6.dts | 33 +++- drivers/nfc/s3fwrn5/core.c | 34 +++- drivers/nfc/s3fwrn5/i2c.c | 26 ++- drivers/nfc/s3fwrn5/nci.c | 178 +++++++++++++++++- drivers/nfc/s3fwrn5/nci.h | 23 ++- drivers/nfc/s3fwrn5/s3fwrn5.h | 14 +- drivers/nfc/s3fwrn5/uart.c | 2 +- 8 files changed, 313 insertions(+), 16 deletions(-) base-commit: 9f69d05b5a85c417c73fa2d5c7a2d507ac81cf4b -- 2.55.0