Skip to contentSkip to conversation

dt-bindings: net: nfc: s3fwrn5: Convert to dtschema

PATCH Superseded Krzysztof Kozlowski 3 participants 9 messages Aug 29, 2020 – Sep 6, 2020

Subsystems (6)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/4 dt-bindings: net: nfc: s3fwrn5: Convert to dtschema

Convert the Samsung S3FWRN5 NCI NFC controller bindings to dtschema. This is conversion only so it includes properties with invalid prefixes (s3fwrn5,en-gpios) which should be addressed later.

---
 .../devicetree/bindings/net/nfc/s3fwrn5.txt   | 25 --------
 .../devicetree/bindings/net/nfc/s3fwrn5.yaml  | 59 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 3 files changed, 60 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/nfc/s3fwrn5.txt
 create mode 100644 Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml
Documentation/devicetree/bindings/net/nfc/s3fwrn5.txt deleted +0 -25
deleted file mode 100644
index f02f6fb7f81c..000000000000
@@ -1,25 +0,0 @@
-* Samsung S3FWRN5 NCI NFC Controller
-
-Required properties:
-- compatible: Should be "samsung,s3fwrn5-i2c".
-- reg: address on the bus
-- interrupts: GPIO interrupt to which the chip is connected
-- s3fwrn5,en-gpios: Output GPIO pin used for enabling/disabling the chip
-- s3fwrn5,fw-gpios: Output GPIO pin used to enter firmware mode and
-  sleep/wakeup control
-
-Example:
-
-&hsi2c_4 {
-	s3fwrn5@27 {
-		compatible = "samsung,s3fwrn5-i2c";
-
-		reg = <0x27>;
-
-		interrupt-parent = <&gpa1>;
-		interrupts = <3 0 0>;
-
-		s3fwrn5,en-gpios = <&gpf1 4 0>;
-		s3fwrn5,fw-gpios = <&gpj0 2 0>;
-	};
-};
Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml new file +59 -0

59 lines not on this page · raw message

MAINTAINERS +1 -0
index ac79fdbdf8d0..91b3d5c349d8 100644
@@ -15273,6 +15273,7 @@ M:	Robert Baldyga <[email protected]>
 M:	Krzysztof Opasiak <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
 S:	Supported
+F:	Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml
 F:	drivers/nfc/s3fwrn5
 
 SAMSUNG S5C73M3 CAMERA DRIVER
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH 2/4 dt-bindings: net: nfc: s3fwrn5: Remove wrong vendor prefix from GPIOs

The device tree property prefix describes the vendor, which in case of S3FWRN5 chip is Samsung. Therefore the "s3fwrn5" prefix for "en-gpios" and "fw-gpios" is not correct and should be deprecated. Introduce properly named properties for these GPIOs and rename the fw-gpios" to "wake-gpios" to better describe its purpose.

---
 .../devicetree/bindings/net/nfc/s3fwrn5.yaml  | 24 ++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml +18 -6
index c22451dea350..1f13b4553db4 100644
@@ -14,28 +14,40 @@ properties:
   compatible:
     const: samsung,s3fwrn5-i2c
 
+  en-gpios:
+    maxItems: 1
+    description:
+      Output GPIO pin used for enabling/disabling the chip
+
   interrupts:
     maxItems: 1
 
   reg:
     maxItems: 1
 
+  wake-gpios:
+    maxItems: 1
+    description:
+      Output GPIO pin used to enter firmware mode and sleep/wakeup control
+
   s3fwrn5,en-gpios:
     maxItems: 1
+    deprecated: true
     description:
-      Output GPIO pin used for enabling/disabling the chip
+      Use en-gpios
 
   s3fwrn5,fw-gpios:
     maxItems: 1
+    deprecated: true
     description:
-      Output GPIO pin used to enter firmware mode and sleep/wakeup control
+      Use wake-gpios
 
 required:
   - compatible
+  - en-gpios
   - interrupts
   - reg
-  - s3fwrn5,en-gpios
-  - s3fwrn5,fw-gpios
+  - wake-gpios
 
 examples:
   - |
@@ -53,7 +65,7 @@ examples:
             interrupt-parent = <&gpa1>;
             interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
 
