cyttsp4.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Header file for:
  3. * Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers.
  4. * For use with Cypress Txx3xx parts.
  5. * Supported parts include:
  6. * CY8CTST341
  7. * CY8CTMA340
  8. *
  9. * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc.
  10. * Copyright (C) 2012 Javier Martinez Canillas <javier@dowhile0.org>
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License
  14. * version 2, and only version 2, as published by the
  15. * Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License along
  23. * with this program; if not, write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  25. *
  26. * Contact Cypress Semiconductor at www.cypress.com (kev@cypress.com)
  27. *
  28. */
  29. #ifndef _CYTTSP4_H_
  30. #define _CYTTSP4_H_
  31. #define CYTTSP4_MT_NAME "cyttsp4_mt"
  32. #define CYTTSP4_I2C_NAME "cyttsp4_i2c_adapter"
  33. #define CYTTSP4_SPI_NAME "cyttsp4_spi_adapter"
  34. #define CY_TOUCH_SETTINGS_MAX 32
  35. struct touch_framework {
  36. const uint16_t *abs;
  37. uint8_t size;
  38. uint8_t enable_vkeys;
  39. } __packed;
  40. struct cyttsp4_mt_platform_data {
  41. struct touch_framework *frmwrk;
  42. unsigned short flags;
  43. char const *inp_dev_name;
  44. };
  45. struct touch_settings {
  46. const uint8_t *data;
  47. uint32_t size;
  48. uint8_t tag;
  49. } __packed;
  50. struct cyttsp4_core_platform_data {
  51. int irq_gpio;
  52. int rst_gpio;
  53. int level_irq_udelay;
  54. int (*xres)(struct cyttsp4_core_platform_data *pdata,
  55. struct device *dev);
  56. int (*init)(struct cyttsp4_core_platform_data *pdata,
  57. int on, struct device *dev);
  58. int (*power)(struct cyttsp4_core_platform_data *pdata,
  59. int on, struct device *dev, atomic_t *ignore_irq);
  60. int (*irq_stat)(struct cyttsp4_core_platform_data *pdata,
  61. struct device *dev);
  62. struct touch_settings *sett[CY_TOUCH_SETTINGS_MAX];
  63. };
  64. struct cyttsp4_platform_data {
  65. struct cyttsp4_core_platform_data *core_pdata;
  66. struct cyttsp4_mt_platform_data *mt_pdata;
  67. };
  68. #endif /* _CYTTSP4_H_ */