ft5x0x.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #ifndef __LINUX_FT5X0X_TS_H__
  2. #define __LINUX_FT5X0X_TS_H__
  3. /*--------------------TP's GPIO configure----------------------*/
  4. #define TP_I2C_SCL_GPIO_CTL (GPIO0_CTL + 4*TP_I2C_SCL_GPIO)
  5. #define TP_I2C_SDA_GPIO_CTL (GPIO0_CTL + 4*TP_I2C_SDA_GPIO)
  6. #define TP_RESET_GPIO_CTL (GPIO0_CTL + 4*TP_RESET_GPIO)
  7. #define TP_I2C_SCL_ODAT (GPIO_ODAT0 + 4*(TP_I2C_SCL_GPIO/32))
  8. #define TP_I2C_SDA_ODAT (GPIO_ODAT0 + 4*(TP_I2C_SDA_GPIO/32))
  9. #define TP_RESET_ODAT (GPIO_ODAT0 + 4*(TP_RESET_GPIO/32))
  10. #define TP_I2C_SCL_IDAT (GPIO_IDAT0 + 4*(TP_I2C_SCL_GPIO/32))
  11. #define TP_I2C_SDA_IDAT (GPIO_IDAT0 + 4*(TP_I2C_SDA_GPIO/32))
  12. #define TP_I2C_SCL_BIT (0x00000001<<(TP_I2C_SCL_GPIO%32))
  13. #define TP_I2C_SDA_BIT (0x00000001<<(TP_I2C_SDA_GPIO%32))
  14. #define TP_RESET_BIT (0x00000001<<(TP_RESET_GPIO%32))
  15. /*----------------TP's i2c address configure--------------------*/
  16. #define TP_I2C_ADDR 0x70
  17. /*-------------------TP's window configure----------------------*/
  18. #define LCD_WIDTH 240
  19. #define LCD_HEIGHT 320
  20. /* -- dirver configure -- */
  21. #define CFG_SUPPORT_AUTO_UPG 0
  22. #define CFG_SUPPORT_UPDATE_PROJECT_SETTING 0
  23. #define CFG_SUPPORT_TOUCH_KEY 0 //touch key, HOME, SEARCH, RETURN etc
  24. #define CFG_SUPPORT_READ_LEFT_DATA 0
  25. #define CFG_DBG_RAW_DATA_READ 0
  26. #define CFG_MAX_TOUCH_POINTS 1 //5
  27. #define CFG_NUMOFKEYS 4
  28. #define CFG_FTS_CTP_DRIVER_VERSION "2.0"
  29. #define FTS_PACKET_LENGTH 32//128
  30. #define SCREEN_MAX_X 1728
  31. #define SCREEN_MAX_Y 1024
  32. #define PRESS_MAX 255
  33. #define CFG_POINT_READ_BUF 5//(3 + 6 * (CFG_MAX_TOUCH_POINTS))
  34. #define FT5X0X_NAME "ft5x0x_ts"//"synaptics_i2c_rmi"//"synaptics-rmi-ts"//
  35. #define KEY_PRESS 1
  36. #define KEY_RELEASE 0
  37. #define MOVE_DISTANCE 900
  38. enum ft5x0x_ts_regs {
  39. FT5X0X_REG_THGROUP = 0x80, /* touch threshold, related to sensitivity */
  40. FT5X0X_REG_THPEAK = 0x81,
  41. FT5X0X_REG_THCAL = 0x82,
  42. FT5X0X_REG_THWATER = 0x83,
  43. FT5X0X_REG_THTEMP = 0x84,
  44. FT5X0X_REG_THDIFF = 0x85,
  45. FT5X0X_REG_CTRL = 0x86,
  46. FT5X0X_REG_TIMEENTERMONITOR = 0x87,
  47. FT5X0X_REG_PERIODACTIVE = 0x88, /* report rate */
  48. FT5X0X_REG_PERIODMONITOR = 0x89,
  49. FT5X0X_REG_HEIGHT_B = 0x8a,
  50. FT5X0X_REG_MAX_FRAME = 0x8b,
  51. FT5X0X_REG_DIST_MOVE = 0x8c,
  52. FT5X0X_REG_DIST_POINT = 0x8d,
  53. FT5X0X_REG_FEG_FRAME = 0x8e,
  54. FT5X0X_REG_SINGLE_CLICK_OFFSET = 0x8f,
  55. FT5X0X_REG_DOUBLE_CLICK_TIME_MIN = 0x90,
  56. FT5X0X_REG_SINGLE_CLICK_TIME = 0x91,
  57. FT5X0X_REG_LEFT_RIGHT_OFFSET = 0x92,
  58. FT5X0X_REG_UP_DOWN_OFFSET = 0x93,
  59. FT5X0X_REG_DISTANCE_LEFT_RIGHT = 0x94,
  60. FT5X0X_REG_DISTANCE_UP_DOWN = 0x95,
  61. FT5X0X_REG_ZOOM_DIS_SQR = 0x96,
  62. FT5X0X_REG_RADIAN_VALUE =0x97,
  63. FT5X0X_REG_MAX_X_HIGH = 0x98,
  64. FT5X0X_REG_MAX_X_LOW = 0x99,
  65. FT5X0X_REG_MAX_Y_HIGH = 0x9a,
  66. FT5X0X_REG_MAX_Y_LOW = 0x9b,
  67. FT5X0X_REG_K_X_HIGH = 0x9c,
  68. FT5X0X_REG_K_X_LOW = 0x9d,
  69. FT5X0X_REG_K_Y_HIGH = 0x9e,
  70. FT5X0X_REG_K_Y_LOW = 0x9f,
  71. FT5X0X_REG_AUTO_CLB_MODE = 0xa0,
  72. FT5X0X_REG_LIB_VERSION_H = 0xa1,
  73. FT5X0X_REG_LIB_VERSION_L = 0xa2,
  74. FT5X0X_REG_CIPHER = 0xa3,
  75. FT5X0X_REG_MODE = 0xa4,
  76. FT5X0X_REG_PMODE = 0xa5, /* Power Consume Mode */
  77. FT5X0X_REG_FIRMID = 0xa6, /* Firmware version */
  78. FT5X0X_REG_STATE = 0xa7,
  79. FT5X0X_REG_FT5201ID = 0xa8,
  80. FT5X0X_REG_ERR = 0xa9,
  81. FT5X0X_REG_CLB = 0xaa,
  82. };
  83. //FT5X0X_REG_PMODE
  84. #define PMODE_ACTIVE 0x00
  85. #define PMODE_MONITOR 0x01
  86. #define PMODE_STANDBY 0x02
  87. #define PMODE_HIBERNATE 0x03
  88. #ifndef ABS_MT_TOUCH_MAJOR
  89. #define ABS_MT_TOUCH_MAJOR 0x30 /* touching ellipse */
  90. #define ABS_MT_TOUCH_MINOR 0x31 /* (omit if circular) */
  91. #define ABS_MT_WIDTH_MAJOR 0x32 /* approaching ellipse */
  92. #define ABS_MT_WIDTH_MINOR 0x33 /* (omit if circular) */
  93. #define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
  94. #define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
  95. #define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
  96. #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
  97. #define ABS_MT_BLOB_ID 0x38 /* Group set of pkts as blob */
  98. #endif /* ABS_MT_TOUCH_MAJOR */
  99. #ifndef ABS_MT_TRACKING_ID
  100. #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
  101. #endif
  102. #endif