atmel_mxt_ts.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Atmel maXTouch Touchscreen driver
  3. *
  4. * Copyright (C) 2010 Samsung Electronics Co.Ltd
  5. * Author: Joonyoung Shim <jy0922.shim@samsung.com>
  6. * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #ifndef __LINUX_ATMEL_MXT_TS_H
  14. #define __LINUX_ATMEL_MXT_TS_H
  15. #include <linux/types.h>
  16. /* Orient */
  17. #define MXT_NORMAL 0x0
  18. #define MXT_DIAGONAL 0x1
  19. #define MXT_HORIZONTAL_FLIP 0x2
  20. #define MXT_ROTATED_90_COUNTER 0x3
  21. #define MXT_VERTICAL_FLIP 0x4
  22. #define MXT_ROTATED_90 0x5
  23. #define MXT_ROTATED_180 0x6
  24. #define MXT_DIAGONAL_COUNTER 0x7
  25. /* MXT_TOUCH_KEYARRAY_T15 */
  26. #define MXT_KEYARRAY_MAX_KEYS 32
  27. /* Bootoader IDs */
  28. #define MXT_BOOTLOADER_ID_224 0x0A
  29. #define MXT_BOOTLOADER_ID_224E 0x06
  30. #define MXT_BOOTLOADER_ID_336S 0x1A
  31. #define MXT_BOOTLOADER_ID_1386 0x01
  32. #define MXT_BOOTLOADER_ID_1386E 0x10
  33. #define MXT_BOOTLOADER_ID_1664S 0x14
  34. /* Config data for a given maXTouch controller with a specific firmware */
  35. struct mxt_config_info {
  36. const u8 *config;
  37. size_t config_length;
  38. u8 family_id;
  39. u8 variant_id;
  40. u8 version;
  41. u8 build;
  42. u8 bootldr_id;
  43. /* Points to the firmware name to be upgraded to */
  44. const char *fw_name;
  45. };
  46. /* The platform data for the Atmel maXTouch touchscreen driver */
  47. struct mxt_platform_data {
  48. const struct mxt_config_info *config_array;
  49. size_t config_array_size;
  50. /* touch panel's minimum and maximum coordinates */
  51. u32 panel_minx;
  52. u32 panel_maxx;
  53. u32 panel_miny;
  54. u32 panel_maxy;
  55. /* display's minimum and maximum coordinates */
  56. u32 disp_minx;
  57. u32 disp_maxx;
  58. u32 disp_miny;
  59. u32 disp_maxy;
  60. unsigned long irqflags;
  61. bool i2c_pull_up;
  62. bool digital_pwr_regulator;
  63. int reset_gpio;
  64. u32 reset_gpio_flags;
  65. int irq_gpio;
  66. u32 irq_gpio_flags;
  67. int *key_codes;
  68. bool need_calibration;
  69. bool no_force_update;
  70. bool no_lpm_support;
  71. u8 bl_addr;
  72. u8(*read_chg) (void);
  73. int (*init_hw) (bool);
  74. int (*power_on) (bool);
  75. };
  76. #endif /* __LINUX_ATMEL_MXT_TS_H */