Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: nxp-nci: Make firmware GPIO pin optional

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>

authored by

Frieder Schrempf and committed by
Jakub Kicinski
59f96cf6 6b4f5031

+2 -2
+1 -1
Documentation/devicetree/bindings/net/nfc/nxp-nci.txt
··· 6 6 - reg: address on the bus 7 7 - interrupts: GPIO interrupt to which the chip is connected 8 8 - enable-gpios: Output GPIO pin used for enabling/disabling the chip 9 - - firmware-gpios: Output GPIO pin used to enter firmware download mode 10 9 11 10 Optional SoC Specific Properties: 12 11 - pinctrl-names: Contains only one value - "default". 13 12 - pintctrl-0: Specifies the pin control groups used for this controller. 13 + - firmware-gpios: Output GPIO pin used to enter firmware download mode 14 14 15 15 Example (for ARM-based BeagleBone with NPC100 NFC controller on I2C2): 16 16
+1 -1
drivers/nfc/nxp-nci/i2c.c
··· 286 286 return PTR_ERR(phy->gpiod_en); 287 287 } 288 288 289 - phy->gpiod_fw = devm_gpiod_get(dev, "firmware", GPIOD_OUT_LOW); 289 + phy->gpiod_fw = devm_gpiod_get_optional(dev, "firmware", GPIOD_OUT_LOW); 290 290 if (IS_ERR(phy->gpiod_fw)) { 291 291 nfc_err(dev, "Failed to get FW gpio\n"); 292 292 return PTR_ERR(phy->gpiod_fw);