bma150.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (c) 2011 Bosch Sensortec GmbH
  4. * Copyright (c) 2011 Unixphere
  5. */
  6. #ifndef _BMA150_H_
  7. #define _BMA150_H_
  8. #define BMA150_DRIVER "bma150"
  9. #define BMA150_RANGE_2G 0
  10. #define BMA150_RANGE_4G 1
  11. #define BMA150_RANGE_8G 2
  12. #define BMA150_BW_25HZ 0
  13. #define BMA150_BW_50HZ 1
  14. #define BMA150_BW_100HZ 2
  15. #define BMA150_BW_190HZ 3
  16. #define BMA150_BW_375HZ 4
  17. #define BMA150_BW_750HZ 5
  18. #define BMA150_BW_1500HZ 6
  19. struct bma150_cfg {
  20. bool any_motion_int; /* Set to enable any-motion interrupt */
  21. bool hg_int; /* Set to enable high-G interrupt */
  22. bool lg_int; /* Set to enable low-G interrupt */
  23. unsigned char any_motion_dur; /* Any-motion duration */
  24. unsigned char any_motion_thres; /* Any-motion threshold */
  25. unsigned char hg_hyst; /* High-G hysterisis */
  26. unsigned char hg_dur; /* High-G duration */
  27. unsigned char hg_thres; /* High-G threshold */
  28. unsigned char lg_hyst; /* Low-G hysterisis */
  29. unsigned char lg_dur; /* Low-G duration */
  30. unsigned char lg_thres; /* Low-G threshold */
  31. unsigned char range; /* one of BMA0150_RANGE_xxx */
  32. unsigned char bandwidth; /* one of BMA0150_BW_xxx */
  33. };
  34. struct bma150_platform_data {
  35. struct bma150_cfg cfg;
  36. int (*irq_gpio_cfg)(void);
  37. };
  38. #endif /* _BMA150_H_ */