devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v9 0/7] nfc: pn533: add uart phy driver
@ 2019-10-08 14:05 Lars Poeschel
  2019-10-08 14:05 ` [PATCH v9 2/7] nfc: pn532: Add uart phy docs and rename it Lars Poeschel
  2019-10-10  0:29 ` [PATCH v9 0/7] nfc: pn533: add uart phy driver Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Lars Poeschel @ 2019-10-08 14:05 UTC (permalink / raw)
  Cc: Lars Poeschel, Kate Stewart, Thomas Gleixner, Jilayne Lovejoy,
	Greg Kroah-Hartman, netdev, linux-kernel, David S. Miller,
	Rob Herring, Mark Rutland, devicetree, Steve Winslow,
	Gustavo A. R. Silva, Kees Cook, Allison Randal, Johan Hovold,
	Simon Horman

The purpose of this patch series is to add a uart phy driver to the
pn533 nfc driver.
It first changes the dt strings and docs. The dt compatible strings
need to change, because I would add "pn532-uart" to the already
existing "pn533-i2c" one. These two are now unified into just
"pn532". Then the neccessary changes to the pn533 core driver are
made. Then the uart phy is added.
As the pn532 chip supports a autopoll, I wanted to use this instead
of the software poll loop in the pn533 core driver. It is added and
activated by the last to patches.
The way to add the autopoll later in seperate patches is chosen, to
show, that the uart phy driver can also work with the software poll
loop, if someone needs that for some reason.
This patchset is already rebased on Johans "NFC: pn533: fix
use-after-free and memleaks" patch
https://lore.kernel.org/netdev/20191007164059.5927-1-johan@kernel.org/
as they would conflict.
If for some reason Johans patch will not get merged, I can of course
provide the patchset without depending on this patch.

Cc: Lars Poeschel <poeschel@lemonage.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jilayne Lovejoy <opensource@jilayne.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Steve Winslow <swinslow@gmail.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Allison Randal <allison@lohutok.net>
Cc: Johan Hovold <johan@kernel.org>
Cc: Simon Horman <horms@verge.net.au>

Lars Poeschel (7):
  nfc: pn533: i2c: "pn532" as dt compatible string
  nfc: pn532: Add uart phy docs and rename it
  nfc: pn533: Add dev_up/dev_down hooks to phy_ops
  nfc: pn533: Split pn533 init & nfc_register
  nfc: pn533: add UART phy driver
  nfc: pn533: Add autopoll capability
  nfc: pn532_uart: Make use of pn532 autopoll

 .../net/nfc/{pn533-i2c.txt => pn532.txt}      |  25 +-
 drivers/nfc/pn533/Kconfig                     |  11 +
 drivers/nfc/pn533/Makefile                    |   2 +
 drivers/nfc/pn533/i2c.c                       |  22 +-
 drivers/nfc/pn533/pn533.c                     | 271 +++++++++++++--
 drivers/nfc/pn533/pn533.h                     |  38 +-
 drivers/nfc/pn533/uart.c                      | 324 ++++++++++++++++++
 drivers/nfc/pn533/usb.c                       |  12 +-
 8 files changed, 646 insertions(+), 59 deletions(-)
 rename Documentation/devicetree/bindings/net/nfc/{pn533-i2c.txt => pn532.txt} (42%)
 create mode 100644 drivers/nfc/pn533/uart.c

-- 
2.23.0

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

* [PATCH v9 2/7] nfc: pn532: Add uart phy docs and rename it
  2019-10-08 14:05 [PATCH v9 0/7] nfc: pn533: add uart phy driver Lars Poeschel
