Bhuvan Varshney | 8e2ca88 | 2019-09-09 19:20:37 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved. |
Gaurav Singhal | c53bc29 | 2017-02-16 16:35:39 +0530 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __NQ_NCI_H |
| 14 | #define __NQ_NCI_H |
| 15 | |
| 16 | #include <linux/i2c.h> |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/version.h> |
| 19 | |
| 20 | #include <linux/semaphore.h> |
| 21 | #include <linux/completion.h> |
| 22 | |
| 23 | #include <linux/ioctl.h> |
| 24 | #include <linux/miscdevice.h> |
| 25 | #include <linux/nfcinfo.h> |
| 26 | |
| 27 | #define NFC_SET_PWR _IOW(0xE9, 0x01, unsigned int) |
| 28 | #define ESE_SET_PWR _IOW(0xE9, 0x02, unsigned int) |
| 29 | #define ESE_GET_PWR _IOR(0xE9, 0x03, unsigned int) |
| 30 | #define SET_RX_BLOCK _IOW(0xE9, 0x04, unsigned int) |
| 31 | #define SET_EMULATOR_TEST_POINT _IOW(0xE9, 0x05, unsigned int) |
| 32 | #define NFCC_INITIAL_CORE_RESET_NTF _IOW(0xE9, 0x10, unsigned int) |
| 33 | |
| 34 | #define NFC_RX_BUFFER_CNT_START (0x0) |
| 35 | #define PAYLOAD_HEADER_LENGTH (0x3) |
| 36 | #define PAYLOAD_LENGTH_MAX (256) |
| 37 | #define BYTE (0x8) |
| 38 | #define NCI_IDENTIFIER (0x10) |
| 39 | |
| 40 | enum nfcc_initial_core_reset_ntf { |
| 41 | TIMEDOUT_INITIAL_CORE_RESET_NTF = 0, /* 0*/ |
| 42 | ARRIVED_INITIAL_CORE_RESET_NTF, /* 1 */ |
| 43 | DEFAULT_INITIAL_CORE_RESET_NTF, /*2*/ |
| 44 | }; |
| 45 | |
| 46 | enum nfcc_chip_variant { |
| 47 | NFCC_NQ_210 = 0x48, /**< NFCC NQ210 */ |
| 48 | NFCC_NQ_220 = 0x58, /**< NFCC NQ220 */ |
| 49 | NFCC_NQ_310 = 0x40, /**< NFCC NQ310 */ |
| 50 | NFCC_NQ_330 = 0x51, /**< NFCC NQ330 */ |
Bhuvan Varshney | 8e2ca88 | 2019-09-09 19:20:37 +0530 | [diff] [blame] | 51 | NFCC_SN100_A = 0xa3, /**< NFCC SN100_A */ |
| 52 | NFCC_SN100_B = 0xa4, /**< NFCC SN100_B */ |
Gaurav Singhal | c53bc29 | 2017-02-16 16:35:39 +0530 | [diff] [blame] | 53 | NFCC_PN66T = 0x18, /**< NFCC PN66T */ |
| 54 | NFCC_NOT_SUPPORTED = 0xFF /**< NFCC is not supported */ |
| 55 | }; |
| 56 | #endif |