-            s3fwrn5,en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
-            s3fwrn5,fw-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
+            en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
+            wake-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
         };
     };
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH 3/4 nfc: s3fwrn5: Remove wrong vendor prefix from GPIOs

In reply to Krzysztof Kozlowski

The device tree property prefix describes the vendor, which in case of S3FWRN5 chip is Samsung. Therefore the "s3fwrn5" prefix for "en-gpios" and "fw-gpios" is not correct and should be deprecated. Introduce properly named properties for these GPIOs but still support deprecated ones.

---
 drivers/nfc/s3fwrn5/i2c.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/nfc/s3fwrn5/i2c.c +14 -6
index b4eb926d220a..557279492503 100644
@@ -200,13 +200,21 @@ static int s3fwrn5_i2c_parse_dt(struct i2c_client *client)
 	if (!np)
 		return -ENODEV;
 
-	phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
-	if (!gpio_is_valid(phy->gpio_en))
-		return -ENODEV;
+	phy->gpio_en = of_get_named_gpio(np, "en-gpios", 0);
+	if (!gpio_is_valid(phy->gpio_en)) {
+		/* Support also deprecated property */
+		phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
+		if (!gpio_is_valid(phy->gpio_en))
+			return -ENODEV;
+	}
 
-	phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
-	if (!gpio_is_valid(phy->gpio_fw_wake))
-		return -ENODEV;
+	phy->gpio_fw_wake = of_get_named_gpio(np, "wake-gpios", 0);
+	if (!gpio_is_valid(phy->gpio_fw_wake)) {
+		/* Support also deprecated property */
+		phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
+		if (!gpio_is_valid(phy->gpio_fw_wake))
+			return -ENODEV;
+	}
 
 	return 0;
 }
Signature · 1 line
2.17.1
Tested-by on v1 3/4
#3 lore raw

Re: [RFT 3/4] nfc: s3fwrn5: Remove wrong vendor prefix from GPIOs

Quoted 7 lines · Krzysztof Kozlowski

The device tree property prefix describes the vendor, which in case of S3FWRN5 chip is Samsung. Therefore the "s3fwrn5" prefix for "en-gpios" and "fw-gpios" is not correct and should be deprecated. Introduce properly named properties for these GPIOs but still support deprecated ones.

Quoted 26 lines
---
  drivers/nfc/s3fwrn5/i2c.c | 20 ++++++++++++++------
  1 file changed, 14 insertions(+), 6 deletions(-)
drivers/nfc/s3fwrn5/i2c.c +7 -6
index b4eb926d220a..557279492503 100644
@@ -200,13 +200,21 @@ static int s3fwrn5_i2c_parse_dt(struct i2c_client *client)
  	if (!np)
  		return -ENODEV;
 
-	phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
-	if (!gpio_is_valid(phy->gpio_en))
-		return -ENODEV;
+	phy->gpio_en = of_get_named_gpio(np, "en-gpios", 0);
+	if (!gpio_is_valid(phy->gpio_en)) {
+		/* Support also deprecated property */
+		phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
+		if (!gpio_is_valid(phy->gpio_en))
+			return -ENODEV;
+	}
 
-	phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
-	if (!gpio_is_valid(phy->gpio_fw_wake))
-		return -ENODEV;

drivers/nfc/s3fwrn5/i2c.c static int s3fwrn5_i2c_parse_dt(struct i2c_client *client) · line 220

Quoted 10 lines
drivers/nfc/s3fwrn5/i2c.c +7 -0
+	phy->gpio_fw_wake = of_get_named_gpio(np, "wake-gpios", 0);
+	if (!gpio_is_valid(phy->gpio_fw_wake)) {
+		/* Support also deprecated property */
+		phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
+		if (!gpio_is_valid(phy->gpio_fw_wake))
+			return -ENODEV;
+	}
 
  	return 0;
  }

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
author maintainer
#4 lore raw

PATCH 4/4 arm64: dts: exynos: Use newer S3FWRN5 GPIO properties in Exynos5433 TM2

In reply to Krzysztof Kozlowski

