From nobody Mon Sep 28 14:00:02 2026 Received: from mail-43101.protonmail.ch (mail-43101.protonmail.ch [185.70.43.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D53DD35E1A9 for ; Thu, 20 Aug 2026 20:56:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.101 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787259381; cv=none; b=qQfaVXD2EdKiXw6tTpe0REJo+Qb4wk4X8UcOnmH58Esq6TvRqQ8sb2nxRXXg6Rg7lRegHD7usSyswRNiMXAcN0r4v99hjvHyX4rSIZQowJTaPkXwdP5NeDJULGbeZhIzf2wCH8/EGS40senCkx0DAx7Z5niEJeXrdiywvUnRNPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787259381; c=relaxed/simple; bh=lwm38KTfsw/pjCNVhsVFi9nbwsq7EF/sB8P8Jcau1kY=; h=Date:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s4Oed19MKdlBXUxXdLvpNcwjENCOivKvtJJe57Ds4KYEirSG1fm8OcMWIfwenKOINKWsFdeOUWCs60Lb6Zfn2IZcnfgzxQP4SCktUMRpYH4TPJYHNg6MRDMrTZDwEkTKLMt98jB/9Y1s7PFUkzv0n/hUYY2vXhT4Kq1oMrKfaD0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=VvOEp+qJ; arc=none smtp.client-ip=185.70.43.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="VvOEp+qJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1787259371; x=1787518571; bh=PpDu5cq7SquYTzyZGwtLqNub3RattoKBrrxs4oLHiuo=; h=Date:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=VvOEp+qJFI8HZ0WgMzo4flfUv+TDwhXFMZ7Qhx0t5C3qTBe8GC3W3XcrSO2N9onsR qBvscWvV/M/+qGbN9jQ7Se2QkWZ5jEdY4l9gXGKhbilzmSnKQWqTRy1H5ebi2VkwEB peEmOdRXXBPmfdSOX2te15+OrL8AMq+uX3CTA3SK/ux9qQQAl47Px/NlovWBAnN81S hKAJj4f6hyDx3sS+DiuvPa4ijW6Lgd9ekfABzleoB5Fis5cuaxpKmO5jJbZGmwvDKf jycHT6awNcgMRfBZQCJu2hp5mfetkwL/uqfuthydSMdpe1cvn7VVj6Mp/dbYIDv4Qx MZIYW/SB4UgCA== Date: Thu, 20 Aug 2026 20:56:07 +0000 From: Kristian Brox Cc: Krzysztof Kozlowski , Luca Weiss , Dmitry Baryshkov , oe-linux-nfc@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Kristian Brox Subject: [PATCH v3 1/3] dt-bindings: net: nfc: add st,st21nfcd Message-ID: <20260820-fp5-st21nfcd-v3-v3-1-5ee0a7f44d04@proton.me> In-Reply-To: <20260820-fp5-st21nfcd-v3-v3-0-5ee0a7f44d04@proton.me> References: <20260820-fp5-st21nfcd-v3-v3-0-5ee0a7f44d04@proton.me> Feedback-ID: 203906395:user:proton X-Pm-Message-ID: 2deb959f14ac7fb6dd1b1b816acef53ea3764a0f Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a compatible for the ST ST21NFCD NFC controller. Document optional SYS_CLK (clocks) and VPS_IO (vdd-io-supply), and add an I2C example that uses interrupts-extended. Signed-off-by: Kristian Brox --- .../devicetree/bindings/net/nfc/st,st-nci.yaml | 31 ++++++++++++++++++= ++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml b/Doc= umentation/devicetree/bindings/net/nfc/st,st-nci.yaml index 1dcbddbc5..c859797f4 100644 --- a/Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml +++ b/Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml @@ -15,6 +15,7 @@ properties: - st,st21nfcb-i2c - st,st21nfcb-spi - st,st21nfcc-i2c + - st,st21nfcd =20 reset-gpios: description: Output GPIO pin used for resetting the controller @@ -36,6 +37,15 @@ properties: Specifies that the uicc swp signal can be physically connected to the controller =20 + clocks: + maxItems: 1 + description: + External reference clock connected to SYS_CLK. + + vdd-io-supply: + description: + Digital I/O supply (VPS_IO). + required: - compatible - interrupts @@ -49,6 +59,7 @@ if: enum: - st,st21nfcb-i2c - st,st21nfcc-i2c + - st,st21nfcd then: properties: spi-max-frequency: false @@ -81,6 +92,26 @@ examples: }; }; =20 + - | + #include + #include + + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + nfc@8 { + compatible =3D "st,st21nfcd"; + reg =3D <0x08>; + + interrupts-extended =3D <&gpio5 2 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios =3D <&gpio5 29 GPIO_ACTIVE_HIGH>; + + clocks =3D <&clk>; + vdd-io-supply =3D <&vdd_io>; + }; + }; + - | #include #include --=20 2.55.0 From nobody Mon Sep 28 14:00:02 2026 Received: from mail-244122.protonmail.ch (mail-244122.protonmail.ch [109.224.244.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7023B3DAAC7; Thu, 20 Aug 2026 20:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.224.244.122 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787259390; cv=none; b=pJFcKUATgI7iyoRwkPImQCxe+Pri3aB7mLi84pSTwv31speTNRJHLfYSKO4J/1N6+U5+7M4dQfZBu8jV1pou5OtZxHsZzaid9Z744eNHtqTDoqc74m++V260E7oeCRe81f09kyXTE4sMxk6KeDeZlnfwsVfmXtHjfLRfRw1czuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787259390; c=relaxed/simple; bh=XnXWwXuVRfBNc42Aw8+v/kKQaXxXXJkksLSzgJcWuK4=; h=Date:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TAkW2p8tRDUAfXXUyeBL2hIIlX9EZTVYncAj6GK/f1Ngno6jQJoOdLqeF+uU6twqo8tmWPBn3pbE0uxcnuHwdGC+5H8aohq6wFmkNWkfYlC9aC0L8Bn5i4jVFgOjWYWttkXSWNSzw+AM3xaR2ovuTISSHAfLsE8QzCQltjcXSUQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=eERE2+MP; arc=none smtp.client-ip=109.224.244.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="eERE2+MP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=wcmevsiipjdnlleewr5p6h2pyq.protonmail; t=1787259376; x=1787518576; bh=kMjLAYW+zARf+rgZNABlOlscGbUg88r+sAn3Q8XieO4=; h=Date:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=eERE2+MPFJekUILapkLt4IAQp+mRxw8rtGmdQdCmuyziByqkEiSAO7jeG9uJgsYcH jVmykYnWfeogvIMIj22kPIVDINg/GUsrFV37zu0IRaEGuGTLBu2D/kt/8G3wiCNx4T X5oy1nu5WHbNS0dRwqcGfg1R3nE0R+oTF2viFvU9QwyM7mdlgL5nm/75xVSwQehfSi nT/g/lC1PoKQjh7YN/fCBFu5x29k3Iza6I9WQO9UtjPzqr7Wd6X3Nd12dyKREIaXFt wfr/Niq5Y/Xhq5UX0TqrbgJeEaKL+4Q7QiwCseUz3HxnzjEe91lNwYpkACZZAwhMRp 9cFy/AlExqbCw== Date: Thu, 20 Aug 2026 20:56:10 +0000 From: Kristian Brox Cc: Krzysztof Kozlowski , Luca Weiss , Dmitry Baryshkov , oe-linux-nfc@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Kristian Brox Subject: [PATCH v3 2/3] nfc: st-nci: add raw NCI path for ST21NFCD Message-ID: <20260820-fp5-st21nfcd-v3-v3-2-5ee0a7f44d04@proton.me> In-Reply-To: <20260820-fp5-st21nfcd-v3-v3-0-5ee0a7f44d04@proton.me> References: <20260820-fp5-st21nfcd-v3-v3-0-5ee0a7f44d04@proton.me> Feedback-ID: 203906395:user:proton X-Pm-Message-ID: cd9a2f6d5d39c7684d229939cc1e4a91ae2087bc Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ST21NFCD does not use NDLC. When the compatible is st,st21nfcd, talk raw NCI: - do not add or strip an NDLC PCB - do not run the T1/T2 ACK timers - I2C reads are a 3-byte NCI header plus payload - skip proprietary SET_NFC_MODE and HCI SE discovery Optionally enable clocks (SYS_CLK) and vdd-io (VPS_IO) when the DT describes them. Existing st21nfcb / st21nfcc boards keep the NDLC path and do not need those properties. Tested on Fairphone 5: adapter powers up and reads an NTAG 215. Signed-off-by: Kristian Brox --- drivers/nfc/st-nci/core.c | 5 +++ drivers/nfc/st-nci/i2c.c | 87 ++++++++++++++++++++++++++++++++++++++++---= ---- drivers/nfc/st-nci/ndlc.c | 23 +++++++++---- drivers/nfc/st-nci/ndlc.h | 2 ++ drivers/nfc/st-nci/se.c | 3 ++ 5 files changed, 102 insertions(+), 18 deletions(-) diff --git a/drivers/nfc/st-nci/core.c b/drivers/nfc/st-nci/core.c index a367136d4..2356f16b8 100644 --- a/drivers/nfc/st-nci/core.c +++ b/drivers/nfc/st-nci/core.c @@ -18,8 +18,13 @@ =20 static int st_nci_init(struct nci_dev *ndev) { + struct st_nci_info *info =3D nci_get_drvdata(ndev); struct nci_mode_set_cmd cmd; =20 + /* ST21NFCD has no NDLC proprietary SET_NFC_MODE */ + if (info->ndlc->raw_nci) + return 0; + cmd.cmd_type =3D ST_NCI_SET_NFC_MODE; cmd.mode =3D 1; =20 diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c index 152c20b6b..cfddb7ffe 100644 --- a/drivers/nfc/st-nci/i2c.c +++ b/drivers/nfc/st-nci/i2c.c @@ -10,10 +10,13 @@ #include #include #include +#include #include #include #include #include +#include +#include =20 #include "st-nci.h" =20 @@ -22,10 +25,17 @@ /* ndlc header */ #define ST_NCI_FRAME_HEADROOM 1 #define ST_NCI_FRAME_TAILROOM 0 +#define ST_NCI_RAW_FRAME_HEADROOM 0 =20 #define ST_NCI_I2C_MIN_SIZE 4 /* PCB(1) + NCI Packet header(3) */ +#define ST_NCI_NCI_HDR_SIZE 3 /* raw NCI: MT/PBF/GID + OID + len */ #define ST_NCI_I2C_MAX_SIZE 250 /* req 4.2.1 */ =20 +enum st_nci_i2c_proto { + ST_NCI_I2C_PROTO_NDLC =3D 0, + ST_NCI_I2C_PROTO_RAW_NCI, +}; + #define ST_NCI_DRIVER_NAME "st_nci" #define ST_NCI_I2C_DRIVER_NAME "st_nci_i2c" =20 @@ -34,6 +44,7 @@ struct st_nci_i2c_phy { struct llt_ndlc *ndlc; =20 bool irq_active; + bool raw_nci; =20 struct gpio_desc *gpiod_reset; =20 @@ -111,6 +122,42 @@ static int st_nci_i2c_read(struct st_nci_i2c_phy *phy, u8 buf[ST_NCI_I2C_MAX_SIZE]; struct i2c_client *client =3D phy->i2c_dev; =20 + if (phy->raw_nci) { + r =3D i2c_master_recv(client, buf, ST_NCI_NCI_HDR_SIZE); + if (r < 0) { + usleep_range(1000, 4000); + r =3D i2c_master_recv(client, buf, ST_NCI_NCI_HDR_SIZE); + } + if (r !=3D ST_NCI_NCI_HDR_SIZE) + return -EREMOTEIO; + + len =3D buf[2]; + if (len > ST_NCI_I2C_MAX_SIZE) { + nfc_err(&client->dev, "invalid frame len\n"); + return -EBADMSG; + } + + *skb =3D alloc_skb(ST_NCI_NCI_HDR_SIZE + len, GFP_KERNEL); + if (!*skb) + return -ENOMEM; + + skb_put(*skb, ST_NCI_NCI_HDR_SIZE); + memcpy((*skb)->data, buf, ST_NCI_NCI_HDR_SIZE); + + if (!len) + return 0; + + r =3D i2c_master_recv(client, buf, len); + if (r !=3D len) { + kfree_skb(*skb); + return -EREMOTEIO; + } + + skb_put(*skb, len); + memcpy((*skb)->data + ST_NCI_NCI_HDR_SIZE, buf, len); + return 0; + } + r =3D i2c_master_recv(client, buf, ST_NCI_I2C_MIN_SIZE); if (r < 0) { /* Retry, chip was in standby */ usleep_range(1000, 4000); @@ -211,6 +258,8 @@ static int st_nci_i2c_probe(struct i2c_client *client) return -ENOMEM; =20 phy->i2c_dev =3D client; + phy->raw_nci =3D (uintptr_t)device_get_match_data(dev) =3D=3D + ST_NCI_I2C_PROTO_RAW_NCI; =20 i2c_set_clientdata(client, phy); =20 @@ -225,19 +274,31 @@ static int st_nci_i2c_probe(struct i2c_client *client) return -ENODEV; } =20 + r =3D devm_regulator_get_enable_optional(dev, "vdd-io"); + if (r && r !=3D -ENODEV) + return dev_err_probe(dev, r, "failed to enable vdd-io\n"); + + r =3D PTR_ERR_OR_ZERO(devm_clk_get_optional_enabled(dev, NULL)); + if (r) + return dev_err_probe(dev, r, "failed to enable clock\n"); + phy->se_status.is_ese_present =3D device_property_read_bool(dev, "ese-present"); phy->se_status.is_uicc_present =3D device_property_read_bool(dev, "uicc-present"); =20 r =3D ndlc_probe(phy, &i2c_phy_ops, &client->dev, - ST_NCI_FRAME_HEADROOM, ST_NCI_FRAME_TAILROOM, + phy->raw_nci ? ST_NCI_RAW_FRAME_HEADROOM : + ST_NCI_FRAME_HEADROOM, + ST_NCI_FRAME_TAILROOM, &phy->ndlc, &phy->se_status); if (r < 0) { nfc_err(&client->dev, "Unable to register ndlc layer\n"); return r; } =20 + phy->ndlc->raw_nci =3D phy->raw_nci; + phy->irq_active =3D true; r =3D devm_request_threaded_irq(&client->dev, client->irq, NULL, st_nci_irq_thread_fn, @@ -257,23 +318,25 @@ static void st_nci_i2c_remove(struct i2c_client *clie= nt) } =20 static const struct i2c_device_id st_nci_i2c_id_table[] =3D { - { .name =3D ST_NCI_DRIVER_NAME }, - { } + { ST_NCI_DRIVER_NAME }, + {} }; MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table); =20 -static const struct acpi_device_id st_nci_i2c_acpi_match[] =3D { - { .id =3D "SMO2101" }, - { .id =3D "SMO2102" }, - { } +static const struct acpi_device_id st_nci_i2c_acpi_match[] __maybe_unused = =3D { + {"SMO2101"}, + {"SMO2102"}, + {} }; MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match); =20 -static const struct of_device_id of_st_nci_i2c_match[] =3D { - { .compatible =3D "st,st21nfcb-i2c" }, - { .compatible =3D "st,st21nfcb_i2c" }, - { .compatible =3D "st,st21nfcc-i2c" }, - { } +static const struct of_device_id of_st_nci_i2c_match[] __maybe_unused =3D { + { .compatible =3D "st,st21nfcb-i2c", }, + { .compatible =3D "st,st21nfcb_i2c", }, + { .compatible =3D "st,st21nfcc-i2c", }, + { .compatible =3D "st,st21nfcd", + .data =3D (void *)ST_NCI_I2C_PROTO_RAW_NCI }, + {} }; MODULE_DEVICE_TABLE(of, of_st_nci_i2c_match); =20 diff --git a/drivers/nfc/st-nci/ndlc.c b/drivers/nfc/st-nci/ndlc.c index be4808859..b3192460c 100644 --- a/drivers/nfc/st-nci/ndlc.c +++ b/drivers/nfc/st-nci/ndlc.c @@ -62,8 +62,9 @@ void ndlc_close(struct llt_ndlc *ndlc) /* toggle reset pin */ ndlc->ops->enable(ndlc->phy_id); =20 - nci_prop_cmd(ndlc->ndev, ST_NCI_CORE_PROP, - sizeof(struct nci_mode_set_cmd), (__u8 *)&cmd); + if (!ndlc->raw_nci) + nci_prop_cmd(ndlc->ndev, ST_NCI_CORE_PROP, + sizeof(struct nci_mode_set_cmd), (__u8 *)&cmd); =20 ndlc->powered =3D 0; ndlc->ops->disable(ndlc->phy_id); @@ -72,11 +73,13 @@ EXPORT_SYMBOL(ndlc_close); =20 int ndlc_send(struct llt_ndlc *ndlc, struct sk_buff *skb) { - /* add ndlc header */ - u8 pcb =3D PCB_TYPE_DATAFRAME | PCB_DATAFRAME_RETRANSMIT_NO | - PCB_FRAME_CRC_INFO_NOTPRESENT; + if (!ndlc->raw_nci) { + /* add ndlc header */ + u8 pcb =3D PCB_TYPE_DATAFRAME | PCB_DATAFRAME_RETRANSMIT_NO | + PCB_FRAME_CRC_INFO_NOTPRESENT; =20 - *(u8 *)skb_push(skb, 1) =3D pcb; + *(u8 *)skb_push(skb, 1) =3D pcb; + } skb_queue_tail(&ndlc->send_q, skb); =20 schedule_work(&ndlc->sm_work); @@ -103,6 +106,10 @@ static void llt_ndlc_send_queue(struct llt_ndlc *ndlc) ndlc->hard_fault =3D r; break; } + if (ndlc->raw_nci) { + kfree_skb(skb); + continue; + } time_sent =3D jiffies; *(unsigned long *)skb->cb =3D time_sent; =20 @@ -154,6 +161,10 @@ static void llt_ndlc_rcv_queue(struct llt_ndlc *ndlc) pr_debug("rcvQlen=3D%d\n", ndlc->rcv_q.qlen); =20 while ((skb =3D skb_dequeue(&ndlc->rcv_q)) !=3D NULL) { + if (ndlc->raw_nci) { + nci_recv_frame(ndlc->ndev, skb); + continue; + } pcb =3D skb->data[0]; skb_pull(skb, 1); if ((pcb & PCB_TYPE_MASK) =3D=3D PCB_TYPE_SUPERVISOR) { diff --git a/drivers/nfc/st-nci/ndlc.h b/drivers/nfc/st-nci/ndlc.h index c24ce9b0d..5c1f8baf0 100644 --- a/drivers/nfc/st-nci/ndlc.h +++ b/drivers/nfc/st-nci/ndlc.h @@ -39,6 +39,8 @@ struct llt_ndlc { */ int hard_fault; int powered; + /* ST21NFCD: raw NCI on the wire, no NDLC PCB / ACK timers */ + bool raw_nci; }; =20 int ndlc_open(struct llt_ndlc *ndlc); diff --git a/drivers/nfc/st-nci/se.c b/drivers/nfc/st-nci/se.c index 607ec768e..44cc102bc 100644 --- a/drivers/nfc/st-nci/se.c +++ b/drivers/nfc/st-nci/se.c @@ -621,6 +621,9 @@ int st_nci_discover_se(struct nci_dev *ndev) int se_count =3D 0; struct st_nci_info *info =3D nci_get_drvdata(ndev); =20 + if (info->ndlc->raw_nci) + return 0; + r =3D st_nci_hci_network_init(ndev); if (r !=3D 0) return r; --=20 2.55.0 From nobody Mon Sep 28 14:00:02 2026 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C797F3DB316; Thu, 20 Aug 2026 20:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787259394; cv=none; b=NyC1BQGEJHyP6LP4GL4nwfTPpJlCClGzo0chk46TqRL2bXbJ4kY2UVpyA/ad37DrePip8L0GBP9HKASM9J+QqRrF4028ZL8z3s1bW3vFaCPAuq7rJYLysAmRR+2ERfYytmTrWgebrZd4VgygZ65ASk99QE6btS/V7oczuKAZtwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787259394; c=relaxed/simple; bh=34ATMc5SO5wEemub2fOeue1jnn3V16FMxOOozfaDcik=; h=Date:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EUfi/1EEFwyYfQUfa/v/FxAfcLpdmcFvrnRVUsPYuiEuR+5L7IoyPWXA0m3ZUZy7QNFiB9KRSPi0w6peBSakIXIvYbKnbLBfKRvR0AEhEd3j4+AtQn4JI+tzwzvcwx1V2tHNrUQqNdRBWGW4tqYXyYxTijrJWY/s2Eo0Yaq2RkQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=DUrEJ5cc; arc=none smtp.client-ip=185.70.43.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="DUrEJ5cc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=agiaicdxbbgeflewealzt7h3iq.protonmail; t=1787259376; x=1787518576; bh=34ATMc5SO5wEemub2fOeue1jnn3V16FMxOOozfaDcik=; h=Date:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=DUrEJ5ccMgB3YtMB8uBjrYCvuFHKbBQ0zeJdWql7vR5s8PZv7aHrri1UkOy711hes 2ChTsNNb0LE2IdAkPYArI+gJhSkeFhxkIkziTwgTlFK2lEdy76WcOK65VzmPtVmmo5 DyCposYVaeQWSp0uXEIqVtFb5TUerQQwe1AAEPPNbfpGlDf9Zc3pBAvnQg7epzb5BU cQwL0Y8T24svRcBFpiRNS6LcYt3E9WGmb7J6Wgur1NgOXEAHfwPICa/DndtzwIwl/P yQjvykFITdxFDw1XfnAQ1ORWoFH+A2GE/2nl3600i6GDqQH42T4iiWN3IDyJsuEPW+ AgPnUo3bSKmQg== Date: Thu, 20 Aug 2026 20:56:13 +0000 From: Kristian Brox Cc: Krzysztof Kozlowski , Luca Weiss , Dmitry Baryshkov , oe-linux-nfc@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Kristian Brox Subject: [PATCH v3 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: add ST21NFCD NFC Message-ID: <20260820-fp5-st21nfcd-v3-v3-3-5ee0a7f44d04@proton.me> In-Reply-To: <20260820-fp5-st21nfcd-v3-v3-0-5ee0a7f44d04@proton.me> References: <20260820-fp5-st21nfcd-v3-v3-0-5ee0a7f44d04@proton.me> Feedback-ID: 203906395:user:proton X-Pm-Message-ID: fb78e9548ad2b497de4729976250c9c27cfb8536 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enable the ST21NFCD on i2c9 (0x08), IRQ TLMM 41, reset TLMM 38 active-high. Compatible is st,st21nfcd (raw NCI). SYS_CLK is LN_BB_CLK2. VPS_IO is L18B (vreg_l18b). ese-present and uicc-present follow the public schematic (NFC_SWP1/SWP2: SWP_SE to SIM1, SWP_UICC to SIM2). Reader path is tested; SE/HCE is not. Signed-off-by: Kristian Brox --- arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 34 ++++++++++++++++++= +++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm6= 4/boot/dts/qcom/qcm6490-fairphone-fp5.dts index 04cb9230d..ef66079a0 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts @@ -908,7 +908,23 @@ redriver_ss_in: endpoint { &i2c9 { status =3D "okay"; =20 - /* ST21NFC NFC @ 28 */ + nfc@8 { + compatible =3D "st,st21nfcd"; + reg =3D <0x08>; + + interrupts-extended =3D <&tlmm 41 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios =3D <&tlmm 38 GPIO_ACTIVE_HIGH>; + + pinctrl-0 =3D <&nfc_default>; + pinctrl-names =3D "default"; + + clocks =3D <&rpmhcc RPMH_LN_BB_CLK2>; + vdd-io-supply =3D <&vreg_l18b>; + + ese-present; + uicc-present; + }; + /* VL53L3 ToF @ 29 */ }; =20 @@ -1410,6 +1426,22 @@ hall_sensor_default: hall-sensor-default-state { drive-strength =3D <2>; bias-pull-up; }; + + nfc_default: nfc-default-state { + reset-pins { + pins =3D "gpio38"; + function =3D "gpio"; + drive-strength =3D <2>; + bias-disable; + }; + + int-pins { + pins =3D "gpio41"; + function =3D "gpio"; + drive-strength =3D <2>; + bias-disable; + }; + }; }; =20 &uart5 { --=20 2.55.0