devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: clement.perrochaud@effinnov.com
To: linux-nfc@lists.01.org
Cc: "Clément Perrochaud" <clement.perrochaud@nxp.com>,
	sunil.jogi@nxp.com, jerome.pele@nxp.com,
	Charles.Gorand-Effinnov@nxp.com, lauro.venancio@openbossa.org,
	aloisio.almeida@openbossa.org, sameo@linux.intel.com,
	robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	davem@davemloft.net, grant.likely@linaro.org,
	lefrique@marvell.com, christophe.ricard@gmail.com,
	cuissard@marvell.com, bzhao@marvell.com, hirent@marvell.com,
	akarwar@marvell.com, linux-wireless@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, anda-maria.nicolae@intel.com,
	"Clément Perrochaud" <clement.perrochaud@effinnov.com>
Subject: [PATCH v2 1/3] NFC: nci: Add firmware download support
Date: Mon,  9 Mar 2015 11:12:03 +0100	[thread overview]
Message-ID: <1425895925-20593-2-git-send-email-clement.perrochaud@effinnov.com> (raw)
In-Reply-To: <1425895925-20593-1-git-send-email-clement.perrochaud@effinnov.com>

From: Clément Perrochaud <clement.perrochaud@nxp.com>

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: Clément Perrochaud <clement.perrochaud@effinnov.com>
---
 include/net/nfc/nci_core.h |  1 +
 net/nfc/nci/core.c         | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index ff87f86..34a6e09 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -71,6 +71,7 @@ struct nci_ops {
 	int   (*close)(struct nci_dev *ndev);
 	int   (*send)(struct nci_dev *ndev, struct sk_buff *skb);
 	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);
 	int   (*discover_se)(struct nci_dev *ndev);
 	int   (*disable_se)(struct nci_dev *ndev, u32 se_idx);
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 9575a18..49ff321 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -907,6 +907,16 @@ static int nci_se_io(struct nfc_dev *nfc_dev, u32 se_idx,
 	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 = {
 	.dev_up = nci_dev_up,
 	.dev_down = nci_dev_down,
@@ -922,6 +932,7 @@ static struct nfc_ops nci_nfc_ops = {
 	.disable_se = nci_disable_se,
 	.discover_se = nci_discover_se,
 	.se_io = nci_se_io,
+	.fw_download = nci_fw_download,
 };
 
 /* ---- Interface to NCI drivers ---- */
-- 
Clément Perrochaud

Eff'Innov Technologies
Caen, Aix-En-Provence, Grenoble

Eff'Innov Technologies
Campus EffiScience
2, Esplanade Anton Philips
14460 Colombelles, FRANCE

http://www.effinnov.com

  reply	other threads:[~2015-03-09 10:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 10:12 [PATCH v2 0/3] NFC: nxp-nci: Add support for NXP-NCI NFC controllers clement.perrochaud-BPEPtVrvniRWk0Htik3J/w
2015-03-09 10:12 ` clement.perrochaud [this message]
2015-03-09 10:12 ` [PATCH v2 2/3] NFC: nxp-nci: Add support for NXP NCI chips clement.perrochaud
2015-03-11 11:27   ` Paul Bolle
2015-03-09 10:12 ` [PATCH v2 3/3] NFC: nxp-nci_i2c: Add I2C support to NXP NCI driver clement.perrochaud
2015-03-11 11:22   ` Paul Bolle
2015-03-26 10:21 ` [PATCH v2 0/3] NFC: nxp-nci: Add support for NXP-NCI NFC controllers Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425895925-20593-2-git-send-email-clement.perrochaud@effinnov.com \
    --to=clement.perrochaud@effinnov.com \
    --cc=Charles.Gorand-Effinnov@nxp.com \
    --cc=akarwar@marvell.com \
    --cc=aloisio.almeida@openbossa.org \
    --cc=anda-maria.nicolae@intel.com \
    --cc=bzhao@marvell.com \
    --cc=christophe.ricard@gmail.com \
    --cc=clement.perrochaud@nxp.com \
    --cc=cuissard@marvell.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=hirent@marvell.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jerome.pele@nxp.com \
    --cc=lauro.venancio@openbossa.org \
    --cc=lefrique@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfc@lists.01.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=sunil.jogi@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).