All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] nfc: s3fwrn5: support the S3NRN4V variant
@ 2026-07-26 22:24 Jorijn van der Graaf
  2026-07-26 22:24 ` [PATCH v3 1/5] nfc: s3fwrn5: drop of_match_ptr() from the I2C driver Jorijn van der Graaf
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jorijn van der Graaf @ 2026-07-26 22:24 UTC (permalink / raw)
  To: David Heidelberg, Krzysztof Kozlowski
  Cc: Jorijn van der Graaf, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Luca Weiss, oe-linux-nfc, netdev,
	devicetree, linux-arm-msm, linux-kernel

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 behind a bootloader protocol the driver
does not implement (so firmware download is skipped), it loads its RF
calibration data through a different proprietary command (DUAL_OPTION),
and it gates its reference clock through a CLK_REQ line that the driver
must service for the chip to be able to generate the 13.56 MHz poll
carrier.

Patches 1-2 are preparatory cleanups from the v2 review; patch 3 adds
the compatible and the clk-req-gpios property to the binding; patch 4
implements the variant in the driver; patch 5 adds the Fairphone 6
board nodes (it depends on patch 3 and can equally go through the qcom
tree 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 at their new path
(load success verified in the log) and also absent (the chip falls back
to its flash defaults and still reads).

Luca, the two questions from the v2 thread (revision/SKU variance of
the calibration tables, linux-firmware submission) are still open;
nothing in this series depends on the answers now that the variant
property is deferred.

The series is based on the nfc tree's for-next.

Changes in v3:
 - Call the DUAL_OPTION payload what it is -- RF calibration data --
   in the driver commit message, comments and log strings (David).
 - Load the calibration files from a chip-scoped directory,
   samsung/s3nrn4v/{hwreg,swreg}.bin, instead of flat
   sec_s3nrn4v_*.bin names (David). The samsung,calibration-variant
   property discussed in the v2 thread is deferred until a device
   actually needs a second set of tables; it can be added compatibly
   on top.
 - Request the calibration files with firmware_request_nowarn(): they
   are optional by design and the driver logs its own warning, the way
   ath10k requests its calibration files.
 - Reword "S3FWRN5-family" in the binding and driver commit messages
   to "a later part in the Samsung (NCI) NFC controller line" (David).
   The binding change is commit-message-only, its content is unchanged
   from v2, so Conor's Acked-by is retained.
 - New patch 1: drop of_match_ptr() so the OF table is referenced in
   every configuration (its __maybe_unused half is already in the nfc
   tree as commit 9739e07fdb29 ("nfc: Drop __maybe_unused from
   of_device_id tables")).
 - New patch 2: spell out the "s3fwrn5_i2c" driver-name string
   (Suggested by David).
 - New patch 5: the Fairphone 6 board nodes, including the
   pvdd-supply the binding marks required for the S3NRN4V.
 - Rebase onto the nfc tree's for-next; the new of_device_id entries
   follow the style of commit 179851e63fde ("nfc: Unify style of
   of_device_id arrays").

Changes in v2:
 - Drop the -i2c bus suffix from the new compatible: it is now plain
   samsung,s3nrn4v (Requested by: Conor Dooley).
 - Close a race in the probe-time CLK_REQ seeding by reading the GPIO
   level under clk_lock, so a stale level can never overwrite a fresher
   state applied by the irq thread (found by the Sashiko AI review of
   v1).
 - Binding completeness: document the PVDD supply (required for the
   S3NRN4V), add an S3NRN4V example exercising the new properties, make
   clk-req-gpios depend on clocks, and describe the CLK_REQ pin in
   hardware terms.
 - Rework the binding commit message: justify the GPIO modelling in
   hardware terms and explain why no fallback compatible applies.
 - Add an s3nrn4v i2c_device_id entry carrying the variant so both
   match paths agree, and describe the of_match_ptr() removal in the
   driver commit message.
 - Reject malformed calibration blobs (word alignment, single-byte
   section index bound) up front instead of failing at STOP_UPDATE.
 - Handle gpiod_get_value_cansleep() failure in the CLK_REQ sync
   instead of treating an error as "clock off".

v2: https://lore.kernel.org/20260705190621.128257-1-jorijnvdgraaf@catcrafts.net
v1: https://lore.kernel.org/20260703202601.78563-1-jorijnvdgraaf@catcrafts.net

Jorijn van der Graaf (5):
  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 S3NRN4V and clk-req-gpios
  nfc: s3fwrn5: support the S3NRN4V variant
  arm64: dts: qcom: milos-fairphone-fp6: Add NFC

 .../bindings/net/nfc/samsung,s3fwrn5.yaml     |  65 +++++++-
 .../boot/dts/qcom/milos-fairphone-fp6.dts     |  49 +++++-
 drivers/nfc/s3fwrn5/core.c                    |  41 ++++-
 drivers/nfc/s3fwrn5/i2c.c                     | 142 ++++++++++++++++--
 drivers/nfc/s3fwrn5/nci.c                     | 121 ++++++++++++++-
 drivers/nfc/s3fwrn5/nci.h                     |  32 +++-
 drivers/nfc/s3fwrn5/s3fwrn5.h                 |  15 ++-
 drivers/nfc/s3fwrn5/uart.c                    |   2 +-
 8 files changed, 446 insertions(+), 21 deletions(-)


base-commit: f0054d864e6e734add71e29961f5ae15211ad24d
-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-27 22:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-26 22:24 [PATCH v3 0/5] nfc: s3fwrn5: support the S3NRN4V variant Jorijn van der Graaf
2026-07-26 22:24 ` [PATCH v3 1/5] nfc: s3fwrn5: drop of_match_ptr() from the I2C driver Jorijn van der Graaf
2026-07-26 22:24 ` [PATCH v3 2/5] nfc: s3fwrn5: use the "s3fwrn5_i2c" string literal directly Jorijn van der Graaf
2026-07-26 22:24 ` [PATCH v3 3/5] dt-bindings: net: nfc: samsung,s3fwrn5: add S3NRN4V and clk-req-gpios Jorijn van der Graaf
2026-07-26 22:24 ` [PATCH v3 4/5] nfc: s3fwrn5: support the S3NRN4V variant Jorijn van der Graaf
2026-07-26 22:24 ` [PATCH v3 5/5] arm64: dts: qcom: milos-fairphone-fp6: Add NFC Jorijn van der Graaf
2026-07-27 10:07   ` Konrad Dybcio
2026-07-27 22:26   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.