123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef _I2C_DRV_H_
- #define _I2C_DRV_H_
- #include <linux/i2c.h>
- #include <linux/version.h>
- #define NFC_I2C_DRV_STR "qcom,sn-nci"
- #define NFC_I2C_DEV_ID "sn-i2c"
- struct nfc_dev;
- struct i2c_dev {
- struct i2c_client *client;
-
- bool irq_enabled;
- spinlock_t irq_enabled_lock;
-
- bool irq_wake_up;
- };
- long nfc_i2c_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg);
- int nfc_i2c_dev_probe(struct i2c_client *client,
- const struct i2c_device_id *id);
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
- void nfc_i2c_dev_remove(struct i2c_client *client);
- #else
- int nfc_i2c_dev_remove(struct i2c_client *client);
- #endif
- int nfc_i2c_dev_suspend(struct device *device);
- int nfc_i2c_dev_resume(struct device *device);
- #if IS_ENABLED(CONFIG_NXP_NFC_I2C)
- int i2c_enable_irq(struct nfc_dev *dev);
- int i2c_disable_irq(struct nfc_dev *dev);
- int i2c_write(struct nfc_dev *dev, const char *buf, size_t count,
- int max_retry_cnt);
- int i2c_read(struct nfc_dev *dev, char *buf, size_t count, int timeout);
- #endif
- #endif
|