st_uvis25.h 885 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * STMicroelectronics uvis25 sensor driver
  3. *
  4. * Copyright 2017 STMicroelectronics Inc.
  5. *
  6. * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
  7. *
  8. * Licensed under the GPL-2.
  9. */
  10. #ifndef ST_UVIS25_H
  11. #define ST_UVIS25_H
  12. #define ST_UVIS25_DEV_NAME "uvis25"
  13. #include <linux/iio/iio.h>
  14. /**
  15. * struct st_uvis25_hw - ST UVIS25 sensor instance
  16. * @regmap: Register map of the device.
  17. * @trig: The trigger in use by the driver.
  18. * @enabled: Status of the sensor (false->off, true->on).
  19. * @irq: Device interrupt line (I2C or SPI).
  20. */
  21. struct st_uvis25_hw {
  22. struct regmap *regmap;
  23. struct iio_trigger *trig;
  24. bool enabled;
  25. int irq;
  26. /* Ensure timestamp is naturally aligned */
  27. struct {
  28. u8 chan;
  29. s64 ts __aligned(8);
  30. } scan;
  31. };
  32. extern const struct dev_pm_ops st_uvis25_pm_ops;
  33. int st_uvis25_probe(struct device *dev, int irq, struct regmap *regmap);
  34. #endif /* ST_UVIS25_H */