i2c_drv.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /******************************************************************************
  2. * Copyright (C) 2015, The Linux Foundation. All rights reserved.
  3. * Copyright (C) 2019-2021 NXP
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. ******************************************************************************/
  20. #ifndef _I2C_DRV_H_
  21. #define _I2C_DRV_H_
  22. #include <linux/i2c.h>
  23. /* kept same as dts */
  24. #define NFC_I2C_DRV_STR "pn547"
  25. #define NFC_I2C_DEV_ID "pn547"
  26. /* Interface specific parameters */
  27. struct i2c_dev {
  28. struct i2c_client *client;
  29. /* IRQ parameters */
  30. bool irq_enabled;
  31. spinlock_t irq_enabled_lock;
  32. /* NFC_IRQ wake-up state */
  33. bool irq_wake_up;
  34. };
  35. long nfc_i2c_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg);
  36. #if (KERNEL_VERSION(6, 3, 0) <= LINUX_VERSION_CODE)
  37. int nfc_i2c_dev_probe(struct i2c_client *client);
  38. #else
  39. int nfc_i2c_dev_probe(struct i2c_client *client,
  40. const struct i2c_device_id *id);
  41. #endif
  42. #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
  43. int nfc_i2c_dev_remove(struct i2c_client *client);
  44. #else
  45. void nfc_i2c_dev_remove(struct i2c_client *client);
  46. #endif
  47. int nfc_i2c_dev_suspend(struct device *device);
  48. int nfc_i2c_dev_resume(struct device *device);
  49. #ifdef CONFIG_CLK_ACPM_INIT
  50. extern acpm_init_eint_nfc_clk_req(u32 eint_num);
  51. #endif
  52. #endif /* _I2C_DRV_H_ */