diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-05-10 11:57:06 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-14 13:44:53 +0200 |
commit | 0a946301c2d3eac8673e556df820c0b6023ac6c3 (patch) | |
tree | 3cc74ad057df00a3dd6dd6f32d4a008473a21924 /net/nfc/core.c | |
parent | 0b456c418a5595b9d67f300c9ac6a2441e774603 (diff) | |
download | op-kernel-dev-0a946301c2d3eac8673e556df820c0b6023ac6c3.zip op-kernel-dev-0a946301c2d3eac8673e556df820c0b6023ac6c3.tar.gz |
NFC: Extend and fix the internal secure element API
Secure elements need to be discovered after enabling the NFC controller.
This is typically done by the NCI core and the HCI drivers (HCI does not
specify how to discover SEs, it is left to the specific drivers).
Also, the SE enable/disable API explicitely takes a SE index as its
argument.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/core.c')
-rw-r--r-- | net/nfc/core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c index 334954a..a43a56d 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -126,6 +126,13 @@ int nfc_dev_up(struct nfc_dev *dev) if (!rc) dev->dev_up = true; + /* We have to enable the device before discovering SEs */ + if (dev->ops->discover_se) { + rc = dev->ops->discover_se(dev); + if (!rc) + pr_warn("SE discovery failed\n"); + } + error: device_unlock(&dev->dev); return rc; |