msm_fb.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /* arch/arm/mach-msm/include/mach/msm_fb.h
  2. *
  3. * Internal shared definitions for various MSM framebuffer parts.
  4. *
  5. * Copyright (C) 2007 Google Incorporated
  6. *
  7. * This software is licensed under the terms of the GNU General Public
  8. * License version 2, as published by the Free Software Foundation, and
  9. * may be copied, distributed, and modified under those terms.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #ifndef _MSM_FB_H_
  17. #define _MSM_FB_H_
  18. #include <linux/device.h>
  19. struct mddi_info;
  20. struct msm_fb_data {
  21. int xres; /* x resolution in pixels */
  22. int yres; /* y resolution in pixels */
  23. int width; /* disply width in mm */
  24. int height; /* display height in mm */
  25. unsigned output_format;
  26. };
  27. struct msmfb_callback {
  28. void (*func)(struct msmfb_callback *);
  29. };
  30. enum {
  31. MSM_MDDI_PMDH_INTERFACE,
  32. MSM_MDDI_EMDH_INTERFACE,
  33. MSM_EBI2_INTERFACE,
  34. };
  35. #define MSMFB_CAP_PARTIAL_UPDATES (1 << 0)
  36. struct msm_panel_data {
  37. /* turns off the fb memory */
  38. int (*suspend)(struct msm_panel_data *);
  39. /* turns on the fb memory */
  40. int (*resume)(struct msm_panel_data *);
  41. /* turns off the panel */
  42. int (*blank)(struct msm_panel_data *);
  43. /* turns on the panel */
  44. int (*unblank)(struct msm_panel_data *);
  45. void (*wait_vsync)(struct msm_panel_data *);
  46. void (*request_vsync)(struct msm_panel_data *, struct msmfb_callback *);
  47. void (*clear_vsync)(struct msm_panel_data *);
  48. /* from the enum above */
  49. unsigned interface_type;
  50. /* data to be passed to the fb driver */
  51. struct msm_fb_data *fb_data;
  52. /* capabilities supported by the panel */
  53. uint32_t caps;
  54. };
  55. struct msm_mddi_client_data {
  56. void (*suspend)(struct msm_mddi_client_data *);
  57. void (*resume)(struct msm_mddi_client_data *);
  58. void (*activate_link)(struct msm_mddi_client_data *);
  59. void (*remote_write)(struct msm_mddi_client_data *, uint32_t val,
  60. uint32_t reg);
  61. uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg);
  62. void (*auto_hibernate)(struct msm_mddi_client_data *, int);
  63. /* custom data that needs to be passed from the board file to a
  64. * particular client */
  65. void *private_client_data;
  66. struct resource *fb_resource;
  67. /* from the list above */
  68. unsigned interface_type;
  69. };
  70. struct msm_mddi_platform_data {
  71. unsigned int clk_rate;
  72. void (*power_client)(struct msm_mddi_client_data *, int on);
  73. /* fixup the mfr name, product id */
  74. void (*fixup)(uint16_t *mfr_name, uint16_t *product_id);
  75. struct resource *fb_resource; /*optional*/
  76. /* number of clients in the list that follows */
  77. int num_clients;
  78. /* array of client information of clients */
  79. struct {
  80. unsigned product_id; /* mfr id in top 16 bits, product id
  81. * in lower 16 bits
  82. */
  83. char *name; /* the device name will be the platform
  84. * device name registered for the client,
  85. * it should match the name of the associated
  86. * driver
  87. */
  88. unsigned id; /* id for mddi client device node, will also
  89. * be used as device id of panel devices, if
  90. * the client device will have multiple panels
  91. * space must be left here for them
  92. */
  93. void *client_data; /* required private client data */
  94. unsigned int clk_rate; /* optional: if the client requires a
  95. * different mddi clk rate
  96. */
  97. } client_platform_data[];
  98. };
  99. struct mdp_blit_req;
  100. struct fb_info;
  101. struct mdp_device {
  102. struct device dev;
  103. void (*dma)(struct mdp_device *mpd, uint32_t addr,
  104. uint32_t stride, uint32_t w, uint32_t h, uint32_t x,
  105. uint32_t y, struct msmfb_callback *callback, int interface);
  106. void (*dma_wait)(struct mdp_device *mdp);
  107. int (*blit)(struct mdp_device *mdp, struct fb_info *fb,
  108. struct mdp_blit_req *req);
  109. void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id);
  110. };
  111. struct class_interface;
  112. int register_mdp_client(struct class_interface *class_intf);
  113. /**** private client data structs go below this line ***/
  114. struct msm_mddi_bridge_platform_data {
  115. /* from board file */
  116. int (*init)(struct msm_mddi_bridge_platform_data *,
  117. struct msm_mddi_client_data *);
  118. int (*uninit)(struct msm_mddi_bridge_platform_data *,
  119. struct msm_mddi_client_data *);
  120. /* passed to panel for use by the fb driver */
  121. int (*blank)(struct msm_mddi_bridge_platform_data *,
  122. struct msm_mddi_client_data *);
  123. int (*unblank)(struct msm_mddi_bridge_platform_data *,
  124. struct msm_mddi_client_data *);
  125. struct msm_fb_data fb_data;
  126. };
  127. #endif