bmi160.h 904 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef BMI160_H_
  3. #define BMI160_H_
  4. #include <linux/iio/iio.h>
  5. #include <linux/regulator/consumer.h>
  6. struct bmi160_data {
  7. struct regmap *regmap;
  8. struct iio_trigger *trig;
  9. struct regulator_bulk_data supplies[2];
  10. struct iio_mount_matrix orientation;
  11. /*
  12. * Ensure natural alignment for timestamp if present.
  13. * Max length needed: 2 * 3 channels + 4 bytes padding + 8 byte ts.
  14. * If fewer channels are enabled, less space may be needed, as
  15. * long as the timestamp is still aligned to 8 bytes.
  16. */
  17. __le16 buf[12] __aligned(8);
  18. };
  19. extern const struct regmap_config bmi160_regmap_config;
  20. int bmi160_core_probe(struct device *dev, struct regmap *regmap,
  21. const char *name, bool use_spi);
  22. int bmi160_enable_irq(struct regmap *regmap, bool enable);
  23. int bmi160_probe_trigger(struct iio_dev *indio_dev, int irq, u32 irq_type);
  24. #endif /* BMI160_H_ */