kxtj9.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2011 Kionix, Inc.
  4. * Written by Chris Hudson <[email protected]>
  5. */
  6. #ifndef __KXTJ9_H__
  7. #define __KXTJ9_H__
  8. #define KXTJ9_I2C_ADDR 0x0F
  9. struct kxtj9_platform_data {
  10. unsigned int min_interval; /* minimum poll interval (in milli-seconds) */
  11. unsigned int init_interval; /* initial poll interval (in milli-seconds) */
  12. /*
  13. * By default, x is axis 0, y is axis 1, z is axis 2; these can be
  14. * changed to account for sensor orientation within the host device.
  15. */
  16. u8 axis_map_x;
  17. u8 axis_map_y;
  18. u8 axis_map_z;
  19. /*
  20. * Each axis can be negated to account for sensor orientation within
  21. * the host device.
  22. */
  23. bool negate_x;
  24. bool negate_y;
  25. bool negate_z;
  26. /* CTRL_REG1: set resolution, g-range, data ready enable */
  27. /* Output resolution: 8-bit valid or 12-bit valid */
  28. #define RES_8BIT 0
  29. #define RES_12BIT (1 << 6)
  30. u8 res_12bit;
  31. /* Output g-range: +/-2g, 4g, or 8g */
  32. #define KXTJ9_G_2G 0
  33. #define KXTJ9_G_4G (1 << 3)
  34. #define KXTJ9_G_8G (1 << 4)
  35. u8 g_range;
  36. int (*init)(void);
  37. void (*exit)(void);
  38. int (*power_on)(void);
  39. int (*power_off)(void);
  40. };
  41. #endif /* __KXTJ9_H__ */