nci.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * NCI based driver for Samsung S3FWRN5 NFC chip
  3. *
  4. * Copyright (C) 2015 Samsung Electrnoics
  5. * Robert Baldyga <r.baldyga@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2 or later, as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __LOCAL_S3FWRN5_NCI_H_
  20. #define __LOCAL_S3FWRN5_NCI_H_
  21. #include "s3fwrn5.h"
  22. #define NCI_PROP_AGAIN 0x01
  23. #define NCI_PROP_GET_RFREG 0x21
  24. #define NCI_PROP_SET_RFREG 0x22
  25. struct nci_prop_set_rfreg_cmd {
  26. __u8 index;
  27. __u8 data[252];
  28. };
  29. struct nci_prop_set_rfreg_rsp {
  30. __u8 status;
  31. };
  32. #define NCI_PROP_GET_RFREG_VER 0x24
  33. struct nci_prop_get_rfreg_ver_rsp {
  34. __u8 status;
  35. __u8 data[8];
  36. };
  37. #define NCI_PROP_SET_RFREG_VER 0x25
  38. struct nci_prop_set_rfreg_ver_cmd {
  39. __u8 data[8];
  40. };
  41. struct nci_prop_set_rfreg_ver_rsp {
  42. __u8 status;
  43. };
  44. #define NCI_PROP_START_RFREG 0x26
  45. struct nci_prop_start_rfreg_rsp {
  46. __u8 status;
  47. };
  48. #define NCI_PROP_STOP_RFREG 0x27
  49. struct nci_prop_stop_rfreg_cmd {
  50. __u16 checksum;
  51. };
  52. struct nci_prop_stop_rfreg_rsp {
  53. __u8 status;
  54. };
  55. #define NCI_PROP_FW_CFG 0x28
  56. struct nci_prop_fw_cfg_cmd {
  57. __u8 clk_type;
  58. __u8 clk_speed;
  59. __u8 clk_req;
  60. };
  61. struct nci_prop_fw_cfg_rsp {
  62. __u8 status;
  63. };
  64. #define NCI_PROP_WR_RESET 0x2f
  65. void s3fwrn5_nci_get_prop_ops(struct nci_driver_ops **ops, size_t *n);
  66. int s3fwrn5_nci_rf_configure(struct s3fwrn5_info *info, const char *fw_name);
  67. #endif /* __LOCAL_S3FWRN5_NCI_H_ */