]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
nfc: s3fwrn5: Remove wrong vendor prefix from GPIOs
authorKrzysztof Kozlowski <krzk@kernel.org>
Thu, 10 Sep 2020 16:12:14 +0000 (18:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Sep 2020 22:22:16 +0000 (15:22 -0700)
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.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/nfc/s3fwrn5/i2c.c

index b4eb926d220acf77d382c469c9b02a28f28f8186..5572794925034a469e2a79954536cede77c9e45b 100644 (file)
@@ -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;
 }