Since "s3fwrn5" is not a valid vendor prefix, use new GPIO properties instead of the deprecated.

---
 arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi +2 -2
index 250fc01de78d..24aab3ea3f52 100644
@@ -795,8 +795,8 @@
 		reg = <0x27>;
 		interrupt-parent = <&gpa1>;
 		interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
-		s3fwrn5,en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
-		s3fwrn5,fw-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
+		en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
+		wake-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
 	};
 };
 
Signature · 1 line
2.17.1
Tested-by on v1 4/4
#5 lore raw

Re: [PATCH 4/4] arm64: dts: exynos: Use newer S3FWRN5 GPIO properties in Exynos5433 TM2

Quoted 4 lines · Krzysztof Kozlowski

Since "s3fwrn5" is not a valid vendor prefix, use new GPIO properties instead of the deprecated.

Quoted 9 lines
---
  arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi +0 -0
index 250fc01de78d..24aab3ea3f52 100644

arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi line 802

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi +2 -2
@@ -795,8 +795,8 @@
  		reg = <0x27>;
  		interrupt-parent = <&gpa1>;
  		interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
-		s3fwrn5,en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
-		s3fwrn5,fw-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
+		en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
+		wake-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
  	};
  };
 

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
author maintainer
#6 lore raw

Re: [PATCH 4/4] arm64: dts: exynos: Use newer S3FWRN5 GPIO properties in Exynos5433 TM2

Quoted 8 lines · Marek Szyprowski
Quoted 4 lines · Krzysztof Kozlowski

Since "s3fwrn5" is not a valid vendor prefix, use new GPIO properties instead of the deprecated.

Thanks for testing this and others in the series. Much appreciated!

Best regards,
Krzysztof

maintainer
#7 lore raw
In reply to Krzysztof Kozlowski
Quoted 8 lines · Krzysztof Kozlowski

Convert the Samsung S3FWRN5 NCI NFC controller bindings to dtschema. This is conversion only so it includes properties with invalid prefixes (s3fwrn5,en-gpios) which should be addressed later.

---
 .../devicetree/bindings/net/nfc/s3fwrn5.txt   | 25 --------
 .../devicetree/bindings/net/nfc/s3fwrn5.yaml  | 59 +++++++++++++++++++

Please rename to samsung,s3fwrn5-i2c.yaml.

Quoted 70 lines
 MAINTAINERS                                   |  1 +
 3 files changed, 60 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/nfc/s3fwrn5.txt
 create mode 100644 Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml
Documentation/devicetree/bindings/net/nfc/s3fwrn5.txt deleted +0 -25
deleted file mode 100644
index f02f6fb7f81c..000000000000
@@ -1,25 +0,0 @@
-* Samsung S3FWRN5 NCI NFC Controller
-
-Required properties:
-- compatible: Should be "samsung,s3fwrn5-i2c".
-- reg: address on the bus
-- interrupts: GPIO interrupt to which the chip is connected
-- s3fwrn5,en-gpios: Output GPIO pin used for enabling/disabling the chip
-- s3fwrn5,fw-gpios: Output GPIO pin used to enter firmware mode and
-  sleep/wakeup control
-
-Example:
-
-&hsi2c_4 {
-	s3fwrn5@27 {
-		compatible = "samsung,s3fwrn5-i2c";
-
-		reg = <0x27>;
-
-		interrupt-parent = <&gpa1>;
-		interrupts = <3 0 0>;
-
-		s3fwrn5,en-gpios = <&gpf1 4 0>;
-		s3fwrn5,fw-gpios = <&gpj0 2 0>;
-	};
-};
Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml new file +28 -0
new file mode 100644
index 000000000000..c22451dea350
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/nfc/s3fwrn5.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3FWRN5 NCI NFC Controller
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+  - Krzysztof Opasiak <[email protected]>
+
+properties:
+  compatible:
+    const: samsung,s3fwrn5-i2c
+
+  interrupts:
+    maxItems: 1
+
+  reg:
+    maxItems: 1
+
+  s3fwrn5,en-gpios:
+    maxItems: 1
+    description:
+      Output GPIO pin used for enabling/disabling the chip
+
+  s3fwrn5,fw-gpios:

Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml line 38

