Adds Intel FieldsPeak NFC solution driver
Subsystems (3)
v2 cover Adds Intel FieldsPeak NFC solution driver
These patches add support for Intel's FieldsPeak NFC solution.
Fields Peak complies with the ISO/IEC 14443A/B, 15693, 18092, and JIS X 6319-4. It is an NCI based controller.
RF Protocols supported:
- NFC Forum Type 1 Tags (Jewel, Topaz)
- NFC Forum Type 2 Tags (Mifare UL)
- NFC Forum Type 3 Tags (FeliCa)
- NFC Forum Type 4A (ISO/IEC 14443 A-4 106kbps to 848kbps)
- NFC Forum Type 4B (ISO/IEC 14443 B-4 106kbps to 848kbps)
- NFCIP in passive and active modes (ISO/IEC 18092 106kbps to 424kbps)
- B’ (based on ISO/IEC 14443 B-2)
- iCLASS (based on ISO/IEC 15693-2)
- Vicinity cards (ISO/IEC 15693-3)
- Kovio tags (NFC Forum Type 2)
The device can be enumerated using ACPI using the id INT339A. The 1st GPIO is the IRQ and the 2nd is the RESET pin.
Changes since v1:
- removed .owner
- made local functions static
- replaced nfc_info with dev_dbg
- make controller setup possible without OTP patch
- removed the commint that was adding nci_init/reset and start using the newly added functions nci_core_init/reset
- fixed typo and use full controller name instead of abreviation in Kconfig
- added more info about the controller in the commit message
- moved NCI_OP_CORE_RESET_NTF, NCI_OP_CORE_GET_CONFIG_RSP and NCI_OP_CORE_GET_CONFIG_CMD into the core header files
- added MODULE_DEVICE_TABLE for ACPI
- defined FDP_FW_UPDATE_DEST 0xC2
- release the firmware buffers
- settings the vendor configuration and clock on post setup
- platform data enumerations removed (ACPI enumeration left)
- packet reception intercept logic remove
- nci: removed "NFC: NCI: Adds NCI init and reset API for drivers"
- nci: removed nci_send_cmd symbol export
- nci: removed nci_request_driver and nci_req_complete_driver
- removed mutex from driver (no need for it)
- nci: check the setup return code before callig post_setup
- nci: add function to allow sending core commands from driver
- nci: Use a separate mutex for nci open and close
- nci: mutex for: Adds a way to get the new connection ID
- nci: Allow the driver to set handler for core nci ops
Robert Dolca (9):
nfc: nci: Exporting nci data send API
nfc: nci: Add function to get max packet size for conn
nfc: nci: Define new core opcodes
nfc: nci: Allow the driver to set handler for core nci ops
nfc: nci: Do not call post_setup when setup fails
nfc: nci: Add function to allow sending core commands from driver
nfc: nci: Use a separate mutex for nci open and close
nfc: nci: Adds a way to get the new connection ID
nfc: Add Intel Fields Peak NFC solution driver
drivers/nfc/Kconfig | 1 + drivers/nfc/Makefile | 1 + drivers/nfc/fdp/Kconfig | 23 ++ drivers/nfc/fdp/Makefile | 9 + drivers/nfc/fdp/fdp.c | 777 +++++++++++++++++++++++++++++++++++++++++ drivers/nfc/fdp/fdp.h | 52 +++ drivers/nfc/fdp/i2c.c | 416 ++++++++++++++++++++++ drivers/nfc/st-nci/st-nci_se.c | 2 +- include/net/nfc/nci.h | 7 + include/net/nfc/nci_core.h | 29 +- net/nfc/nci/core.c | 108 +++--- net/nfc/nci/data.c | 13 + net/nfc/nci/ntf.c | 6 +- net/nfc/nci/rsp.c | 12 +- 14 files changed, 1403 insertions(+), 53 deletions(-) create mode 100644 drivers/nfc/fdp/Kconfig create mode 100644 drivers/nfc/fdp/Makefile create mode 100644 drivers/nfc/fdp/fdp.c create mode 100644 drivers/nfc/fdp/fdp.h create mode 100644 drivers/nfc/fdp/i2c.c
Signature · 1 line
1.9.1
PATCH v2 1/9 nfc: nci: Export nci data send API
For the firmware update the driver may use nci_send_data.
--- net/nfc/nci/data.c | 1 + 1 file changed, 1 insertion(+)
net/nfc/nci/data.c +1 -0
@@ -203,6 +203,7 @@ free_exit: exit:return rc; } +EXPORT_SYMBOL (nci_send_data);/* ----------------- NCI RX Data ----------------- */
Signature · 1 line
1.9.1
PATCH v2 2/9 nfc: nci: Add function to get max packet size for conn
In reply to Robert DolcaFDP driver needs to send the firmware as regular packets (not fragmented). The driver should have a way to get the max packet size for a given connection.
--- include/net/nfc/nci_core.h | 1 + net/nfc/nci/data.c | 12 ++++++++++++ 2 files changed, 13 insertions(+)
include/net/nfc/nci_core.h +1 -0
@@ -351,6 +351,7 @@ int nci_prop_ntf_packet(struct nci_dev *ndev, __u16 opcode,void nci_rx_data_packet (struct nci_dev *ndev,struct sk_buff *skb);int nci_send_cmd (struct nci_dev *ndev,__u16 opcode,__u8 plen,void *payload);int nci_send_data (struct nci_dev *ndev,__u8 conn_id,struct sk_buff *skb); +__u8 nci_conn_max_data_pkt_payload_size (struct nci_dev *ndev,__u8 conn_id);void nci_data_exchange_complete (struct nci_dev *ndev,struct sk_buff *skb,__u8 conn_id,int err);void nci_hci_data_received_cb (void *context,struct sk_buff *skb,int err);
net/nfc/nci/data.c +12 -0
@@ -90,6 +90,18 @@ static inline void nci_push_data_hdr(struct nci_dev *ndev,nci_pbf_set ((__u8 *)hdr, pbf); } +__u8 nci_conn_max_data_pkt_payload_size (struct nci_dev *ndev,__u8 conn_id) +{ +struct nci_conn_info *conn_info; + + conn_info =nci_get_conn_info_by_conn_id (ndev, conn_id); +if (!conn_info) +return -EPROTO ; + +return conn_info->max_pkt_payload_len; +} +EXPORT_SYMBOL (nci_conn_max_data_pkt_payload_size); +static int nci_queue_tx_data_frags (struct nci_dev *ndev,__u8 conn_id,struct sk_buff *skb) {
Signature · 1 line
1.9.1
PATCH v2 3/9 nfc: nci: Introduce new core opcodes
In reply to Robert DolcaAdd NCI_OP_CORE_GET_CONFIG_CMD, NCI_OP_CORE_GET_CONFIG_RSP and NCI_OP_CORE_RESET_NTF.
--- include/net/nfc/nci.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/net/nfc/nci.h +7 -0
@@ -315,6 +315,8 @@ struct nci_nfcee_mode_set_cmd {__u8 nfcee_mode; } __packed; +#define NCI_OP_CORE_GET_CONFIG_CMD nci_opcode_pack(NCI_GID_CORE, 0x03) +/* ----------------------- */ /* ---- NCI Responses ---- */ /* ----------------------- */
@@ -375,6 +377,9 @@ struct nci_nfcee_discover_rsp { } __packed;#define NCI_OP_NFCEE_MODE_SET_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01) + +#define NCI_OP_CORE_GET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x03) +/* --------------------------- */ /* ---- NCI Notifications ---- */ /* --------------------------- */
@@ -528,4 +533,6 @@ struct nci_nfcee_discover_ntf { struct nci_nfcee_information_tlv information_tlv; } __packed; +#define NCI_OP_CORE_RESET_NTF nci_opcode_pack(NCI_GID_CORE, 0x00) +#endif /* __NCI_H */
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 4/9 nfc: nci: Allow the driver to set handler for core nci ops
In reply to Robert DolcaThe driver may be required to act when some responses or notifications arrive. For example the NCI core does not have a handler for NCI_OP_CORE_GET_CONFIG_RSP. The NFCC can send a config response that has to be read by the driver and the packet may contain vendor specific data.
The Fields Peak driver needs to take certain actions when a reset notification arrives (packet also not handled by the nfc core).
The driver handlers do not interfere with the core and they are called after the core processes the packet.
--- include/net/nfc/nci_core.h | 13 +++++++++---- net/nfc/nci/core.c | 43 +++++++++++++++++++++++-------------------- net/nfc/nci/ntf.c | 6 +++++- net/nfc/nci/rsp.c | 6 +++++- 4 files changed, 42 insertions(+), 26 deletions(-)
include/net/nfc/nci_core.h +9 -4
@@ -96,6 +96,9 @@ struct nci_ops {struct nci_prop_ops *prop_ops;size_t n_prop_ops; + +struct nci_prop_ops *core_ops; +size_t n_core_ops; };#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
@@ -344,10 +347,12 @@ static inline int nci_set_vendor_cmds(struct nci_dev *ndev,void nci_rsp_packet (struct nci_dev *ndev,struct sk_buff *skb);void nci_ntf_packet (struct nci_dev *ndev,struct sk_buff *skb); -int nci_prop_rsp_packet (struct nci_dev *ndev,__u16 opcode, -struct sk_buff *skb); -int nci_prop_ntf_packet (struct nci_dev *ndev,__u16 opcode, -struct sk_buff *skb); +int nci_op_rsp_packet (struct nci_dev *ndev,__u16 rsp_opcode, +struct sk_buff *skb,struct nci_prop_ops *ops, +size_t n_ops); +int nci_op_ntf_packet (struct nci_dev *ndev,__u16 ntf_opcode, +struct sk_buff *skb,struct nci_prop_ops *ops, +size_t n_ops);void nci_rx_data_packet (struct nci_dev *ndev,struct sk_buff *skb);int nci_send_cmd (struct nci_dev *ndev,__u16 opcode,__u8 plen,void *payload);int nci_send_data (struct nci_dev *ndev,__u8 conn_id,struct sk_buff *skb);
net/nfc/nci/core.c +23 -20
69 lines not on this page · raw message
net/nfc/nci/ntf.c +5 -1
@@ -759,7 +759,9 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)skb_pull (skb,NCI_CTRL_HDR_SIZE );if (nci_opcode_gid (ntf_opcode) ==NCI_GID_PROPRIETARY ) { -if (nci_prop_ntf_packet (ndev, ntf_opcode, skb)) { +if (nci_op_ntf_packet (ndev, ntf_opcode, skb, + ndev->ops->prop_ops, + ndev->ops->n_prop_ops) == -ENOTSUPP ) {pr_err ("unsupported ntf opcode 0x%x\n" , ntf_opcode); }
@@ -805,6 +807,8 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)break ; } +nci_op_ntf_packet (ndev, ntf_opcode, skb, ndev->ops->core_ops, + ndev->ops->n_core_ops); end:kfree_skb (skb); }
net/nfc/nci/rsp.c +5 -1
@@ -297,7 +297,9 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)skb_pull (skb,NCI_CTRL_HDR_SIZE );if (nci_opcode_gid (rsp_opcode) ==NCI_GID_PROPRIETARY ) { -if (nci_prop_rsp_packet (ndev, rsp_opcode, skb) == -ENOTSUPP ) { +if (nci_op_rsp_packet (ndev, rsp_opcode, skb, + ndev->ops->prop_ops, + ndev->ops->n_prop_ops) == -ENOTSUPP ) {pr_err ("unsupported rsp opcode 0x%x\n" , rsp_opcode); }
@@ -355,6 +357,8 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)break ; } +nci_op_rsp_packet (ndev, rsp_opcode, skb, ndev->ops->core_ops, + ndev->ops->n_core_ops); end:kfree_skb (skb);
Signature · 1 line
1.9.1
PATCH v2 5/9 nfc: nci: Do not call post_setup when setup fails
In reply to Robert DolcaThe driver should know that it can continue with post setup where setup left off. Being able to execute post_setup when setup fails may force the developer to keep this state in the driver.
--- net/nfc/nci/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/nfc/nci/core.c +1 -2
@@ -402,9 +402,8 @@ static int nci_open_device(struct nci_dev *ndev) msecs_to_jiffies(NCI_INIT_TIMEOUT)); } -if (ndev->ops->post_setup) { +if (!rc && ndev->ops->post_setup) rc = ndev->ops->post_setup (ndev); - }if (!rc) { rc = __nci_request(ndev, nci_init_complete_req, 0,
Signature · 1 line
1.9.1
PATCH v2 7/9 nfc: nci: Use a separate mutex for nci open and close
In reply to Robert DolcaThe functions were using req_lock for serialization. Doing so it prevented the driver from calling nci_request during setup because it uses the same mutex.
In the open and close functions __nci_request was replaced with nci_request because it acquires req_lock.
Add test for NCI_INIT bit in nci_request to allow calling the function during setup.
--- include/net/nfc/nci_core.h | 3 +++ net/nfc/nci/core.c | 30 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-)
include/net/nfc/nci_core.h +3 -0
@@ -266,6 +266,9 @@ struct nci_dev {/* stored during intf_activated_ntf */ __u8 remote_gb[NFC_MAX_GT_LEN ];__u8 remote_gb_len; + +/* lock used for setup and other nci_ops serialization */ +struct mutex op_lock; };/* ----- NCI Devices ----- */
net/nfc/nci/core.c +16 -14
@@ -136,7 +136,8 @@ inline int nci_request(struct nci_dev *ndev, {int rc; -if (!test_bit (NCI_UP , &ndev->flags)) +if (!test_bit (NCI_UP , &ndev->flags) && + !test_bit (NCI_INIT , &ndev->flags))return -ENETDOWN ;/* Serialize all requests */
@@ -383,7 +384,7 @@ static int nci_open_device(struct nci_dev *ndev) {int rc =0 ; -mutex_lock (&ndev->req_lock); +mutex_lock (&ndev->op_lock);if (test_bit (NCI_UP , &ndev->flags)) { rc = -EALREADY ;
@@ -403,8 +404,8 @@ static int nci_open_device(struct nci_dev *ndev) rc = ndev->ops->init (ndev);if (!rc) { - rc =__nci_request (ndev, nci_reset_req,0 , -msecs_to_jiffies (NCI_RESET_TIMEOUT )); + rc =nci_request (ndev, nci_reset_req,0 , +msecs_to_jiffies (NCI_RESET_TIMEOUT )); }if (!rc && ndev->ops->setup) {
@@ -412,16 +413,16 @@ static int nci_open_device(struct nci_dev *ndev) }if (!rc) { - rc =__nci_request (ndev, nci_init_req,0 , -msecs_to_jiffies (NCI_INIT_TIMEOUT )); + rc =nci_request (ndev, nci_init_req,0 , +msecs_to_jiffies (NCI_INIT_TIMEOUT )); }if (!rc && ndev->ops->post_setup) rc = ndev->ops->post_setup (ndev);if (!rc) { - rc =__nci_request (ndev, nci_init_complete_req,0 , -msecs_to_jiffies (NCI_INIT_TIMEOUT )); + rc =nci_request (ndev, nci_init_complete_req,0 , +msecs_to_jiffies (NCI_INIT_TIMEOUT )); }clear_bit (NCI_INIT , &ndev->flags);
@@ -441,19 +442,19 @@ static int nci_open_device(struct nci_dev *ndev) } done: -mutex_unlock (&ndev->req_lock); +mutex_unlock (&ndev->op_lock);return rc; }static int nci_close_device (struct nci_dev *ndev) {nci_req_cancel (ndev,ENODEV ); -mutex_lock (&ndev->req_lock); +mutex_lock (&ndev->op_lock);if (!test_and_clear_bit (NCI_UP , &ndev->flags)) {del_timer_sync (&ndev->cmd_timer);del_timer_sync (&ndev->data_timer); -mutex_unlock (&ndev->req_lock); +mutex_unlock (&ndev->op_lock);return 0 ; }
@@ -470,8 +471,8 @@ static int nci_close_device(struct nci_dev *ndev)atomic_set (&ndev->cmd_cnt,1 );set_bit (NCI_INIT , &ndev->flags); -__nci_request (ndev, nci_reset_req,0 , -msecs_to_jiffies (NCI_RESET_TIMEOUT )); +nci_request (ndev, nci_reset_req,0 , +msecs_to_jiffies (NCI_RESET_TIMEOUT ));/* After this point our queues are empty * and no works are scheduled.
@@ -488,7 +489,7 @@ static int nci_close_device(struct nci_dev *ndev)/* Clear flags */ ndev->flags =0 ; -mutex_unlock (&ndev->req_lock); +mutex_unlock (&ndev->op_lock);return 0 ; }
@@ -1123,6 +1124,7 @@ int nci_register_device(struct nci_dev *ndev) (unsigned long) ndev);mutex_init (&ndev->req_lock); +mutex_init (&ndev->op_lock);INIT_LIST_HEAD (&ndev->conn_info_list); rc =nfc_register_device (ndev->nfc_dev);
Signature · 1 line
1.9.1
PATCH v2 8/9 nfc: nci: Add a parameter to get the new connection id
In reply to Robert Dolcanci_core_conn_create has a new parameter so it can return the id of the new connection. Also now you can't call nci_core_conn_create without waiting for the answer from the previous call.
--- drivers/nfc/st-nci/st-nci_se.c | 2 +- include/net/nfc/nci_core.h | 11 ++++++++--- net/nfc/nci/core.c | 14 ++++++++++---- net/nfc/nci/rsp.c | 6 ++++++ 4 files changed, 25 insertions(+), 8 deletions(-)
drivers/nfc/st-nci/st-nci_se.c +1 -1
@@ -524,7 +524,7 @@ static int st_nci_hci_network_init(struct nci_dev *ndev) r =nci_core_conn_create (ndev,NCI_DESTINATION_NFCEE ,1 ,sizeof (struct core_conn_create_dest_spec_params ) +sizeof (struct dest_spec_params ), - dest_params); + dest_params,NULL );if (r !=NCI_STATUS_OK ) goto free_dest_params;
include/net/nfc/nci_core.h +8 -3
@@ -260,6 +260,11 @@ struct nci_dev {/* Save RF Discovery ID or NFCEE ID under conn_create */ __u8 cur_id; +/* Pointer to the address where the next connection ID +* will be stored */ +__u8 *next_conn_id; +__u8 conn_busy; +/* stored during nci_data_exchange */ struct sk_buff *rx_data_reassembly;
@@ -294,9 +299,9 @@ int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val);int nci_nfcee_discover (struct nci_dev *ndev,u8 action);int nci_nfcee_mode_set (struct nci_dev *ndev,u8 nfcee_id,u8 nfcee_mode);int nci_core_conn_create (struct nci_dev *ndev,u8 destination_type, -u8 number_destination_params, -size_t params_len, -struct core_conn_create_dest_spec_params *params); +u8 number_destination_params,size_t params_len, +struct core_conn_create_dest_spec_params *params, +u8 *conn_id);int nci_core_conn_close (struct nci_dev *ndev,u8 conn_id);struct nci_hci_dev *nci_hci_allocate (struct nci_dev *ndev);
net/nfc/nci/core.c +10 -4
@@ -589,18 +589,22 @@ static void nci_core_conn_create_req(struct nci_dev *ndev, unsigned long opt) }int nci_core_conn_create (struct nci_dev *ndev,u8 destination_type, -u8 number_destination_params, -size_t params_len, -struct core_conn_create_dest_spec_params *params) +u8 number_destination_params,size_t params_len, +struct core_conn_create_dest_spec_params *params, +u8 *conn_id) {int r;struct nci_core_conn_create_cmd *cmd;struct core_conn_create_data data; +mutex_lock (&ndev->req_lock); + data.length = params_len +sizeof (struct nci_core_conn_create_cmd ); cmd =kzalloc (data.length,GFP_KERNEL ); -if (!cmd) +if (!cmd) { +mutex_unlock (&ndev->req_lock);return -ENOMEM ; + } cmd->destination_type = destination_type; cmd->number_destination_params = number_destination_params;
@@ -608,10 +612,12 @@ int nci_core_conn_create(struct nci_dev *ndev, u8 destination_type, data.cmd = cmd; ndev->cur_id = params->value[DEST_SPEC_PARAMS_ID_INDEX ]; + ndev->next_conn_id = conn_id; r =__nci_request (ndev, nci_core_conn_create_req, (unsigned long )&data,msecs_to_jiffies (NCI_CMD_TIMEOUT )); +mutex_unlock (&ndev->req_lock);kfree (cmd);return r; }
net/nfc/nci/rsp.c +6 -0
@@ -244,6 +244,12 @@ static void nci_core_conn_create_rsp_packet(struct nci_dev *ndev, conn_info->id = ndev->cur_id; conn_info->conn_id = rsp->conn_id; +/* Set the conn ID to the address provided by the caller */ +if (ndev->next_conn_id) { + *ndev->next_conn_id = rsp->conn_id; + ndev->next_conn_id =NULL ; + } +/* Note: data_exchange_cb and data_exchange_cb_context need to * be specify out of nci_core_conn_create_rsp_packet */
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 6/9 nfc: nci: Introduce nci_core_cmd
In reply to Robert DolcaThis allows sending core commands from the driver. The driver should be able to send NCI core commands like CORE_GET_CONFIG_CMD.
--- include/net/nfc/nci_core.h | 1 + net/nfc/nci/core.c | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-)
include/net/nfc/nci_core.h +1 -0
@@ -281,6 +281,7 @@ int nci_request(struct nci_dev *ndev, unsigned long opt), unsigned long opt, __u32 timeout);int nci_prop_cmd (struct nci_dev *ndev,__u8 oid,size_t len,__u8 *payload); +int nci_core_cmd (struct nci_dev *ndev,__u16 opcode,size_t len,__u8 *payload);int nci_core_reset (struct nci_dev *ndev);int nci_core_init (struct nci_dev *ndev);
net/nfc/nci/core.c +19 -5
@@ -325,32 +325,46 @@ static void nci_rf_deactivate_req(struct nci_dev *ndev, unsigned long opt) sizeof(struct nci_rf_deactivate_cmd), &cmd); } -struct nci_prop_cmd_param { +struct nci_cmd_param {__u16 opcode;size_t len;__u8 *payload; }; -static void nci_prop_cmd_req (struct nci_dev *ndev,unsigned long opt) +static void nci_generic_req (struct nci_dev *ndev,unsigned long opt) { -struct nci_prop_cmd_param *param = (struct nci_prop_cmd_param *)opt; +struct nci_cmd_param *param = + (struct nci_cmd_param *)opt;nci_send_cmd (ndev, param->opcode, param->len, param->payload); }int nci_prop_cmd (struct nci_dev *ndev,__u8 oid,size_t len,__u8 *payload) { -struct nci_prop_cmd_param param; +struct nci_cmd_param param; param.opcode =nci_opcode_pack (NCI_GID_PROPRIETARY , oid); param.len = len; param.payload = payload; -return __nci_request (ndev, nci_prop_cmd_req, (unsigned long )¶m, +return __nci_request (ndev, nci_generic_req, (unsigned long )¶m,msecs_to_jiffies (NCI_CMD_TIMEOUT )); }EXPORT_SYMBOL (nci_prop_cmd); +int nci_core_cmd (struct nci_dev *ndev,__u16 opcode,size_t len,__u8 *payload) +{ +struct nci_cmd_param param; + + param.opcode = opcode; + param.len = len; + param.payload = payload; + +return __nci_request (ndev, nci_generic_req, (unsigned long )¶m, +msecs_to_jiffies (NCI_CMD_TIMEOUT )); +} +EXPORT_SYMBOL (nci_core_cmd); +int nci_core_reset (struct nci_dev *ndev) { return __nci_request(ndev, nci_reset_req, 0,
Signature · 1 line
1.9.1
PATCH v2 9/9 nfc: Add Intel Fields Peak NFC solution driver
In reply to Robert DolcaFields Peak complies with the ISO/IEC 14443A/B, 15693, 18092, and JIS X 6319-4. It is an NCI based controller.
RF Protocols supported:
- NFC Forum Type 1 Tags (Jewel, Topaz)
- NFC Forum Type 2 Tags (Mifare UL)
- NFC Forum Type 3 Tags (FeliCa)
- NFC Forum Type 4A (ISO/IEC 14443 A-4 106kbps to 848kbps)
- NFC Forum Type 4B (ISO/IEC 14443 B-4 106kbps to 848kbps)
- NFCIP in passive and active modes (ISO/IEC 18092 106kbps to 424kbps)
- B’ (based on ISO/IEC 14443 B-2)
- iCLASS (based on ISO/IEC 15693-2)
- Vicinity cards (ISO/IEC 15693-3)
- Kovio tags (NFC Forum Type 2)
The device can be enumerated using ACPI using the id INT339A. The 1st GPIO is the IRQ and the 2nd is the RESET pin.
--- drivers/nfc/Kconfig | 1 + drivers/nfc/Makefile | 1 + drivers/nfc/fdp/Kconfig | 23 ++ drivers/nfc/fdp/Makefile | 9 + drivers/nfc/fdp/fdp.c | 778 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/nfc/fdp/fdp.h | 52 ++++ drivers/nfc/fdp/i2c.c | 416 +++++++++++++++++++++++++ 7 files changed, 1280 insertions(+) create mode 100644 drivers/nfc/fdp/Kconfig create mode 100644 drivers/nfc/fdp/Makefile create mode 100644 drivers/nfc/fdp/fdp.c create mode 100644 drivers/nfc/fdp/fdp.h create mode 100644 drivers/nfc/fdp/i2c.c
drivers/nfc/Kconfig +1 -0
@@ -68,6 +68,7 @@ config NFC_PORT100 If unsure, say N. +source "drivers/nfc/fdp/Kconfig" source "drivers/nfc/pn544/Kconfig" source "drivers/nfc/microread/Kconfig" source "drivers/nfc/nfcmrvl/Kconfig"
drivers/nfc/Makefile +1 -0
@@ -2,6 +2,7 @@ # Makefile for nfc devices # +obj-$(CONFIG_NFC_FDP) += fdp/ obj-$(CONFIG_NFC_PN544) += pn544/ obj-$(CONFIG_NFC_MICROREAD) += microread/ obj-$(CONFIG_NFC_PN533) += pn533.o
drivers/nfc/fdp/Kconfig new file +23 -0
@@ -0,0 +1,23 @@ +config NFC_FDP + tristate "Intel FDP NFC driver" + depends on NFC_NCI + select CRC_CCITT + default n + ---help--- + Intel Fields Peak NFC controller core driver. + This is a driver based on the NCI NFC kernel layers. + + To compile this driver as a module, choose m here. The module will + be called fdp. + Say N if unsure. + +config NFC_FDP_I2C + tristate "NFC FDP i2c support" + depends on NFC_FDP && I2C + ---help--- + This module adds support for the Intel Fields Peak NFC controller + i2c interface. + Select this if your platform is using the i2c bus. + + If you choose to build a module, it'll be called fdp_i2c. + Say N if unsure.
drivers/nfc/fdp/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# Makefile for FDP NCI based NFC driver +# + +obj-$(CONFIG_NFC_FDP) += fdp.o +obj-$(CONFIG_NFC_FDP_I2C) += fdp_i2c.o + +fdp_i2c-objs = i2c.o +
drivers/nfc/fdp/fdp.c new file +778 -0
778 lines not on this page · raw message
drivers/nfc/fdp/fdp.h new file +52 -0
52 lines not on this page · raw message
drivers/nfc/fdp/i2c.c new file +416 -0
416 lines not on this page · raw message
Signature · 1 line
1.9.1