The S3NRN4V is a later part in the Samsung NCI NFC controller line this binding documents, found e.g. on the Fairphone 6 (SM7635). Its host interface is NCI over I2C like the S3FWRN5, but it is not compatible with any of the existing parts, so no fallback compatible applies: its bootloader speaks a different protocol and its RF configuration is loaded through a different proprietary command set. Document the optional clk-req-gpios property: the controller's CLK_REQ output is asserted for as long as the chip needs its external reference clock, notably while generating the 13.56 MHz poll carrier. The pin is a level signal reflecting the chip's current clock demand, not a one-shot event, so it is modelled as a GPIO. No user of the handshake is known on the already-supported parts, so the property is restricted to the S3NRN4V (easily relaxed should one appear), and it depends on clocks, as its purpose is gating an external clock. Also document the PVDD supply, the externally switched rail powering the controller (boards feed it from a PMIC LDO). It is required for the new device; deployed DTs for the existing parts never described a supply, so for those it stays optional. Add an example for the new device exercising the new properties. Acked-by: Conor Dooley Assisted-by: Claude:claude-opus-4-8 Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf --- .../bindings/net/nfc/samsung,s3fwrn5.yaml | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml b/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml index 12baee45752c..1e784a90d015 100644 --- a/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml +++ b/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml @@ -14,12 +14,20 @@ properties: enum: - samsung,s3fwrn5-i2c - samsung,s3fwrn82 + - samsung,s3nrn4v en-gpios: maxItems: 1 description: Output GPIO pin used for enabling/disabling the chip + clk-req-gpios: + maxItems: 1 + description: + Input GPIO pin connected to the controller's CLK_REQ output, which the + controller asserts for as long as it requires its external reference + clock. + interrupts: maxItems: 1 @@ -29,6 +37,9 @@ properties: clocks: maxItems: 1 + pvdd-supply: + description: PVDD power supply + wake-gpios: maxItems: 1 description: @@ -53,17 +64,45 @@ required: - en-gpios - wake-gpios +# The clock-request handshake gates an external clock, so it needs one. +dependencies: + clk-req-gpios: [ clocks ] + allOf: - if: properties: compatible: contains: - const: samsung,s3fwrn5-i2c + enum: + - samsung,s3fwrn5-i2c + - samsung,s3nrn4v then: required: - interrupts - reg + # No user of the clock-request handshake is known on the other parts. + - if: + not: + properties: + compatible: + contains: + const: samsung,s3nrn4v + then: + properties: + clk-req-gpios: false + + # Deployed DTs for the older parts never described a supply, so PVDD is + # only required for the new device. + - if: + properties: + compatible: + contains: + const: samsung,s3nrn4v + then: + required: + - pvdd-supply + examples: - | #include @@ -97,3 +136,27 @@ examples: }; }; + # S3NRN4V with a clock-request gated external clock + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + nfc@27 { + compatible = "samsung,s3nrn4v"; + reg = <0x27>; + + interrupt-parent = <&tlmm>; + interrupts = <31 IRQ_TYPE_EDGE_RISING>; + + en-gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; + wake-gpios = <&tlmm 7 GPIO_ACTIVE_HIGH>; + clk-req-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>; + + clocks = <&rpmhcc 4>; + pvdd-supply = <&nfc_pvdd>; + }; + }; -- 2.55.0