summaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2020-02-19 18:01:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-05 16:42:16 +0100
commitbee419ec70d957f01aa7d634b1fe4a2dda44ab53 (patch)
treecf97408e1963d9bd8d0a1f581b0ea35e07dc8a9f /drivers/nfc
parent24b0fc7c2913759176ad0b41eacad539c08a7d64 (diff)
downloadlinux-stable-bee419ec70d957f01aa7d634b1fe4a2dda44ab53.tar.gz
linux-stable-bee419ec70d957f01aa7d634b1fe4a2dda44ab53.tar.bz2
linux-stable-bee419ec70d957f01aa7d634b1fe4a2dda44ab53.zip
nfc: pn544: Fix occasional HW initialization failure
[ Upstream commit c3331d2fe3fd4d5e321f2467d01f72de7edfb5d0 ] The PN544 driver checks the "enable" polarity during of driver's probe and it's doing that by turning ON and OFF NFC with different polarities until enabling succeeds. It takes some time for the hardware to power-down, and thus, to deassert the IRQ that is raised by turning ON the hardware. Since the delay after last power-down of the polarity-checking process is missed in the code, the interrupt may trigger immediately after installing the IRQ handler (right after the checking is done), which results in IRQ handler trying to touch the disabled HW and ends with marking NFC as 'DEAD' during of the driver's probe: pn544_hci_i2c 1-002a: NFC: nfc_en polarity : active high pn544_hci_i2c 1-002a: NFC: invalid len byte shdlc: llc_shdlc_recv_frame: NULL Frame -> link is dead This patch fixes the occasional NFC initialization failure on Nexus 7 device. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/pn544/i2c.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index d0207f8e68b7..dcef73eb4120 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -236,6 +236,7 @@ static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
out:
gpiod_set_value_cansleep(phy->gpiod_en, !phy->en_polarity);
+ usleep_range(10000, 15000);
}
static void pn544_hci_i2c_enable_mode(struct pn544_i2c_phy *phy, int run_mode)