diff options
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/nfc/nci_core.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 1009d3dcb316..3b05bebd8235 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | * NFC Controller (NFCC) and a Device Host (DH). | 3 | * NFC Controller (NFCC) and a Device Host (DH). |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2011 Texas Instruments, Inc. | 5 | * Copyright (C) 2011 Texas Instruments, Inc. |
| 6 | * Copyright (C) 2013 Intel Corporation. All rights reserved. | ||
| 6 | * | 7 | * |
| 7 | * Written by Ilan Elias <ilane@ti.com> | 8 | * Written by Ilan Elias <ilane@ti.com> |
| 8 | * | 9 | * |
| @@ -202,4 +203,52 @@ void nci_req_complete(struct nci_dev *ndev, int result); | |||
| 202 | /* ----- NCI status code ----- */ | 203 | /* ----- NCI status code ----- */ |
| 203 | int nci_to_errno(__u8 code); | 204 | int nci_to_errno(__u8 code); |
| 204 | 205 | ||
| 206 | /* ----- NCI over SPI acknowledge modes ----- */ | ||
| 207 | #define NCI_SPI_CRC_DISABLED 0x00 | ||
| 208 | #define NCI_SPI_CRC_ENABLED 0x01 | ||
| 209 | |||
| 210 | /* ----- NCI SPI structures ----- */ | ||
| 211 | struct nci_spi_dev; | ||
| 212 | |||
| 213 | struct nci_spi_ops { | ||
| 214 | int (*open)(struct nci_spi_dev *ndev); | ||
| 215 | int (*close)(struct nci_spi_dev *ndev); | ||
| 216 | void (*assert_int)(struct nci_spi_dev *ndev); | ||
| 217 | void (*deassert_int)(struct nci_spi_dev *ndev); | ||
| 218 | }; | ||
| 219 | |||
| 220 | struct nci_spi_dev { | ||
| 221 | struct nci_dev *nci_dev; | ||
| 222 | struct spi_device *spi; | ||
| 223 | struct nci_spi_ops *ops; | ||
| 224 | |||
| 225 | unsigned int xfer_udelay; /* microseconds delay between | ||
| 226 | transactions */ | ||
| 227 | u8 acknowledge_mode; | ||
| 228 | |||
| 229 | void *driver_data; | ||
| 230 | }; | ||
| 231 | |||
| 232 | /* ----- NCI SPI Devices ----- */ | ||
| 233 | struct nci_spi_dev *nci_spi_allocate_device(struct spi_device *spi, | ||
| 234 | struct nci_spi_ops *ops, | ||
| 235 | u32 supported_protocols, | ||
| 236 | u32 supported_se, | ||
| 237 | u8 acknowledge_mode, | ||
| 238 | unsigned int delay); | ||
| 239 | void nci_spi_free_device(struct nci_spi_dev *ndev); | ||
| 240 | int nci_spi_register_device(struct nci_spi_dev *ndev); | ||
| 241 | void nci_spi_unregister_device(struct nci_spi_dev *ndev); | ||
| 242 | |||
| 243 | static inline void nci_spi_set_drvdata(struct nci_spi_dev *ndev, | ||
| 244 | void *data) | ||
| 245 | { | ||
| 246 | ndev->driver_data = data; | ||
| 247 | } | ||
| 248 | |||
| 249 | static inline void *nci_spi_get_drvdata(struct nci_spi_dev *ndev) | ||
| 250 | { | ||
| 251 | return ndev->driver_data; | ||
| 252 | } | ||
| 253 | |||
| 205 | #endif /* __NCI_CORE_H */ | 254 | #endif /* __NCI_CORE_H */ |
