nq-nci.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
  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. #ifndef __NQ_NCI_H
  13. #define __NQ_NCI_H
  14. #include <linux/i2c.h>
  15. #include <linux/types.h>
  16. #include <linux/version.h>
  17. #include <linux/semaphore.h>
  18. #include <linux/completion.h>
  19. #include <linux/ioctl.h>
  20. #include <linux/miscdevice.h>
  21. #include <linux/nfcinfo.h>
  22. #define NFC_SET_PWR _IOW(0xE9, 0x01, unsigned int)
  23. #define ESE_SET_PWR _IOW(0xE9, 0x02, unsigned int)
  24. #define ESE_GET_PWR _IOR(0xE9, 0x03, unsigned int)
  25. #define SET_RX_BLOCK _IOW(0xE9, 0x04, unsigned int)
  26. #define SET_EMULATOR_TEST_POINT _IOW(0xE9, 0x05, unsigned int)
  27. #define NFCC_INITIAL_CORE_RESET_NTF _IOW(0xE9, 0x10, unsigned int)
  28. #define ESE_CLEAR_GPIO _IOW(0xE9, 0x11, unsigned int)
  29. #define NFC_RX_BUFFER_CNT_START (0x0)
  30. #define PAYLOAD_HEADER_LENGTH (0x3)
  31. #define PAYLOAD_LENGTH_MAX (256)
  32. #define BYTE (0x8)
  33. #define NCI_IDENTIFIER (0x10)
  34. enum nfcc_initial_core_reset_ntf {
  35. TIMEDOUT_INITIAL_CORE_RESET_NTF = 0, /* 0*/
  36. ARRIVED_INITIAL_CORE_RESET_NTF, /* 1 */
  37. DEFAULT_INITIAL_CORE_RESET_NTF, /*2*/
  38. };
  39. enum nfcc_chip_variant {
  40. NFCC_NQ_210 = 0x48, /**< NFCC NQ210 */
  41. NFCC_NQ_220 = 0x58, /**< NFCC NQ220 */
  42. NFCC_NQ_310 = 0x40, /**< NFCC NQ310 */
  43. NFCC_NQ_330 = 0x51, /**< NFCC NQ330 */
  44. NFCC_PN66T = 0x18, /**< NFCC PN66T */
  45. NFCC_NOT_SUPPORTED = 0xFF /**< NFCC is not supported */
  46. };
  47. struct nqx_dev;
  48. int nqx_claim_ese(struct nqx_dev *nqx_dev, bool claim);
  49. int nqx_ese_pwr(struct nqx_dev *nqx_dev, unsigned long int arg);
  50. #endif