Commit 25af01ed authored by Clément Perrochaud's avatar Clément Perrochaud Committed by Samuel Ortiz

NFC: nci: Add firmware download support

A simple forward for firmware download (i.e. sending a new firmware
to the NFC adapter) from the NFC subsystem to the drivers.

This feature is required to update the firmware of NXP-NCI NFC
controllers but can be used by any NCI driver.

This feature has been present in the HCI subsystem since 9a695d.
Signed-off-by: default avatarClément Perrochaud <clement.perrochaud@effinnov.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 5a352dd0
...@@ -71,6 +71,7 @@ struct nci_ops { ...@@ -71,6 +71,7 @@ struct nci_ops {
int (*close)(struct nci_dev *ndev); int (*close)(struct nci_dev *ndev);
int (*send)(struct nci_dev *ndev, struct sk_buff *skb); int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
int (*setup)(struct nci_dev *ndev); int (*setup)(struct nci_dev *ndev);
int (*fw_download)(struct nci_dev *ndev, const char *firmware_name);
__u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol); __u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol);
int (*discover_se)(struct nci_dev *ndev); int (*discover_se)(struct nci_dev *ndev);
int (*disable_se)(struct nci_dev *ndev, u32 se_idx); int (*disable_se)(struct nci_dev *ndev, u32 se_idx);
......
...@@ -907,6 +907,16 @@ static int nci_se_io(struct nfc_dev *nfc_dev, u32 se_idx, ...@@ -907,6 +907,16 @@ static int nci_se_io(struct nfc_dev *nfc_dev, u32 se_idx,
return 0; return 0;
} }
static int nci_fw_download(struct nfc_dev *nfc_dev, const char *firmware_name)
{
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
if (!ndev->ops->fw_download)
return -ENOTSUPP;
return ndev->ops->fw_download(ndev, firmware_name);
}
static struct nfc_ops nci_nfc_ops = { static struct nfc_ops nci_nfc_ops = {
.dev_up = nci_dev_up, .dev_up = nci_dev_up,
.dev_down = nci_dev_down, .dev_down = nci_dev_down,
...@@ -922,6 +932,7 @@ static struct nfc_ops nci_nfc_ops = { ...@@ -922,6 +932,7 @@ static struct nfc_ops nci_nfc_ops = {
.disable_se = nci_disable_se, .disable_se = nci_disable_se,
.discover_se = nci_discover_se, .discover_se = nci_discover_se,
.se_io = nci_se_io, .se_io = nci_se_io,
.fw_download = nci_fw_download,
}; };
/* ---- Interface to NCI drivers ---- */ /* ---- Interface to NCI drivers ---- */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment