Skip to content

Commit

Permalink
NFC: nxp-nci: Make firmware GPIO pin optional
Browse files Browse the repository at this point in the history
There are other NXP NCI compatible NFC controllers such as the PN7150
that use an integrated firmware and therefore do not have a GPIO to
select firmware downloading mode. To support this kind of controller,
let's make the firmware GPIO optional.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20201201113921.6572-1-frieder.schrempf@kontron.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Frieder Schrempf authored and Jakub Kicinski committed Dec 2, 2020
1 parent 6b4f503 commit 59f96cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/net/nfc/nxp-nci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Required properties:
- reg: address on the bus
- interrupts: GPIO interrupt to which the chip is connected
- enable-gpios: Output GPIO pin used for enabling/disabling the chip
- firmware-gpios: Output GPIO pin used to enter firmware download mode

Optional SoC Specific Properties:
- pinctrl-names: Contains only one value - "default".
- pintctrl-0: Specifies the pin control groups used for this controller.
- firmware-gpios: Output GPIO pin used to enter firmware download mode

Example (for ARM-based BeagleBone with NPC100 NFC controller on I2C2):

Expand Down
2 changes: 1 addition & 1 deletion drivers/nfc/nxp-nci/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
return PTR_ERR(phy->gpiod_en);
}

phy->gpiod_fw = devm_gpiod_get(dev, "firmware", GPIOD_OUT_LOW);
phy->gpiod_fw = devm_gpiod_get_optional(dev, "firmware", GPIOD_OUT_LOW);
if (IS_ERR(phy->gpiod_fw)) {
nfc_err(dev, "Failed to get FW gpio\n");
return PTR_ERR(phy->gpiod_fw);
Expand Down

0 comments on commit 59f96cf

Please sign in to comment.