Skip to content

Commit b55353e

Browse files
committed
Merge branch 'nfc-s3fwrn5-Few-cleanups'
Krzysztof Kozlowski says: ==================== nfc: s3fwrn5: Few cleanups Changes since v2: 1. Fix dtschema ID after rename (patch 1/8). 2. Apply patch 9/9 (defconfig change). Changes since v1: 1. Rename dtschema file and add additionalProperties:false, as Rob suggested, 2. Add Marek's tested-by, 3. New patches: #4, #5, #6, #7 and #9. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3fe6ab1 + 0760aad commit b55353e

File tree

9 files changed

+101
-41
lines changed

9 files changed

+101
-41
lines changed

CREDITS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ N: Krishna Balasubramanian
191191
192192
D: Wrote SYS V IPC (part of standard kernel since 0.99.10)
193193

194+
B: Robert Baldyga
195+
196+
D: Samsung S3FWRN5 NCI NFC Controller
197+
194198
N: Chris Ball
195199
196200
D: Former maintainer of the MMC/SD/SDIO subsystem.

Documentation/devicetree/bindings/net/nfc/s3fwrn5.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/nfc/samsung,s3fwrn5.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Samsung S3FWRN5 NCI NFC Controller
8+
9+
maintainers:
10+
- Krzysztof Kozlowski <[email protected]>
11+
- Krzysztof Opasiak <[email protected]>
12+
13+
properties:
14+
compatible:
15+
const: samsung,s3fwrn5-i2c
16+
17+
en-gpios:
18+
maxItems: 1
19+
description:
20+
Output GPIO pin used for enabling/disabling the chip
21+
22+
interrupts:
23+
maxItems: 1
24+
25+
reg:
26+
maxItems: 1
27+
28+
wake-gpios:
29+
maxItems: 1
30+
description:
31+
Output GPIO pin used to enter firmware mode and sleep/wakeup control
32+
33+
s3fwrn5,en-gpios:
34+
maxItems: 1
35+
deprecated: true
36+
description:
37+
Use en-gpios
38+
39+
s3fwrn5,fw-gpios:
40+
maxItems: 1
41+
deprecated: true
42+
description:
43+
Use wake-gpios
44+
45+
additionalProperties: false
46+
47+
required:
48+
- compatible
49+
- en-gpios
50+
- interrupts
51+
- reg
52+
- wake-gpios
53+
54+
examples:
55+
- |
56+
#include <dt-bindings/gpio/gpio.h>
57+
#include <dt-bindings/interrupt-controller/irq.h>
58+
59+
i2c4 {
60+
#address-cells = <1>;
61+
#size-cells = <0>;
62+
63+
s3fwrn5@27 {
64+
compatible = "samsung,s3fwrn5-i2c";
65+
reg = <0x27>;
66+
67+
interrupt-parent = <&gpa1>;
68+
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
69+
70+
en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
71+
wake-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
72+
};
73+
};

MAINTAINERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15292,10 +15292,11 @@ F: drivers/media/platform/s3c-camif/
1529215292
F: include/media/drv-intf/s3c_camif.h
1529315293

1529415294
SAMSUNG S3FWRN5 NFC DRIVER
15295-
M: Robert Baldyga <[email protected]>
15295+
M: Krzysztof Kozlowski <[email protected]>
1529615296
M: Krzysztof Opasiak <[email protected]>
1529715297
L: [email protected] (moderated for non-subscribers)
15298-
S: Supported
15298+
S: Maintained
15299+
F: Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml
1529915300
F: drivers/nfc/s3fwrn5
1530015301

1530115302
SAMSUNG S5C73M3 CAMERA DRIVER

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,8 @@
795795
reg = <0x27>;
796796
interrupt-parent = <&gpa1>;
797797
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
798-
s3fwrn5,en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
799-
s3fwrn5,fw-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
798+
en-gpios = <&gpf1 4 GPIO_ACTIVE_HIGH>;
799+
wake-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
800800
};
801801
};
802802

