lis3lv02d.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __LIS3LV02D_H_
  2. #define __LIS3LV02D_H_
  3. struct lis3lv02d_platform_data {
  4. /* please note: the 'click' feature is only supported for
  5. * LIS[32]02DL variants of the chip and will be ignored for
  6. * others */
  7. #define LIS3_CLICK_SINGLE_X (1 << 0)
  8. #define LIS3_CLICK_DOUBLE_X (1 << 1)
  9. #define LIS3_CLICK_SINGLE_Y (1 << 2)
  10. #define LIS3_CLICK_DOUBLE_Y (1 << 3)
  11. #define LIS3_CLICK_SINGLE_Z (1 << 4)
  12. #define LIS3_CLICK_DOUBLE_Z (1 << 5)
  13. unsigned char click_flags;
  14. unsigned char click_thresh_x;
  15. unsigned char click_thresh_y;
  16. unsigned char click_thresh_z;
  17. unsigned char click_time_limit;
  18. unsigned char click_latency;
  19. unsigned char click_window;
  20. #define LIS3_IRQ1_DISABLE (0 << 0)
  21. #define LIS3_IRQ1_FF_WU_1 (1 << 0)
  22. #define LIS3_IRQ1_FF_WU_2 (2 << 0)
  23. #define LIS3_IRQ1_FF_WU_12 (3 << 0)
  24. #define LIS3_IRQ1_DATA_READY (4 << 0)
  25. #define LIS3_IRQ1_CLICK (7 << 0)
  26. #define LIS3_IRQ2_DISABLE (0 << 3)
  27. #define LIS3_IRQ2_FF_WU_1 (1 << 3)
  28. #define LIS3_IRQ2_FF_WU_2 (2 << 3)
  29. #define LIS3_IRQ2_FF_WU_12 (3 << 3)
  30. #define LIS3_IRQ2_DATA_READY (4 << 3)
  31. #define LIS3_IRQ2_CLICK (7 << 3)
  32. #define LIS3_IRQ_OPEN_DRAIN (1 << 6)
  33. #define LIS3_IRQ_ACTIVE_LOW (1 << 7)
  34. unsigned char irq_cfg;
  35. #define LIS3_WAKEUP_X_LO (1 << 0)
  36. #define LIS3_WAKEUP_X_HI (1 << 1)
  37. #define LIS3_WAKEUP_Y_LO (1 << 2)
  38. #define LIS3_WAKEUP_Y_HI (1 << 3)
  39. #define LIS3_WAKEUP_Z_LO (1 << 4)
  40. #define LIS3_WAKEUP_Z_HI (1 << 5)
  41. unsigned char wakeup_flags;
  42. unsigned char wakeup_thresh;
  43. #define LIS3_NO_MAP 0
  44. #define LIS3_DEV_X 1
  45. #define LIS3_DEV_Y 2
  46. #define LIS3_DEV_Z 3
  47. #define LIS3_INV_DEV_X -1
  48. #define LIS3_INV_DEV_Y -2
  49. #define LIS3_INV_DEV_Z -3
  50. s8 axis_x;
  51. s8 axis_y;
  52. s8 axis_z;
  53. int (*setup_resources)(void);
  54. int (*release_resources)(void);
  55. };
  56. #endif /* __LIS3LV02D_H_ */