i2c_drv.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /******************************************************************************
  2. * Copyright (C) 2019-2020 NXP
  3. * *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. ******************************************************************************/
  19. #ifndef _I2C_DRV_H_
  20. #define _I2C_DRV_H_
  21. #include <linux/i2c.h>
  22. /*kept same as dts */
  23. #define NFC_I2C_DRV_STR "nxp,pn544"
  24. #define NFC_I2C_DEV_ID "pn553"
  25. //Interface specific parameters
  26. typedef struct i2c_dev {
  27. struct i2c_client *client;
  28. /*IRQ parameters */
  29. bool irq_enabled;
  30. spinlock_t irq_enabled_lock;
  31. /* NFC_IRQ wake-up state */
  32. bool irq_wake_up;
  33. } i2c_dev_t;
  34. long nfc_i2c_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg);
  35. int nfc_i2c_dev_probe(struct i2c_client *client,
  36. const struct i2c_device_id *id);
  37. int nfc_i2c_dev_remove(struct i2c_client *client);
  38. int nfc_i2c_dev_suspend(struct device *device);
  39. int nfc_i2c_dev_resume(struct device *device);
  40. ssize_t nfc_i2c_dev_read(struct file *filp, char __user *buf, size_t count,
  41. loff_t * offset);
  42. #endif //_I2C_DRV_H_