drivers/nfc/s3fwrn5/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config NFC_S3FWRN5
33
tristate
44
select CRYPTO
5+
select CRYPTO_HASH
56
help
67
Core driver for Samsung S3FWRN5 NFC chip. Contains core utilities
78
of chip. It's intended to be used by PHYs to avoid duplicating lots

drivers/nfc/s3fwrn5/firmware.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static int s3fwrn5_fw_get_base_addr(
348348
}
349349

350350
static inline bool
351-
s3fwrn5_fw_is_custom(struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo)
351+
s3fwrn5_fw_is_custom(const struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo)
352352
{
353353
return !!bootinfo->hw_version[2];
354354
}
@@ -399,7 +399,7 @@ int s3fwrn5_fw_setup(struct s3fwrn5_fw_info *fw_info)
399399
return ret;
400400
}
401401

402-
bool s3fwrn5_fw_check_version(struct s3fwrn5_fw_info *fw_info, u32 version)
402+
bool s3fwrn5_fw_check_version(const struct s3fwrn5_fw_info *fw_info, u32 version)
403403
{
404404
struct s3fwrn5_fw_version *new = (void *) &fw_info->fw.version;
405405
struct s3fwrn5_fw_version *old = (void *) &version;

drivers/nfc/s3fwrn5/firmware.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct s3fwrn5_fw_info {
9191

9292
void s3fwrn5_fw_init(struct s3fwrn5_fw_info *fw_info, const char *fw_name);
9393
int s3fwrn5_fw_setup(struct s3fwrn5_fw_info *fw_info);
94-
bool s3fwrn5_fw_check_version(struct s3fwrn5_fw_info *fw_info, u32 version);
94+
bool s3fwrn5_fw_check_version(const struct s3fwrn5_fw_info *fw_info, u32 version);
9595
int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info);
9696
void s3fwrn5_fw_cleanup(struct s3fwrn5_fw_info *fw_info);
9797

drivers/nfc/s3fwrn5/i2c.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ static int s3fwrn5_i2c_read(struct s3fwrn5_i2c_phy *phy)
164164
static irqreturn_t s3fwrn5_i2c_irq_thread_fn(int irq, void *phy_id)
165165
{
166166
struct s3fwrn5_i2c_phy *phy = phy_id;
167-
int ret = 0;
168167

169168
if (!phy || !phy->ndev) {
170169
WARN_ON_ONCE(1);
@@ -179,10 +178,9 @@ static irqreturn_t s3fwrn5_i2c_irq_thread_fn(int irq, void *phy_id)
179178
switch (phy->mode) {
180179
case S3FWRN5_MODE_NCI:
181180
case S3FWRN5_MODE_FW:
182-
ret = s3fwrn5_i2c_read(phy);
181+
s3fwrn5_i2c_read(phy);
183182
break;
184183
case S3FWRN5_MODE_COLD:
185-
ret = -EREMOTEIO;
186184
break;
187185
}
188186

@@ -200,13 +198,21 @@ static int s3fwrn5_i2c_parse_dt(struct i2c_client *client)
200198
if (!np)
201199
return -ENODEV;
202200

203-
phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
204-
if (!gpio_is_valid(phy->gpio_en))
205-
return -ENODEV;
201+
phy->gpio_en = of_get_named_gpio(np, "en-gpios", 0);
202+
if (!gpio_is_valid(phy->gpio_en)) {
203+
/* Support also deprecated property */
204+
phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
205+
if (!gpio_is_valid(phy->gpio_en))
206+
return -ENODEV;
207+
}
206208

207-
phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
208-
if (!gpio_is_valid(phy->gpio_fw_wake))
209-
return -ENODEV;
209+
phy->gpio_fw_wake = of_get_named_gpio(np, "wake-gpios", 0);
210+
if (!gpio_is_valid(phy->gpio_fw_wake)) {
211+
/* Support also deprecated property */
212+
phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
213+
if (!gpio_is_valid(phy->gpio_fw_wake))
214+
return -ENODEV;
215+
}
210216

211217
return 0;
212218
}

0 commit comments

Comments
 (0)