k3dh.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * STMicroelectronics k3dh acceleration sensor driver
  3. *
  4. * Copyright (C) 2010 Samsung Electronics Co.Ltd
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #ifndef __K3DH_ACC_HEADER__
  17. #define __K3DH__ACC_HEADER__
  18. #include <linux/types.h>
  19. #include <linux/ioctl.h>
  20. extern struct class *sec_class;
  21. struct k3dh_acceldata {
  22. __s16 x;
  23. __s16 y;
  24. __s16 z;
  25. };
  26. struct accel_platform_data_k2dh {
  27. int (*accel_get_position) (void);
  28. bool i2c_pull_up;
  29. int gpio_int;
  30. u32 irq_gpio_flags;
  31. int gpio_sda;
  32. u32 sda_gpio_flags;
  33. int gpio_scl;
  34. u32 scl_gpio_flags;
  35. const u8 *str_l19;
  36. const u8 *str_lvs1;
  37. /* Change axis or not for user-level
  38. * If it is true, driver reports adjusted axis-raw-data
  39. * to user-space based on accel_get_position() value,
  40. * or if it is false, driver reports original axis-raw-data */
  41. bool axis_adjust;
  42. };
  43. /* dev info */
  44. #define ACC_DEV_NAME "accelerometer"
  45. /* k3dh ioctl command label */
  46. #define K3DH_IOCTL_BASE 'a'
  47. #define K3DH_IOCTL_SET_DELAY _IOW(K3DH_IOCTL_BASE, 0, int64_t)
  48. #define K3DH_IOCTL_GET_DELAY _IOR(K3DH_IOCTL_BASE, 1, int64_t)
  49. #define K3DH_IOCTL_READ_ACCEL_XYZ _IOR(K3DH_IOCTL_BASE, 8, \
  50. struct k3dh_acceldata)
  51. #define K3DH_IOCTL_SET_ENABLE _IOW(K3DH_IOCTL_BASE, 9, int)
  52. #endif