auo_k190xfb.h 2.8 KB

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