auo_k190xfb.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * 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. #ifndef _LINUX_VIDEO_AUO_K190XFB_H_
  11. #define _LINUX_VIDEO_AUO_K190XFB_H_
  12. /* Controller standby command needs a param */
  13. #define AUOK190X_QUIRK_STANDBYPARAM (1 << 0)
  14. /* Controller standby is completely broken */
  15. #define AUOK190X_QUIRK_STANDBYBROKEN (1 << 1)
  16. /*
  17. * Resolutions for the displays
  18. */
  19. #define AUOK190X_RESOLUTION_800_600 0
  20. #define AUOK190X_RESOLUTION_1024_768 1
  21. /*
  22. * struct used by auok190x. board specific stuff comes from *board
  23. */
  24. struct auok190xfb_par {
  25. struct fb_info *info;
  26. struct auok190x_board *board;
  27. struct regulator *regulator;
  28. struct mutex io_lock;
  29. struct delayed_work work;
  30. wait_queue_head_t waitq;
  31. int resolution;
  32. int rotation;
  33. int consecutive_threshold;
  34. int update_cnt;
  35. /* panel and controller informations */
  36. int epd_type;
  37. int panel_size_int;
  38. int panel_size_float;
  39. int panel_model;
  40. int tcon_version;
  41. int lut_version;
  42. /* individual controller callbacks */
  43. void (*update_partial)(struct auok190xfb_par *par, u16 y1, u16 y2);
  44. void (*update_all)(struct auok190xfb_par *par);
  45. bool (*need_refresh)(struct auok190xfb_par *par);
  46. void (*init)(struct auok190xfb_par *par);
  47. void (*recover)(struct auok190xfb_par *par);
  48. int update_mode; /* mode to use for updates */
  49. int last_mode; /* update mode last used */
  50. int flash;
  51. /* power management */
  52. int autosuspend_delay;
  53. bool standby;
  54. bool manual_standby;
  55. };
  56. /**
  57. * Board specific platform-data
  58. * @init: initialize the controller interface
  59. * @cleanup: cleanup the controller interface
  60. * @wait_for_rdy: wait until the controller is not busy anymore
  61. * @set_ctl: change an interface control
  62. * @set_hdb: write a value to the data register
  63. * @get_hdb: read a value from the data register
  64. * @setup_irq: method to setup the irq handling on the busy gpio
  65. * @gpio_nsleep: sleep gpio
  66. * @gpio_nrst: reset gpio
  67. * @gpio_nbusy: busy gpio
  68. * @resolution: one of the AUOK190X_RESOLUTION constants
  69. * @rotation: rotation of the framebuffer
  70. * @quirks: controller quirks to honor
  71. * @fps: frames per second for defio
  72. */
  73. struct auok190x_board {
  74. int (*init)(struct auok190xfb_par *);
  75. void (*cleanup)(struct auok190xfb_par *);
  76. int (*wait_for_rdy)(struct auok190xfb_par *);
  77. void (*set_ctl)(struct auok190xfb_par *, unsigned char, u8);
  78. void (*set_hdb)(struct auok190xfb_par *, u16);
  79. u16 (*get_hdb)(struct auok190xfb_par *);
  80. int (*setup_irq)(struct fb_info *);
  81. int gpio_nsleep;
  82. int gpio_nrst;
  83. int gpio_nbusy;
  84. int resolution;
  85. int rotation;
  86. int quirks;
  87. int fps;
  88. };
  89. #endif