auo_k190x.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * Private common definitions for AUO-K190X framebuffer drivers
  3. *
  4. * Copyright (C) 2012 Heiko Stuebner <heiko@sntech.de>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. /*
  11. * I80 interface specific defines
  12. */
  13. #define AUOK190X_I80_CS 0x01
  14. #define AUOK190X_I80_DC 0x02
  15. #define AUOK190X_I80_WR 0x03
  16. #define AUOK190X_I80_OE 0x04
  17. /*
  18. * AUOK190x commands, common to both controllers
  19. */
  20. #define AUOK190X_CMD_INIT 0x0000
  21. #define AUOK190X_CMD_STANDBY 0x0001
  22. #define AUOK190X_CMD_WAKEUP 0x0002
  23. #define AUOK190X_CMD_TCON_RESET 0x0003
  24. #define AUOK190X_CMD_DATA_STOP 0x1002
  25. #define AUOK190X_CMD_LUT_START 0x1003
  26. #define AUOK190X_CMD_DISP_REFRESH 0x1004
  27. #define AUOK190X_CMD_DISP_RESET 0x1005
  28. #define AUOK190X_CMD_PRE_DISPLAY_START 0x100D
  29. #define AUOK190X_CMD_PRE_DISPLAY_STOP 0x100F
  30. #define AUOK190X_CMD_FLASH_W 0x2000
  31. #define AUOK190X_CMD_FLASH_E 0x2001
  32. #define AUOK190X_CMD_FLASH_STS 0x2002
  33. #define AUOK190X_CMD_FRAMERATE 0x3000
  34. #define AUOK190X_CMD_READ_VERSION 0x4000
  35. #define AUOK190X_CMD_READ_STATUS 0x4001
  36. #define AUOK190X_CMD_READ_LUT 0x4003
  37. #define AUOK190X_CMD_DRIVERTIMING 0x5000
  38. #define AUOK190X_CMD_LBALANCE 0x5001
  39. #define AUOK190X_CMD_AGINGMODE 0x6000
  40. #define AUOK190X_CMD_AGINGEXIT 0x6001
  41. /*
  42. * Common settings for AUOK190X_CMD_INIT
  43. */
  44. #define AUOK190X_INIT_DATA_FILTER (0 << 12)
  45. #define AUOK190X_INIT_DATA_BYPASS (1 << 12)
  46. #define AUOK190X_INIT_INVERSE_WHITE (0 << 9)
  47. #define AUOK190X_INIT_INVERSE_BLACK (1 << 9)
  48. #define AUOK190X_INIT_SCAN_DOWN (0 << 1)
  49. #define AUOK190X_INIT_SCAN_UP (1 << 1)
  50. #define AUOK190X_INIT_SHIFT_LEFT (0 << 0)
  51. #define AUOK190X_INIT_SHIFT_RIGHT (1 << 0)
  52. /* Common bits to pixels
  53. * Mode 15-12 11-8 7-4 3-0
  54. * format0 4 3 2 1
  55. * format1 3 4 1 2
  56. */
  57. #define AUOK190X_INIT_FORMAT0 0
  58. #define AUOK190X_INIT_FORMAT1 (1 << 6)
  59. /*
  60. * settings for AUOK190X_CMD_RESET
  61. */
  62. #define AUOK190X_RESET_TCON (0 << 0)
  63. #define AUOK190X_RESET_NORMAL (1 << 0)
  64. #define AUOK190X_RESET_PON (1 << 1)
  65. /*
  66. * AUOK190X_CMD_VERSION
  67. */
  68. #define AUOK190X_VERSION_TEMP_MASK (0x1ff)
  69. #define AUOK190X_VERSION_EPD_MASK (0xff)
  70. #define AUOK190X_VERSION_SIZE_INT(_val) ((_val & 0xfc00) >> 10)
  71. #define AUOK190X_VERSION_SIZE_FLOAT(_val) ((_val & 0x3c0) >> 6)
  72. #define AUOK190X_VERSION_MODEL(_val) (_val & 0x3f)
  73. #define AUOK190X_VERSION_LUT(_val) (_val & 0xff)
  74. #define AUOK190X_VERSION_TCON(_val) ((_val & 0xff00) >> 8)
  75. /*
  76. * update modes for CMD_PARTIALDISP on K1900 and CMD_DDMA on K1901
  77. */
  78. #define AUOK190X_UPDATE_MODE(_res) ((_res & 0x7) << 12)
  79. #define AUOK190X_UPDATE_NONFLASH (1 << 15)
  80. /*
  81. * track panel specific parameters for common init
  82. */
  83. struct auok190x_init_data {
  84. char *id;
  85. struct auok190x_board *board;
  86. void (*update_partial)(struct auok190xfb_par *par, u16 y1, u16 y2);
  87. void (*update_all)(struct auok190xfb_par *par);
  88. bool (*need_refresh)(struct auok190xfb_par *par);
  89. void (*init)(struct auok190xfb_par *par);
  90. };
  91. extern void auok190x_send_command_nowait(struct auok190xfb_par *par, u16 data);
  92. extern int auok190x_send_command(struct auok190xfb_par *par, u16 data);
  93. extern void auok190x_send_cmdargs_nowait(struct auok190xfb_par *par, u16 cmd,
  94. int argc, u16 *argv);
  95. extern int auok190x_send_cmdargs(struct auok190xfb_par *par, u16 cmd,
  96. int argc, u16 *argv);
  97. extern void auok190x_send_cmdargs_pixels_nowait(struct auok190xfb_par *par,
  98. u16 cmd, int argc, u16 *argv,
  99. int size, u16 *data);
  100. extern int auok190x_send_cmdargs_pixels(struct auok190xfb_par *par, u16 cmd,
  101. int argc, u16 *argv, int size,
  102. u16 *data);
  103. extern int auok190x_read_cmdargs(struct auok190xfb_par *par, u16 cmd,
  104. int argc, u16 *argv);
  105. extern int auok190x_common_probe(struct platform_device *pdev,
  106. struct auok190x_init_data *init);
  107. extern int auok190x_common_remove(struct platform_device *pdev);
  108. extern const struct dev_pm_ops auok190x_pm;