@ 2019-10-08 14:05 ` Lars Poeschel
  2019-10-09 19:36   ` Rob Herring
  2019-10-10  0:29 ` [PATCH v9 0/7] nfc: pn533: add uart phy driver Jakub Kicinski
  1 sibling, 1 reply; 5+ messages in thread
From: Lars Poeschel @ 2019-10-08 14:05 UTC (permalink / raw)
  To: David S. Miller, Rob Herring, Mark Rutland, Lars Poeschel,
	open list:NFC SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list
  Cc: Johan Hovold, Simon Horman

This adds documentation about the uart phy to the pn532 binding doc. As
the filename "pn533-i2c.txt" is not appropriate any more, rename it to
the more general "pn532.txt".
This also documents the deprecation of the compatible strings ending
with "...-i2c".

Cc: Johan Hovold <johan@kernel.org>
Cc: Simon Horman <horms@verge.net.au>
Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
---
Changes in v9:
- Rebased the patch series on v5.4-rc2
- Produce patch with -M4 to git format-patch to detect the rename
- Change DT node name from pn532@24 to nfc@24 in example

Changes in v8:
- Update existing binding doc instead of adding a new one:
  - Add uart phy example
  - Add general "pn532" compatible string
  - Deprecate "...-i2c" compatible strings
  - Rename file to a more general filename
- Intentionally drop Rob's Reviewed-By as I guess this rather big change
  requires a new review

Changes in v7:
- Accidentally lost Rob's Reviewed-By

Changes in v6:
- Rebased the patch series on v5.3-rc5
- Picked up Rob's Reviewed-By

Changes in v4:
- Add documentation about reg property in case of i2c

Changes in v3:
- seperate binding doc instead of entry in trivial-devices.txt

 .../net/nfc/{pn533-i2c.txt => pn532.txt}      | 25 ++++++++++++++++---
 1 file changed, 21 insertions(+), 4 deletions(-)
 rename Documentation/devicetree/bindings/net/nfc/{pn533-i2c.txt => pn532.txt} (42%)

diff --git a/Documentation/devicetree/bindings/net/nfc/pn533-i2c.txt b/Documentation/devicetree/bindings/net/nfc/pn532.txt
similarity index 42%
rename from Documentation/devicetree/bindings/net/nfc/pn533-i2c.txt
rename to Documentation/devicetree/bindings/net/nfc/pn532.txt
index 2efe3886b95b..a5507dc499bc 100644
--- a/Documentation/devicetree/bindings/net/nfc/pn533-i2c.txt
+++ b/Documentation/devicetree/bindings/net/nfc/pn532.txt
@@ -1,9 +1,16 @@
 * NXP Semiconductors PN532 NFC Controller
 
 Required properties:
-- compatible: Should be "nxp,pn532-i2c" or "nxp,pn533-i2c".
+- compatible: Should be
+    - "nxp,pn532" Place a node with this inside the devicetree node of the bus
+                  where the NFC chip is connected to.
+                  Currently the kernel has phy bindings for uart and i2c.
+    - "nxp,pn532-i2c" (DEPRECATED) only works for the i2c binding.
+    - "nxp,pn533-i2c" (DEPRECATED) only works for the i2c binding.
+
+Required properties if connected on i2c:
 - clock-frequency: I²C work frequency.
-- reg: address on the bus
+- reg: for the I²C bus address. This is fixed at 0x24 for the PN532.
 - interrupts: GPIO interrupt to which the chip is connected
 
 Optional SoC Specific Properties:
@@ -15,9 +22,9 @@ Example (for ARM-based BeagleBone with PN532 on I2C2):
 &i2c2 {
 
 
-	pn532: pn532@24 {
+	pn532: nfc@24 {
 
-		compatible = "nxp,pn532-i2c";
+		compatible = "nxp,pn532";
 
 		reg = <0x24>;
 		clock-frequency = <400000>;
@@ -27,3 +34,13 @@ Example (for ARM-based BeagleBone with PN532 on I2C2):
 
 	};
 };
+
+Example (for PN532 connected via uart):
+
+uart4: serial@49042000 {
+        compatible = "ti,omap3-uart";
+
+        pn532: nfc {
+                compatible = "nxp,pn532";
+        };
+};
-- 
2.23.0

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

* Re: [PATCH v9 2/7] nfc: pn532: Add uart phy docs and rename it
  2019-10-08 14:05 ` [PATCH v9 2/7] nfc: pn532: Add uart phy docs and rename it Lars Poeschel
@ 2019-10-09 19:36   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2019-10-09 19:36 UTC (permalink / raw)
  Cc: David S. Miller, Mark Rutland, Lars Poeschel,
	open list:NFC SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, Johan Hovold, Simon Horman

