4 * Copyright (C) 2014, Marvell International Ltd.
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available on the worldwide web at
11 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
13 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
14 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
15 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
16 * this warranty disclaimer.
22 #include <linux/platform_data/nfcmrvl.h>
24 /* Define private flags: */
25 #define NFCMRVL_NCI_RUNNING 1
27 #define NFCMRVL_EXT_COEX_ID 0xE0
28 #define NFCMRVL_NOT_ALLOWED_ID 0xE1
29 #define NFCMRVL_ACTIVE_ID 0xE2
30 #define NFCMRVL_EXT_COEX_ENABLE 1
31 #define NFCMRVL_GPIO_PIN_NFC_NOT_ALLOWED 0xA
32 #define NFCMRVL_GPIO_PIN_NFC_ACTIVE 0xB
33 #define NFCMRVL_NCI_MAX_EVENT_SIZE 260
39 #define NFCMRVL_PB_BAIL_OUT 0x11
45 #define NFCMRVL_HCI_EVENT_HEADER_SIZE 0x04
46 #define NFCMRVL_HCI_EVENT_CODE 0x04
47 #define NFCMRVL_HCI_NFC_EVENT_CODE 0xFF
48 #define NFCMRVL_HCI_COMMAND_CODE 0x01
49 #define NFCMRVL_HCI_OGF 0x81
50 #define NFCMRVL_HCI_OCF 0xFE
58 struct nfcmrvl_private {
62 /* Platform configuration */
63 struct nfcmrvl_platform_data config;
68 ** PHY related information
71 /* PHY driver context */
77 /* Low level driver ops */
78 struct nfcmrvl_if_ops *if_ops;
81 struct nfcmrvl_if_ops {
82 int (*nci_open) (struct nfcmrvl_private *priv);
83 int (*nci_close) (struct nfcmrvl_private *priv);
84 int (*nci_send) (struct nfcmrvl_private *priv, struct sk_buff *skb);
87 void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv);
88 int nfcmrvl_nci_recv_frame(struct nfcmrvl_private *priv, struct sk_buff *skb);
89 struct nfcmrvl_private *nfcmrvl_nci_register_dev(void *drv_data,
90 struct nfcmrvl_if_ops *ops,
92 struct nfcmrvl_platform_data *pdata);
95 void nfcmrvl_chip_reset(struct nfcmrvl_private *priv);
97 int nfcmrvl_parse_dt(struct device_node *node,
98 struct nfcmrvl_platform_data *pdata);