Quoted 10 lines
Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml new file +10 -0
+    maxItems: 1
+    description:
+      Output GPIO pin used to enter firmware mode and sleep/wakeup control
+
+required:
+  - compatible
+  - interrupts
+  - reg
+  - s3fwrn5,en-gpios
+  - s3fwrn5,fw-gpios

additionalProperties: false

Quoted 36 lines
Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml new file +21 -0
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c4 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        s3fwrn5@27 {
+            compatible = "samsung,s3fwrn5-i2c";
+            reg = <0x27>;
+
+            interrupt-parent = <&gpa1>;
+            interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+
+            s3fwrn5,en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
+            s3fwrn5,fw-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
+        };
+    };
MAINTAINERS +1 -0
index ac79fdbdf8d0..91b3d5c349d8 100644
@@ -15273,6 +15273,7 @@ M:	Robert Baldyga <[email protected]>
 M:	Krzysztof Opasiak <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
 S:	Supported
+F:	Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml
 F:	drivers/nfc/s3fwrn5
 
 SAMSUNG S5C73M3 CAMERA DRIVER
Signature · 1 line
2.17.1
author maintainer
#8 lore raw
Quoted 87 lines · Rob Herring
Quoted 8 lines · Krzysztof Kozlowski

Convert the Samsung S3FWRN5 NCI NFC controller bindings to dtschema. This is conversion only so it includes properties with invalid prefixes (s3fwrn5,en-gpios) which should be addressed later.

---
 .../devicetree/bindings/net/nfc/s3fwrn5.txt   | 25 --------
 .../devicetree/bindings/net/nfc/s3fwrn5.yaml  | 59 +++++++++++++++++++

Please rename to samsung,s3fwrn5-i2c.yaml.

Quoted 74 lines
 MAINTAINERS                                   |  1 +
 3 files changed, 60 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/nfc/s3fwrn5.txt
 create mode 100644 Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml
Documentation/devicetree/bindings/net/nfc/s3fwrn5.txt deleted +0 -25
deleted file mode 100644
index f02f6fb7f81c..000000000000
@@ -1,25 +0,0 @@
-* Samsung S3FWRN5 NCI NFC Controller
-
-Required properties:
-- compatible: Should be "samsung,s3fwrn5-i2c".
-- reg: address on the bus
-- interrupts: GPIO interrupt to which the chip is connected
-- s3fwrn5,en-gpios: Output GPIO pin used for enabling/disabling the chip
-- s3fwrn5,fw-gpios: Output GPIO pin used to enter firmware mode and
-  sleep/wakeup control
-
-Example:
-
-&hsi2c_4 {
-     s3fwrn5@27 {
-             compatible = "samsung,s3fwrn5-i2c";
-
-             reg = <0x27>;
-
-             interrupt-parent = <&gpa1>;
-             interrupts = <3 0 0>;
-
-             s3fwrn5,en-gpios = <&gpf1 4 0>;
-             s3fwrn5,fw-gpios = <&gpj0 2 0>;
-     };
-};
Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml new file +32 -0
new file mode 100644
index 000000000000..c22451dea350
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/nfc/s3fwrn5.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3FWRN5 NCI NFC Controller
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+  - Krzysztof Opasiak <[email protected]>
+
+properties:
+  compatible:
+    const: samsung,s3fwrn5-i2c
+
+  interrupts:
+    maxItems: 1
+
+  reg:
+    maxItems: 1
+
+  s3fwrn5,en-gpios:
+    maxItems: 1
+    description:
+      Output GPIO pin used for enabling/disabling the chip
+
+  s3fwrn5,fw-gpios:
+    maxItems: 1
+    description:
+      Output GPIO pin used to enter firmware mode and sleep/wakeup control
+
Quoted 8 lines

Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml line 38

Quoted 6 lines
Documentation/devicetree/bindings/net/nfc/s3fwrn5.yaml new file +6 -0
+required:
+  - compatible
+  - interrupts
+  - reg
+  - s3fwrn5,en-gpios
+  - s3fwrn5,fw-gpios

additionalProperties: false

Sure, I'll fix both issues.

Best regards,
Krzysztof