On Tue,  8 Oct 2019 16:05:39 +0200, Lars Poeschel wrote:
> This adds documentation about the uart phy to the pn532 binding doc. As
> the filename "pn533-i2c.txt" is not appropriate any more, rename it to
> the more general "pn532.txt".
> This also documents the deprecation of the compatible strings ending
> with "...-i2c".
> 
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Simon Horman <horms@verge.net.au>
> Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
> ---
> Changes in v9:
> - Rebased the patch series on v5.4-rc2
> - Produce patch with -M4 to git format-patch to detect the rename
> - Change DT node name from pn532@24 to nfc@24 in example
> 
> Changes in v8:
> - Update existing binding doc instead of adding a new one:
>   - Add uart phy example
>   - Add general "pn532" compatible string
>   - Deprecate "...-i2c" compatible strings
>   - Rename file to a more general filename
> - Intentionally drop Rob's Reviewed-By as I guess this rather big change
>   requires a new review
> 
> Changes in v7:
> - Accidentally lost Rob's Reviewed-By
> 
> Changes in v6:
> - Rebased the patch series on v5.3-rc5
> - Picked up Rob's Reviewed-By
> 
> Changes in v4:
> - Add documentation about reg property in case of i2c
> 
> Changes in v3:
> - seperate binding doc instead of entry in trivial-devices.txt
> 
>  .../net/nfc/{pn533-i2c.txt => pn532.txt}      | 25 ++++++++++++++++---
>  1 file changed, 21 insertions(+), 4 deletions(-)
>  rename Documentation/devicetree/bindings/net/nfc/{pn533-i2c.txt => pn532.txt} (42%)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v9 0/7] nfc: pn533: add uart phy driver
  2019-10-08 14:05 [PATCH v9 0/7] nfc: pn533: add uart phy driver Lars Poeschel
  2019-10-08 14:05 ` [PATCH v9 2/7] nfc: pn532: Add uart phy docs and rename it Lars Poeschel
@ 2019-10-10  0:29 ` Jakub Kicinski
  2019-10-15  9:54   ` Lars Poeschel
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2019-10-10  0:29 UTC (permalink / raw)
  To: Lars Poeschel
  Cc: Kate Stewart, Thomas Gleixner, Jilayne Lovejoy,
	Greg Kroah-Hartman, netdev, linux-kernel, David S. Miller,
	Rob Herring, Mark Rutland, devicetree, Steve Winslow,
	Gustavo A. R. Silva, Kees Cook, Allison Randal, Johan Hovold,
	Simon Horman

On Tue,  8 Oct 2019 16:05:37 +0200, Lars Poeschel wrote:
> The purpose of this patch series is to add a uart phy driver to the
> pn533 nfc driver.
> It first changes the dt strings and docs. The dt compatible strings
> need to change, because I would add "pn532-uart" to the already
> existing "pn533-i2c" one. These two are now unified into just
> "pn532". Then the neccessary changes to the pn533 core driver are
> made. Then the uart phy is added.
> As the pn532 chip supports a autopoll, I wanted to use this instead
> of the software poll loop in the pn533 core driver. It is added and
> activated by the last to patches.
> The way to add the autopoll later in seperate patches is chosen, to
> show, that the uart phy driver can also work with the software poll
> loop, if someone needs that for some reason.
> This patchset is already rebased on Johans "NFC: pn533: fix
> use-after-free and memleaks" patch
> https://lore.kernel.org/netdev/20191007164059.5927-1-johan@kernel.org/
> as they would conflict.
> If for some reason Johans patch will not get merged, I can of course
> provide the patchset without depending on this patch.

The memleak patch was a fix and it's on its way to the current 5.4-rc
releases - therefore it was merged into the net tree. Your set adds
support for a new bus, and will go into the net-next tree.

It'd be best if you reposted once the net tree was merged into the
net-next tree (which usually happens every week or two). If you'd
rather not wait you need to rebase on top of the current net-next tree,
and maintainers will handle the conflicts.

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

* Re: [PATCH v9 0/7] nfc: pn533: add uart phy driver
  2019-10-10  0:29 ` [PATCH v9 0/7] nfc: pn533: add uart phy driver Jakub Kicinski
@ 2019-10-15  9:54   ` Lars Poeschel
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Poeschel @ 2019-10-15  9:54 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Kate Stewart, Thomas Gleixner, Jilayne Lovejoy,
	Greg Kroah-Hartman, netdev, linux-kernel, David S. Miller,
	Rob Herring, Mark Rutland, devicetree, Steve Winslow,
	Gustavo A. R. Silva, Kees Cook, Allison Randal, Johan Hovold,
	Simon Horman

On Wed, Oct 09, 2019 at 05:29:07PM -0700, Jakub Kicinski wrote:
> On Tue,  8 Oct 2019 16:05:37 +0200, Lars Poeschel wrote:
> > The purpose of this patch series is to add a uart phy driver to the
> > pn533 nfc driver.
> > It first changes the dt strings and docs. The dt compatible strings
> > need to change, because I would add "pn532-uart" to the already
> > existing "pn533-i2c" one. These two are now unified into just
> > "pn532". Then the neccessary changes to the pn533 core driver are
> > made. Then the uart phy is added.
> > As the pn532 chip supports a autopoll, I wanted to use this instead
> > of the software poll loop in the pn533 core driver. It is added and
> > activated by the last to patches.
> > The way to add the autopoll later in seperate patches is chosen, to
> > show, that the uart phy driver can also work with the software poll
> > loop, if someone needs that for some reason.
> > This patchset is already rebased on Johans "NFC: pn533: fix
> > use-after-free and memleaks" patch
> > https://lore.kernel.org/netdev/20191007164059.5927-1-johan@kernel.org/
> > as they would conflict.
> > If for some reason Johans patch will not get merged, I can of course
> > provide the patchset without depending on this patch.
> 
> The memleak patch was a fix and it's on its way to the current 5.4-rc
> releases - therefore it was merged into the net tree. Your set adds
> support for a new bus, and will go into the net-next tree.
> 
> It'd be best if you reposted once the net tree was merged into the
> net-next tree (which usually happens every week or two). If you'd
> rather not wait you need to rebase on top of the current net-next tree,
> and maintainers will handle the conflicts.

Thank you very much for this valueable information. I will repost the
v10 of this patchset rebased on net-next, when the fix is appears there.

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

end of thread, other threads:[~2019-10-15  9:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-08 14:05 [PATCH v9 0/7] nfc: pn533: add uart phy driver Lars Poeschel
2019-10-08 14:05 ` [PATCH v9 2/7] nfc: pn532: Add uart phy docs and rename it Lars Poeschel
2019-10-09 19:36   ` Rob Herring
2019-10-10  0:29 ` [PATCH v9 0/7] nfc: pn533: add uart phy driver Jakub Kicinski
2019-10-15  9:54   ` Lars Poeschel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).