Commit graph

15 commits

Author SHA1 Message Date
Gaurav Singhal
e635410e40 NFC: Fix for core init cmd send failure
Due to delay of ~3 sec between core reset response
and core init cmd, i2c send fails as NFC controller
goes to deep sleep state if its idle for ~1sec.

Delay caused due to logs in driver probe sequence.

Delay is added after every gpio state change to
ensure, modified value is taken into consideration
and unnecessary delays are removed.

Change-Id: I4c6e8f867f641d6648139206244d67bb556e0099
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2017-11-08 12:11:34 +05:30
Linux Build Service Account
d598874f03 Merge "drivers: nfc: make nq-nci probe as async probe" 2017-05-11 06:47:55 -07:00
Gaurav Singhal
bf38f066b2 NFC: Disable i2c write failure log
Disable i2c write failure log because
it might cause sluggishness in device.

Change-Id: I1f4514878efd8f00e1eb019d915eaad32bd4d263
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2017-03-06 16:48:57 +05:30
Gaurav Singhal
94594358b9 NFC: Fix interrupt state in recovery
If read function is waiting for interrupt and after that
NFCC goes to recovery, MW will call ioctl (0) and ioctl (1),
In ioctl (0) call we are disabling interrupt so read function
was waiting for interrupt and ioctl call has disabled interrupt,
now there is no possibility interrupt will be enabled again
because only read function enables the interrupt.

Enabled interrupt in ioctl (1) so that we can receive data
after reset/recovery.

Change-Id: I1677a50129534b1eaa4b8c20820a15db299cd9c1
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2017-01-11 17:33:25 +05:30
Gaurav Singhal
41b99b48c5 NFC: Inform CLF whenever eSE is powered off
When the eSE is powered off, the “system” needs to give
8ms to the capacitor connected on the SVDD line to discharge.

We should inform the FW we just powered off the eSE.

Change-Id: I864fd8f75ded6ab8c42ea36bcdadcdbe924e927d
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-12-09 15:43:21 +05:30
Rohit Rangwani
efbf7c961b NFC: Detection of NQ chip set and firmware version
Changes made to detect NQ chipset and firmware
version

Change-Id: Ia9caa30b88eccb99dfebe9179bb61b8c2abb5de4
Signed-off-by: Rohit Rangwani <rrangwan@codeaurora.org>
2016-11-07 16:23:44 +05:30
Lingutla Chandrasekhar
efad585a59 drivers: nfc: make nq-nci probe as async probe
Probe function calls sleep in hardware check, which
stalls kernel booting.
Make the probe as async function to optimize boot time.

Change-Id: Idbc679951ff7bd6fcfac4ba330452e29d78d86dd
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2016-10-20 22:13:07 -07:00
Gaurav Singhal
6f13460739 NFC: Fix unbalanced irq warning stack trace
When NFC is not enabled, IRQ will be disabled and
then if we do suspend/resume wake up functionality
won't be enabled at suspend but we try to disable
the same at resume and cause irq warning.

Fix warning trace in below cases :
1) NFC enabled in makefile, but manually turned off in
   settings menu (NFC driver is enabled and hw is present).
2) NFC is not enabled in makefile
   (NFC driver is enabled and hw is present).

Change-Id: I0fd76809cd949d88ae7b820c37f0a9f349abb090
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-08-17 10:38:00 +05:30
Gaurav Singhal
8e0e68f525 NFC: Set enable gpio to low
If ese gpio is not present on target, and we disable
NFC then enable gpio should be set to LOW.

Negative gpio value is invalid case, we should avoid
gpio free for error scenario.

Change-Id: I87c890bbb66ee683129f062a2aa4c8d95d5c93ee
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-08-16 15:33:20 +05:30
Gaurav Singhal
f2e141460b NFC: IRQ gpio usage modification in nfc_read
Modified condition to ensure data is read
only after interrupt has occurred.

Spurious interrupt handling is done in nfc_read
instead of irq handler.

Change-Id: Ie2362610fe922e792e6358b4386c828fdd754fa8
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-08-04 23:54:16 -07:00
Gaurav Singhal
d874608e42 NFC: Fix crash due to invalid use of ese gpio
Some of the targets are not having ese gpio so if we try
to access this pin on these targets, crash is observed.

Change-Id: Ib5a2d7879f1b493bc445ab4a2d32a89f98d872b4
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-06-28 23:25:01 -07:00
Gaurav Singhal
424b4b2157 NFC: Add eSE power request gpio pin support
We can't control eSE power through driver as of now
so adding gpio pin support for eSE in NQxxx driver.

Multiline comments are updated.

Change-Id: I60651052d7bf97a8a0505e76904cebe2b7c69ce2
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-06-17 15:18:53 -07:00
Gaurav Singhal
917e41ac91 NFC: Error handling correction in probe
Error handling check added in probe function and
memory cleanup in remove function.

Change-Id: Ic8f02dcc89e716ec88b711496d1e43754b95968d
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-06-10 15:13:25 -07:00
Gaurav Singhal
1b18e29caa NFC: CE transaction failed during system suspend
IRQ was disabled at suspend so system was not able to
wake up during CE transaction.

Even after irq was enabled we were not able to wake up in irq handler
because wakeup event was not going due to is_suspended condition.

Change-Id: I5a088230786ef780cca0a3b767ad80e7b0c69f9e
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-05-31 15:24:53 -07:00
Gaurav Singhal
c9f8e5943e NFC: Add snapshot of NQxxx NFC driver
Add the latest version of NQxxx NFC driver
from msm-3.18.

This change is a combination of following changes:

1) NFC: add NQxxxx driver

commit <356203701b7fd61b2d9776fac4fac6427735248b>

2) NFC: change reset and read flow

commit <7620346454865b81d7086167d531aea7bb716926>

3) NFC: Enable DMA and CLK_REQ gpio config issue fix

commit <150dbf117709b5677f86e5ced86b468731019b8b>

4) NFC: Fix function descriptions

commit <c0248d70200c8e09a983758750632b7a75e422d3>

5) nq-nci: enable NFCC hardware check and clock to NQxx

commit <2a92c1d6135f2d1e8fe3f2afcd290a2b1311a5a2>

6) nq-nci: XO shut down issue fix

commit <8938151d4650fca6d42efdbce138aea9bad7eca0>

7) NFC: Remove sleep from irq handler

commit <8ea2c805108cbf59b8e2abf87ee207fbf08fad97>

8) NFC: Remove DMA allocation and stack use in write

commit <c1552090e4c46e1eeca756d0a7b4427f94eab0c3>

CRs-Fixed: 890678, 892310, 955860, 968399, 993292
Change-Id: Ibb861ebdc63d45699369e23c077589d37e024b5e
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-05-18 13:37:18 -07:00