gp2ap030.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2012 SAMSUNG
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  17. * MA 02110-1301, USA.
  18. */
  19. #ifndef __GP2A030_H__
  20. #define __GP2A030_H__
  21. #define I2C_M_WR 0 /* for i2c Write */
  22. #define I2c_M_RD 1 /* for i2c Read */
  23. #define I2C_DF_NOTIFY 0x01 /* for i2c */
  24. /* Registers */
  25. #define COMMAND1 0x00
  26. #define COMMAND2 0x01 /* Read&Write */
  27. #define COMMAND3 0x02 /* Read&Write */
  28. #define COMMAND4 0x03 /* Read&Write */
  29. #define INT_LT_LSB 0x04 /* Read&Write */
  30. #define INT_LT_MSB 0x05 /* Read&Write */
  31. #define INT_HT_LSB 0x06 /* Read&Write */
  32. #define INT_HT_MSB 0x07 /* Read&Write */
  33. #define PS_LT_LSB 0x08 /* Read&Write */
  34. #define PS_LT_MSB 0x09 /* Read&Write */
  35. #define PS_HT_LSB 0x0A /* Read&Write */
  36. #define PS_HT_MSB 0x0B /* Read&Write */
  37. #define DATA0_LSB 0x0C /* Read Only */
  38. #define DATA0_MSB 0x0D /* Read Only */
  39. #define DATA1_LSB 0x0E /* Read Only */
  40. #define DATA1_MSB 0x0F /* Read Only */
  41. #define DATA2_LSB 0x10 /* Read Only */
  42. #define DATA2_MSB 0x11 /* Read Only */
  43. #define DEFAULT_LO_THR 0x07 /* sharp recommand Loff */
  44. #define DEFAULT_HI_THR 0x08 /* sharp recommand Lon */
  45. #define OFFSET_ARRAY_LENGTH 10
  46. enum {
  47. IIO_ATTR_ENABLE = 0,
  48. IIO_ATTR_DELAY,
  49. };
  50. enum inv_mpu_scan {
  51. GP2A_SCAN_LIGHT = 0,
  52. GP2A_SCAN_PROX,
  53. };
  54. enum {
  55. D0_BND = 0,
  56. D0_COND1,
  57. D0_COND1_A,
  58. D0_COND1_B,
  59. D0_COND2,
  60. D0_COND2_A,
  61. D0_COND2_B,
  62. D0_COND3_A,
  63. D0_COND3_B,
  64. };
  65. #endif