ad714x.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * AD714X CapTouch Programmable Controller driver (bus interfaces)
  4. *
  5. * Copyright 2009-2011 Analog Devices Inc.
  6. */
  7. #ifndef _AD714X_H_
  8. #define _AD714X_H_
  9. #include <linux/pm.h>
  10. #include <linux/types.h>
  11. #define STAGE_NUM 12
  12. struct device;
  13. struct ad714x_platform_data;
  14. struct ad714x_driver_data;
  15. struct ad714x_chip;
  16. typedef int (*ad714x_read_t)(struct ad714x_chip *, unsigned short, unsigned short *, size_t);
  17. typedef int (*ad714x_write_t)(struct ad714x_chip *, unsigned short, unsigned short);
  18. struct ad714x_chip {
  19. unsigned short l_state;
  20. unsigned short h_state;
  21. unsigned short c_state;
  22. unsigned short adc_reg[STAGE_NUM];
  23. unsigned short amb_reg[STAGE_NUM];
  24. unsigned short sensor_val[STAGE_NUM];
  25. struct ad714x_platform_data *hw;
  26. struct ad714x_driver_data *sw;
  27. int irq;
  28. struct device *dev;
  29. ad714x_read_t read;
  30. ad714x_write_t write;
  31. struct mutex mutex;
  32. unsigned product;
  33. unsigned version;
  34. __be16 xfer_buf[16] ____cacheline_aligned;
  35. };
  36. extern const struct dev_pm_ops ad714x_pm;
  37. struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
  38. ad714x_read_t read, ad714x_write_t write);
  39. #endif