video-msm_fb.h 4.4 KB

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