sentelic.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*-
  2. * Finger Sensing Pad PS/2 mouse driver.
  3. *
  4. * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd.
  5. * Copyright (C) 2005-2009 Tai-hwa Liang, Sentelic Corporation.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef __SENTELIC_H
  22. #define __SENTELIC_H
  23. /* Finger-sensing Pad information registers */
  24. #define FSP_REG_DEVICE_ID 0x00
  25. #define FSP_REG_VERSION 0x01
  26. #define FSP_REG_REVISION 0x04
  27. #define FSP_REG_TMOD_STATUS1 0x0B
  28. #define FSP_BIT_NO_ROTATION BIT(3)
  29. #define FSP_REG_PAGE_CTRL 0x0F
  30. /* Finger-sensing Pad control registers */
  31. #define FSP_REG_SYSCTL1 0x10
  32. #define FSP_BIT_EN_REG_CLK BIT(5)
  33. #define FSP_REG_OPC_QDOWN 0x31
  34. #define FSP_BIT_EN_OPC_TAG BIT(7)
  35. #define FSP_REG_OPTZ_XLO 0x34
  36. #define FSP_REG_OPTZ_XHI 0x35
  37. #define FSP_REG_OPTZ_YLO 0x36
  38. #define FSP_REG_OPTZ_YHI 0x37
  39. #define FSP_REG_SYSCTL5 0x40
  40. #define FSP_BIT_90_DEGREE BIT(0)
  41. #define FSP_BIT_EN_MSID6 BIT(1)
  42. #define FSP_BIT_EN_MSID7 BIT(2)
  43. #define FSP_BIT_EN_MSID8 BIT(3)
  44. #define FSP_BIT_EN_AUTO_MSID8 BIT(5)
  45. #define FSP_BIT_EN_PKT_G0 BIT(6)
  46. #define FSP_REG_ONPAD_CTL 0x43
  47. #define FSP_BIT_ONPAD_ENABLE BIT(0)
  48. #define FSP_BIT_ONPAD_FBBB BIT(1)
  49. #define FSP_BIT_FIX_VSCR BIT(3)
  50. #define FSP_BIT_FIX_HSCR BIT(5)
  51. #define FSP_BIT_DRAG_LOCK BIT(6)
  52. /* Finger-sensing Pad packet formating related definitions */
  53. /* absolute packet type */
  54. #define FSP_PKT_TYPE_NORMAL (0x00)
  55. #define FSP_PKT_TYPE_ABS (0x01)
  56. #define FSP_PKT_TYPE_NOTIFY (0x02)
  57. #define FSP_PKT_TYPE_NORMAL_OPC (0x03)
  58. #define FSP_PKT_TYPE_SHIFT (6)
  59. #ifdef __KERNEL__
  60. struct fsp_data {
  61. unsigned char ver; /* hardware version */
  62. unsigned char rev; /* hardware revison */
  63. unsigned char buttons; /* Number of buttons */
  64. unsigned int flags;
  65. #define FSPDRV_FLAG_EN_OPC (0x001) /* enable on-pad clicking */
  66. bool vscroll; /* Vertical scroll zone enabled */
  67. bool hscroll; /* Horizontal scroll zone enabled */
  68. unsigned char last_reg; /* Last register we requested read from */
  69. unsigned char last_val;
  70. };
  71. #ifdef CONFIG_MOUSE_PS2_SENTELIC
  72. extern int fsp_detect(struct psmouse *psmouse, bool set_properties);
  73. extern int fsp_init(struct psmouse *psmouse);
  74. #else
  75. inline int fsp_detect(struct psmouse *psmouse, bool set_properties)
  76. {
  77. return -ENOSYS;
  78. }
  79. inline int fsp_init(struct psmouse *psmouse)
  80. {
  81. return -ENOSYS;
  82. }
  83. #endif
  84. #endif /* __KERNEL__ */
  85. #endif /* !__SENTELIC_H */