1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Copyright (C) 2014-2015, Marvell International Ltd.
11 #include <linux/platform_data/nfcmrvl.h>
15 /* Define private flags: */
16 #define NFCMRVL_NCI_RUNNING 1
17 #define NFCMRVL_PHY_ERROR 2
19 #define NFCMRVL_EXT_COEX_ID 0xE0
20 #define NFCMRVL_NOT_ALLOWED_ID 0xE1
21 #define NFCMRVL_ACTIVE_ID 0xE2
22 #define NFCMRVL_EXT_COEX_ENABLE 1
23 #define NFCMRVL_GPIO_PIN_NFC_NOT_ALLOWED 0xA
24 #define NFCMRVL_GPIO_PIN_NFC_ACTIVE 0xB
25 #define NFCMRVL_NCI_MAX_EVENT_SIZE 260
31 #define NFCMRVL_PB_BAIL_OUT 0x11
32 #define NFCMRVL_PROP_REF_CLOCK 0xF0
33 #define NFCMRVL_PROP_SET_HI_CONFIG 0xF1
39 #define NFCMRVL_HCI_EVENT_HEADER_SIZE 0x04
40 #define NFCMRVL_HCI_EVENT_CODE 0x04
41 #define NFCMRVL_HCI_NFC_EVENT_CODE 0xFF
42 #define NFCMRVL_HCI_COMMAND_CODE 0x01
43 #define NFCMRVL_HCI_OGF 0x81
44 #define NFCMRVL_HCI_OCF 0xFE
53 struct nfcmrvl_private {
57 /* Platform configuration */
58 struct nfcmrvl_platform_data config;
63 /* FW download context */
64 struct nfcmrvl_fw_dnld fw_dnld;
66 /* FW download support */
70 * PHY related information
73 /* PHY driver context */
79 /* Low level driver ops */
80 const struct nfcmrvl_if_ops *if_ops;
83 struct nfcmrvl_if_ops {
84 int (*nci_open) (struct nfcmrvl_private *priv);
85 int (*nci_close) (struct nfcmrvl_private *priv);
86 int (*nci_send) (struct nfcmrvl_private *priv, struct sk_buff *skb);
87 void (*nci_update_config)(struct nfcmrvl_private *priv,
91 void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv);
92 int nfcmrvl_nci_recv_frame(struct nfcmrvl_private *priv, struct sk_buff *skb);
93 struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy,
95 const struct nfcmrvl_if_ops *ops,
97 const struct nfcmrvl_platform_data *pdata);
100 void nfcmrvl_chip_reset(struct nfcmrvl_private *priv);
101 void nfcmrvl_chip_halt(struct nfcmrvl_private *priv);
103 int nfcmrvl_parse_dt(struct device_node *node,
104 struct nfcmrvl_platform_data *pdata);