diff --git a/define_modules.bzl b/define_modules.bzl index a4070f155d..609f5d4eb3 100644 --- a/define_modules.bzl +++ b/define_modules.bzl @@ -17,7 +17,8 @@ def define_modules(target, variant): "nfc/ese_cold_reset.h", "nfc/i2c_drv.h" ], - hdrs = ["include/uapi/linux/nfc/nfcinfo.h"], + hdrs = ["include/uapi/linux/nfc/nfcinfo.h", + "include/uapi/linux/nfc/sn_uapi.h"], includes = [".", "linux", "nfc", "include/uapi/linux/nfc"], deps = ["//msm-kernel:all_headers", "//vendor/qcom/opensource/securemsm-kernel:smcinvoke_kernel_headers", diff --git a/include/uapi/linux/nfc/sn_uapi.h b/include/uapi/linux/nfc/sn_uapi.h new file mode 100644 index 0000000000..f89812e8b6 --- /dev/null +++ b/include/uapi/linux/nfc/sn_uapi.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ +/****************************************************************************** + * Copyright (C) 2015, The Linux Foundation. All rights reserved. + * Copyright (C) 2019-2022 NXP + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + ******************************************************************************/ +/* + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + ****************************************************************************/ + +#ifndef _UAPI_SN_UAPI_H_ +#define _UAPI_SN_UAPI_H_ + +#include + +/* Ioctls + * The type should be aligned with MW HAL definitions + */ + +#define NFC_MAGIC (0xE9) + +#define NFC_SET_PWR _IOW(NFC_MAGIC, 0x01, uint32_t) +#define ESE_SET_PWR _IOW(NFC_MAGIC, 0x02, uint32_t) +#define ESE_GET_PWR _IOR(NFC_MAGIC, 0x03, uint32_t) +#define NFC_SET_RESET_READ_PENDING _IOW(NFC_MAGIC, 0x04, uint32_t) +#define NFC_GET_GPIO_STATUS _IOR(NFC_MAGIC, 0x05, uint32_t) +#define NFC_SECURE_ZONE _IOW(NFC_MAGIC, 0x0A, uint32_t) + +#endif diff --git a/nfc/common.c b/nfc/common.c index 8c5ed3bf00..a2306f7e82 100644 --- a/nfc/common.c +++ b/nfc/common.c @@ -18,7 +18,7 @@ * ******************************************************************************/ /* - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * *****************************************************************************/ #include diff --git a/nfc/common.h b/nfc/common.h index 7b2098a433..065e4f08f1 100644 --- a/nfc/common.h +++ b/nfc/common.h @@ -18,8 +18,7 @@ * ******************************************************************************/ /* - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. - * + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. *****************************************************************************/ #ifndef _COMMON_H_ #define _COMMON_H_ @@ -30,6 +29,7 @@ #include #include #include +#include #include "i2c_drv.h" #include "ese_cold_reset.h" @@ -98,19 +98,6 @@ #define WRITE_RETRY_WAIT_TIME_US (3000) /* Time to wait before retrying read for some specific usecases */ #define READ_RETRY_WAIT_TIME_US (3500) -#define NFC_MAGIC (0xE9) - -// Ioctls -// The type should be aligned with MW HAL definitions - -#define NFC_SET_PWR _IOW(NFC_MAGIC, 0x01, uint32_t) -#define ESE_SET_PWR _IOW(NFC_MAGIC, 0x02, uint32_t) -#define ESE_GET_PWR _IOR(NFC_MAGIC, 0x03, uint32_t) -#define NFC_SET_RESET_READ_PENDING _IOW(NFC_MAGIC, 0x04, uint32_t) -#define NFC_GET_GPIO_STATUS _IOR(NFC_MAGIC, 0x05, uint32_t) -#ifdef NFC_SECURE_PERIPHERAL_ENABLED -#define NFC_SECURE_ZONE _IOW(NFC_MAGIC, 0x0A, uint32_t) -#endif #define DTS_IRQ_GPIO_STR "qcom,sn-irq" #define DTS_VEN_GPIO_STR "qcom,sn-ven" diff --git a/nfc/ese_cold_reset.c b/nfc/ese_cold_reset.c index 420563ead4..0359d5459e 100644 --- a/nfc/ese_cold_reset.c +++ b/nfc/ese_cold_reset.c @@ -4,7 +4,7 @@ * ***************************************************************************/ /* - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * ***************************************************************************/ diff --git a/nfc/i2c_drv.c b/nfc/i2c_drv.c index 3300861c01..9acd14aed9 100644 --- a/nfc/i2c_drv.c +++ b/nfc/i2c_drv.c @@ -35,7 +35,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ****************************************************************************/ /* - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * ****************************************************************************/