summaryrefslogtreecommitdiffstats
path: root/net/nfc/nci
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-06-06 13:16:40 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2015-06-09 00:34:21 +0200
commitc39daeee50eb0b95d3b91bda21b77955a459ee5f (patch)
tree09d883175147e793d64d773aed29ab60fc6350d8 /net/nfc/nci
parentNFC: nci: Add NCI_RESET return code check before setup (diff)
downloadlinux-c39daeee50eb0b95d3b91bda21b77955a459ee5f.tar.xz
linux-c39daeee50eb0b95d3b91bda21b77955a459ee5f.zip
NFC: nci: Add nci init ops for early device initialization
Some device may need to execute some proprietary commands in order to "wake-up"; Before the nci state initialization. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/nci')
-rw-r--r--net/nfc/nci/core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index b900e6a2a284..458e58bb9cb1 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -344,8 +344,13 @@ static int nci_open_device(struct nci_dev *ndev)
set_bit(NCI_INIT, &ndev->flags);
- rc = __nci_request(ndev, nci_reset_req, 0,
- msecs_to_jiffies(NCI_RESET_TIMEOUT));
+ if (ndev->ops->init)
+ rc = ndev->ops->init(ndev);
+
+ if (!rc) {
+ rc = __nci_request(ndev, nci_reset_req, 0,
+ msecs_to_jiffies(NCI_RESET_TIMEOUT));
+ }
if (!rc && ndev->ops->setup) {
rc = ndev->ops->setup(ndev);