kernel-fxtec-pro1x/drivers/nfc/pn544
Dmitry Osipenko bee419ec70 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>
2020-03-05 16:42:16 +01:00
..
i2c.c nfc: pn544: Fix occasional HW initialization failure 2020-03-05 16:42:16 +01:00
Kconfig NFC: pn544: Auto-select core module 2015-10-19 19:56:28 +02:00
Makefile
mei.c nfc: mei: use module_mei_cl_driver macro 2016-10-28 08:21:21 -04:00
pn544.c NFC: pn544: Adjust indentation in pn544_hci_check_presence 2020-02-11 04:34:12 -08:00
pn544.h NFC: pn544: Pass hardware variant information when downloading firmware 2014-02-16 23:49:54 +01:00