blob: d17897db7babb42a8412a2c0b114d32767c47ecb [file] [log] [blame]
Bhuvan Varshney8e2ca882019-09-09 19:20:37 +05301/* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
Gaurav Singhalc53bc292017-02-16 16:35:39 +05302 *
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
40enum 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
46enum 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 Varshney8e2ca882019-09-09 19:20:37 +053051 NFCC_SN100_A = 0xa3, /**< NFCC SN100_A */
52 NFCC_SN100_B = 0xa4, /**< NFCC SN100_B */
Gaurav Singhalc53bc292017-02-16 16:35:39 +053053 NFCC_PN66T = 0x18, /**< NFCC PN66T */
54 NFCC_NOT_SUPPORTED = 0xFF /**< NFCC is not supported */
55};
56#endif