Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 367bf999 authored by Tapas Dey's avatar Tapas Dey
Browse files

NFC: Add snapshot of NQxxx NFC driver



Add the latest version of NQxxx NFC driver from 'msm-4.14
commit b66d738d0f19 ("NFC: Fix for nq-nci dev node recovery")'.

Change-Id: I32a86cb682a8f1a17de6be6ed9fbbf2ff7bcef47
Signed-off-by: default avatarTapas Dey <tdey@codeaurora.org>
parent ea7266aa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -59,3 +59,11 @@ source "drivers/nfc/nxp-nci/Kconfig"
source "drivers/nfc/s3fwrn5/Kconfig"
source "drivers/nfc/st95hf/Kconfig"
endmenu

config NFC_NQ
        tristate "QTI NCI based NFC Controller Driver for NQx"
        depends on I2C
        help
          This enables the NFC driver for NQx based devices.
          This is for i2c connected version. NCI protocol logic
          resides in the usermode and it has no other NFC dependencies.
+1 −0
Original line number Diff line number Diff line
@@ -17,3 +17,4 @@ obj-$(CONFIG_NFC_ST_NCI) += st-nci/
obj-$(CONFIG_NFC_NXP_NCI)	+= nxp-nci/
obj-$(CONFIG_NFC_S3FWRN5)	+= s3fwrn5/
obj-$(CONFIG_NFC_ST95HF)	+= st95hf/
obj-$(CONFIG_NFC_NQ)            += nq-nci.o

drivers/nfc/nq-nci.c

0 → 100644
+1425 −0

File added.

Preview size limit exceeded, changes collapsed.

drivers/nfc/nq-nci.h

0 → 100644
+47 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 */

#ifndef __NQ_NCI_H
#define __NQ_NCI_H

#include <linux/i2c.h>
#include <linux/types.h>
#include <linux/version.h>

#include <linux/semaphore.h>
#include <linux/completion.h>

#include <linux/ioctl.h>
#include <linux/cdev.h>
#include <linux/nfcinfo.h>

#define NFC_SET_PWR			_IOW(0xE9, 0x01, unsigned int)
#define ESE_SET_PWR			_IOW(0xE9, 0x02, unsigned int)
#define ESE_GET_PWR			_IOR(0xE9, 0x03, unsigned int)
#define SET_RX_BLOCK			_IOW(0xE9, 0x04, unsigned int)
#define SET_EMULATOR_TEST_POINT		_IOW(0xE9, 0x05, unsigned int)
#define NFCC_INITIAL_CORE_RESET_NTF	_IOW(0xE9, 0x10, unsigned int)

#define NFC_RX_BUFFER_CNT_START		(0x0)
#define PAYLOAD_HEADER_LENGTH		(0x3)
#define PAYLOAD_LENGTH_MAX		(256)
#define BYTE				(0x8)
#define NCI_IDENTIFIER			(0x10)

enum nfcc_initial_core_reset_ntf {
	TIMEDOUT_INITIAL_CORE_RESET_NTF = 0, /* 0*/
	ARRIVED_INITIAL_CORE_RESET_NTF, /* 1 */
	DEFAULT_INITIAL_CORE_RESET_NTF, /*2*/
};

enum nfcc_chip_variant {
	NFCC_NQ_210			= 0x48,	/**< NFCC NQ210 */
	NFCC_NQ_220			= 0x58,	/**< NFCC NQ220 */
	NFCC_NQ_310			= 0x40,	/**< NFCC NQ310 */
	NFCC_NQ_330			= 0x51,	/**< NFCC NQ330 */
	NFCC_PN66T			= 0x18,	/**< NFCC PN66T */
	NFCC_NOT_SUPPORTED	        = 0xFF	/**< NFCC is not supported */
};
#endif
+11 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 */

#ifndef _NFCINFO_H
#define _NFCINFO_H

#include <uapi/linux/nfc/nfcinfo.h>

#endif
Loading