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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user