omapdss.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /*
  2. * Copyright (C) 2008 Nokia Corporation
  3. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published by
  7. * the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __OMAP_OMAPDSS_H
  18. #define __OMAP_OMAPDSS_H
  19. #include <linux/list.h>
  20. #include <linux/kobject.h>
  21. #include <linux/device.h>
  22. #include <linux/platform_device.h>
  23. #include <asm/atomic.h>
  24. #define DISPC_IRQ_FRAMEDONE (1 << 0)
  25. #define DISPC_IRQ_VSYNC (1 << 1)
  26. #define DISPC_IRQ_EVSYNC_EVEN (1 << 2)
  27. #define DISPC_IRQ_EVSYNC_ODD (1 << 3)
  28. #define DISPC_IRQ_ACBIAS_COUNT_STAT (1 << 4)
  29. #define DISPC_IRQ_PROG_LINE_NUM (1 << 5)
  30. #define DISPC_IRQ_GFX_FIFO_UNDERFLOW (1 << 6)
  31. #define DISPC_IRQ_GFX_END_WIN (1 << 7)
  32. #define DISPC_IRQ_PAL_GAMMA_MASK (1 << 8)
  33. #define DISPC_IRQ_OCP_ERR (1 << 9)
  34. #define DISPC_IRQ_VID1_FIFO_UNDERFLOW (1 << 10)
  35. #define DISPC_IRQ_VID1_END_WIN (1 << 11)
  36. #define DISPC_IRQ_VID2_FIFO_UNDERFLOW (1 << 12)
  37. #define DISPC_IRQ_VID2_END_WIN (1 << 13)
  38. #define DISPC_IRQ_SYNC_LOST (1 << 14)
  39. #define DISPC_IRQ_SYNC_LOST_DIGIT (1 << 15)
  40. #define DISPC_IRQ_WAKEUP (1 << 16)
  41. #define DISPC_IRQ_SYNC_LOST2 (1 << 17)
  42. #define DISPC_IRQ_VSYNC2 (1 << 18)
  43. #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21)
  44. #define DISPC_IRQ_FRAMEDONE2 (1 << 22)
  45. struct omap_dss_device;
  46. struct omap_overlay_manager;
  47. enum omap_display_type {
  48. OMAP_DISPLAY_TYPE_NONE = 0,
  49. OMAP_DISPLAY_TYPE_DPI = 1 << 0,
  50. OMAP_DISPLAY_TYPE_DBI = 1 << 1,
  51. OMAP_DISPLAY_TYPE_SDI = 1 << 2,
  52. OMAP_DISPLAY_TYPE_DSI = 1 << 3,
  53. OMAP_DISPLAY_TYPE_VENC = 1 << 4,
  54. OMAP_DISPLAY_TYPE_HDMI = 1 << 5,
  55. };
  56. enum omap_plane {
  57. OMAP_DSS_GFX = 0,
  58. OMAP_DSS_VIDEO1 = 1,
  59. OMAP_DSS_VIDEO2 = 2
  60. };
  61. enum omap_channel {
  62. OMAP_DSS_CHANNEL_LCD = 0,
  63. OMAP_DSS_CHANNEL_DIGIT = 1,
  64. OMAP_DSS_CHANNEL_LCD2 = 2,
  65. };
  66. enum omap_color_mode {
  67. OMAP_DSS_COLOR_CLUT1 = 1 << 0, /* BITMAP 1 */
  68. OMAP_DSS_COLOR_CLUT2 = 1 << 1, /* BITMAP 2 */
  69. OMAP_DSS_COLOR_CLUT4 = 1 << 2, /* BITMAP 4 */
  70. OMAP_DSS_COLOR_CLUT8 = 1 << 3, /* BITMAP 8 */
  71. OMAP_DSS_COLOR_RGB12U = 1 << 4, /* RGB12, 16-bit container */
  72. OMAP_DSS_COLOR_ARGB16 = 1 << 5, /* ARGB16 */
  73. OMAP_DSS_COLOR_RGB16 = 1 << 6, /* RGB16 */
  74. OMAP_DSS_COLOR_RGB24U = 1 << 7, /* RGB24, 32-bit container */
  75. OMAP_DSS_COLOR_RGB24P = 1 << 8, /* RGB24, 24-bit container */
  76. OMAP_DSS_COLOR_YUV2 = 1 << 9, /* YUV2 4:2:2 co-sited */
  77. OMAP_DSS_COLOR_UYVY = 1 << 10, /* UYVY 4:2:2 co-sited */
  78. OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */
  79. OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */
  80. OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */
  81. OMAP_DSS_COLOR_NV12 = 1 << 14, /* NV12 format: YUV 4:2:0 */
  82. OMAP_DSS_COLOR_RGBA16 = 1 << 15, /* RGBA16 - 4444 */
  83. OMAP_DSS_COLOR_RGBX16 = 1 << 16, /* RGBx16 - 4444 */
  84. OMAP_DSS_COLOR_ARGB16_1555 = 1 << 17, /* ARGB16 - 1555 */
  85. OMAP_DSS_COLOR_XRGB16_1555 = 1 << 18, /* xRGB16 - 1555 */
  86. };
  87. enum omap_lcd_display_type {
  88. OMAP_DSS_LCD_DISPLAY_STN,
  89. OMAP_DSS_LCD_DISPLAY_TFT,
  90. };
  91. enum omap_dss_load_mode {
  92. OMAP_DSS_LOAD_CLUT_AND_FRAME = 0,
  93. OMAP_DSS_LOAD_CLUT_ONLY = 1,
  94. OMAP_DSS_LOAD_FRAME_ONLY = 2,
  95. OMAP_DSS_LOAD_CLUT_ONCE_FRAME = 3,
  96. };
  97. enum omap_dss_trans_key_type {
  98. OMAP_DSS_COLOR_KEY_GFX_DST = 0,
  99. OMAP_DSS_COLOR_KEY_VID_SRC = 1,
  100. };
  101. enum omap_rfbi_te_mode {
  102. OMAP_DSS_RFBI_TE_MODE_1 = 1,
  103. OMAP_DSS_RFBI_TE_MODE_2 = 2,
  104. };
  105. enum omap_panel_config {
  106. OMAP_DSS_LCD_IVS = 1<<0,
  107. OMAP_DSS_LCD_IHS = 1<<1,
  108. OMAP_DSS_LCD_IPC = 1<<2,
  109. OMAP_DSS_LCD_IEO = 1<<3,
  110. OMAP_DSS_LCD_RF = 1<<4,
  111. OMAP_DSS_LCD_ONOFF = 1<<5,
  112. OMAP_DSS_LCD_TFT = 1<<20,
  113. };
  114. enum omap_dss_venc_type {
  115. OMAP_DSS_VENC_TYPE_COMPOSITE,
  116. OMAP_DSS_VENC_TYPE_SVIDEO,
  117. };
  118. enum omap_display_caps {
  119. OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0,
  120. OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1,
  121. };
  122. enum omap_dss_update_mode {
  123. OMAP_DSS_UPDATE_DISABLED = 0,
  124. OMAP_DSS_UPDATE_AUTO,
  125. OMAP_DSS_UPDATE_MANUAL,
  126. };
  127. enum omap_dss_display_state {
  128. OMAP_DSS_DISPLAY_DISABLED = 0,
  129. OMAP_DSS_DISPLAY_ACTIVE,
  130. OMAP_DSS_DISPLAY_SUSPENDED,
  131. };
  132. /* XXX perhaps this should be removed */
  133. enum omap_dss_overlay_managers {
  134. OMAP_DSS_OVL_MGR_LCD,
  135. OMAP_DSS_OVL_MGR_TV,
  136. OMAP_DSS_OVL_MGR_LCD2,
  137. };
  138. enum omap_dss_rotation_type {
  139. OMAP_DSS_ROT_DMA = 0,
  140. OMAP_DSS_ROT_VRFB = 1,
  141. };
  142. /* clockwise rotation angle */
  143. enum omap_dss_rotation_angle {
  144. OMAP_DSS_ROT_0 = 0,
  145. OMAP_DSS_ROT_90 = 1,
  146. OMAP_DSS_ROT_180 = 2,
  147. OMAP_DSS_ROT_270 = 3,
  148. };
  149. enum omap_overlay_caps {
  150. OMAP_DSS_OVL_CAP_SCALE = 1 << 0,
  151. OMAP_DSS_OVL_CAP_DISPC = 1 << 1,
  152. };
  153. enum omap_overlay_manager_caps {
  154. OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0,
  155. };
  156. enum omap_dss_clk_source {
  157. OMAP_DSS_CLK_SRC_FCK = 0, /* OMAP2/3: DSS1_ALWON_FCLK
  158. * OMAP4: DSS_FCLK */
  159. OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, /* OMAP3: DSI1_PLL_FCLK
  160. * OMAP4: PLL1_CLK1 */
  161. OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, /* OMAP3: DSI2_PLL_FCLK
  162. * OMAP4: PLL1_CLK2 */
  163. OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC, /* OMAP4: PLL2_CLK1 */
  164. OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, /* OMAP4: PLL2_CLK2 */
  165. };
  166. /* RFBI */
  167. struct rfbi_timings {
  168. int cs_on_time;
  169. int cs_off_time;
  170. int we_on_time;
  171. int we_off_time;
  172. int re_on_time;
  173. int re_off_time;
  174. int we_cycle_time;
  175. int re_cycle_time;
  176. int cs_pulse_width;
  177. int access_time;
  178. int clk_div;
  179. u32 tim[5]; /* set by rfbi_convert_timings() */
  180. int converted;
  181. };
  182. void omap_rfbi_write_command(const void *buf, u32 len);
  183. void omap_rfbi_read_data(void *buf, u32 len);
  184. void omap_rfbi_write_data(const void *buf, u32 len);
  185. void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width,
  186. u16 x, u16 y,
  187. u16 w, u16 h);
  188. int omap_rfbi_enable_te(bool enable, unsigned line);
  189. int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode,
  190. unsigned hs_pulse_time, unsigned vs_pulse_time,
  191. int hs_pol_inv, int vs_pol_inv, int extif_div);
  192. void rfbi_bus_lock(void);
  193. void rfbi_bus_unlock(void);
  194. /* DSI */
  195. void dsi_bus_lock(struct omap_dss_device *dssdev);
  196. void dsi_bus_unlock(struct omap_dss_device *dssdev);
  197. int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
  198. int len);
  199. int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel,
  200. u8 dcs_cmd);
  201. int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
  202. u8 param);
  203. int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
  204. u8 *data, int len);
  205. int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
  206. u8 *buf, int buflen);
  207. int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
  208. u8 *data);
  209. int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
  210. u8 *data1, u8 *data2);
  211. int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
  212. u16 len);
  213. int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
  214. int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
  215. /* Board specific data */
  216. struct omap_dss_board_info {
  217. int (*get_last_off_on_transaction_id)(struct device *dev);
  218. int num_devices;
  219. struct omap_dss_device **devices;
  220. struct omap_dss_device *default_device;
  221. void (*dsi_mux_pads)(bool enable);
  222. };
  223. #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
  224. /* Init with the board info */
  225. extern int omap_display_init(struct omap_dss_board_info *board_data);
  226. #else
  227. static inline int omap_display_init(struct omap_dss_board_info *board_data)
  228. {
  229. return 0;
  230. }
  231. #endif
  232. struct omap_display_platform_data {
  233. struct omap_dss_board_info *board_data;
  234. /* TODO: Additional members to be added when PM is considered */
  235. bool (*opt_clock_available)(const char *clk_role);
  236. };
  237. struct omap_video_timings {
  238. /* Unit: pixels */
  239. u16 x_res;
  240. /* Unit: pixels */
  241. u16 y_res;
  242. /* Unit: KHz */
  243. u32 pixel_clock;
  244. /* Unit: pixel clocks */
  245. u16 hsw; /* Horizontal synchronization pulse width */
  246. /* Unit: pixel clocks */
  247. u16 hfp; /* Horizontal front porch */
  248. /* Unit: pixel clocks */
  249. u16 hbp; /* Horizontal back porch */
  250. /* Unit: line clocks */
  251. u16 vsw; /* Vertical synchronization pulse width */
  252. /* Unit: line clocks */
  253. u16 vfp; /* Vertical front porch */
  254. /* Unit: line clocks */
  255. u16 vbp; /* Vertical back porch */
  256. };
  257. #ifdef CONFIG_OMAP2_DSS_VENC
  258. /* Hardcoded timings for tv modes. Venc only uses these to
  259. * identify the mode, and does not actually use the configs
  260. * itself. However, the configs should be something that
  261. * a normal monitor can also show */
  262. extern const struct omap_video_timings omap_dss_pal_timings;
  263. extern const struct omap_video_timings omap_dss_ntsc_timings;
  264. #endif
  265. struct omap_overlay_info {
  266. bool enabled;
  267. u32 paddr;
  268. void __iomem *vaddr;
  269. u32 p_uv_addr; /* for NV12 format */
  270. u16 screen_width;
  271. u16 width;
  272. u16 height;
  273. enum omap_color_mode color_mode;
  274. u8 rotation;
  275. enum omap_dss_rotation_type rotation_type;
  276. bool mirror;
  277. u16 pos_x;
  278. u16 pos_y;
  279. u16 out_width; /* if 0, out_width == width */
  280. u16 out_height; /* if 0, out_height == height */
  281. u8 global_alpha;
  282. u8 pre_mult_alpha;
  283. };
  284. struct omap_overlay {
  285. struct kobject kobj;
  286. struct list_head list;
  287. /* static fields */
  288. const char *name;
  289. int id;
  290. enum omap_color_mode supported_modes;
  291. enum omap_overlay_caps caps;
  292. /* dynamic fields */
  293. struct omap_overlay_manager *manager;
  294. struct omap_overlay_info info;
  295. /* if true, info has been changed, but not applied() yet */
  296. bool info_dirty;
  297. int (*set_manager)(struct omap_overlay *ovl,
  298. struct omap_overlay_manager *mgr);
  299. int (*unset_manager)(struct omap_overlay *ovl);
  300. int (*set_overlay_info)(struct omap_overlay *ovl,
  301. struct omap_overlay_info *info);
  302. void (*get_overlay_info)(struct omap_overlay *ovl,
  303. struct omap_overlay_info *info);
  304. int (*wait_for_go)(struct omap_overlay *ovl);
  305. };
  306. struct omap_overlay_manager_info {
  307. u32 default_color;
  308. enum omap_dss_trans_key_type trans_key_type;
  309. u32 trans_key;
  310. bool trans_enabled;
  311. bool alpha_enabled;
  312. };
  313. struct omap_overlay_manager {
  314. struct kobject kobj;
  315. struct list_head list;
  316. /* static fields */
  317. const char *name;
  318. int id;
  319. enum omap_overlay_manager_caps caps;
  320. int num_overlays;
  321. struct omap_overlay **overlays;
  322. enum omap_display_type supported_displays;
  323. /* dynamic fields */
  324. struct omap_dss_device *device;
  325. struct omap_overlay_manager_info info;
  326. bool device_changed;
  327. /* if true, info has been changed but not applied() yet */
  328. bool info_dirty;
  329. int (*set_device)(struct omap_overlay_manager *mgr,
  330. struct omap_dss_device *dssdev);
  331. int (*unset_device)(struct omap_overlay_manager *mgr);
  332. int (*set_manager_info)(struct omap_overlay_manager *mgr,
  333. struct omap_overlay_manager_info *info);
  334. void (*get_manager_info)(struct omap_overlay_manager *mgr,
  335. struct omap_overlay_manager_info *info);
  336. int (*apply)(struct omap_overlay_manager *mgr);
  337. int (*wait_for_go)(struct omap_overlay_manager *mgr);
  338. int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
  339. int (*enable)(struct omap_overlay_manager *mgr);
  340. int (*disable)(struct omap_overlay_manager *mgr);
  341. };
  342. struct omap_dss_device {
  343. struct device dev;
  344. enum omap_display_type type;
  345. enum omap_channel channel;
  346. union {
  347. struct {
  348. u8 data_lines;
  349. } dpi;
  350. struct {
  351. u8 channel;
  352. u8 data_lines;
  353. } rfbi;
  354. struct {
  355. u8 datapairs;
  356. } sdi;
  357. struct {
  358. u8 clk_lane;
  359. u8 clk_pol;
  360. u8 data1_lane;
  361. u8 data1_pol;
  362. u8 data2_lane;
  363. u8 data2_pol;
  364. u8 data3_lane;
  365. u8 data3_pol;
  366. u8 data4_lane;
  367. u8 data4_pol;
  368. int module;
  369. bool ext_te;
  370. u8 ext_te_gpio;
  371. } dsi;
  372. struct {
  373. enum omap_dss_venc_type type;
  374. bool invert_polarity;
  375. } venc;
  376. } phy;
  377. struct {
  378. struct {
  379. struct {
  380. u16 lck_div;
  381. u16 pck_div;
  382. enum omap_dss_clk_source lcd_clk_src;
  383. } channel;
  384. enum omap_dss_clk_source dispc_fclk_src;
  385. } dispc;
  386. struct {
  387. u16 regn;
  388. u16 regm;
  389. u16 regm_dispc;
  390. u16 regm_dsi;
  391. u16 lp_clk_div;
  392. enum omap_dss_clk_source dsi_fclk_src;
  393. } dsi;
  394. struct {
  395. u16 regn;
  396. u16 regm2;
  397. } hdmi;
  398. } clocks;
  399. struct {
  400. struct omap_video_timings timings;
  401. int acbi; /* ac-bias pin transitions per interrupt */
  402. /* Unit: line clocks */
  403. int acb; /* ac-bias pin frequency */
  404. enum omap_panel_config config;
  405. } panel;
  406. struct {
  407. u8 pixel_size;
  408. struct rfbi_timings rfbi_timings;
  409. } ctrl;
  410. int reset_gpio;
  411. int max_backlight_level;
  412. const char *name;
  413. /* used to match device to driver */
  414. const char *driver_name;
  415. void *data;
  416. struct omap_dss_driver *driver;
  417. /* helper variable for driver suspend/resume */
  418. bool activate_after_resume;
  419. enum omap_display_caps caps;
  420. struct omap_overlay_manager *manager;
  421. enum omap_dss_display_state state;
  422. /* platform specific */
  423. int (*platform_enable)(struct omap_dss_device *dssdev);
  424. void (*platform_disable)(struct omap_dss_device *dssdev);
  425. int (*set_backlight)(struct omap_dss_device *dssdev, int level);
  426. int (*get_backlight)(struct omap_dss_device *dssdev);
  427. };
  428. struct omap_dss_hdmi_data
  429. {
  430. int hpd_gpio;
  431. };
  432. struct omap_dss_driver {
  433. struct device_driver driver;
  434. int (*probe)(struct omap_dss_device *);
  435. void (*remove)(struct omap_dss_device *);
  436. int (*enable)(struct omap_dss_device *display);
  437. void (*disable)(struct omap_dss_device *display);
  438. int (*suspend)(struct omap_dss_device *display);
  439. int (*resume)(struct omap_dss_device *display);
  440. int (*run_test)(struct omap_dss_device *display, int test);
  441. int (*set_update_mode)(struct omap_dss_device *dssdev,
  442. enum omap_dss_update_mode);
  443. enum omap_dss_update_mode (*get_update_mode)(
  444. struct omap_dss_device *dssdev);
  445. int (*update)(struct omap_dss_device *dssdev,
  446. u16 x, u16 y, u16 w, u16 h);
  447. int (*sync)(struct omap_dss_device *dssdev);
  448. int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
  449. int (*get_te)(struct omap_dss_device *dssdev);
  450. u8 (*get_rotate)(struct omap_dss_device *dssdev);
  451. int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate);
  452. bool (*get_mirror)(struct omap_dss_device *dssdev);
  453. int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);
  454. int (*memory_read)(struct omap_dss_device *dssdev,
  455. void *buf, size_t size,
  456. u16 x, u16 y, u16 w, u16 h);
  457. void (*get_resolution)(struct omap_dss_device *dssdev,
  458. u16 *xres, u16 *yres);
  459. void (*get_dimensions)(struct omap_dss_device *dssdev,
  460. u32 *width, u32 *height);
  461. int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
  462. int (*check_timings)(struct omap_dss_device *dssdev,
  463. struct omap_video_timings *timings);
  464. void (*set_timings)(struct omap_dss_device *dssdev,
  465. struct omap_video_timings *timings);
  466. void (*get_timings)(struct omap_dss_device *dssdev,
  467. struct omap_video_timings *timings);
  468. int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
  469. u32 (*get_wss)(struct omap_dss_device *dssdev);
  470. };
  471. int omap_dss_register_driver(struct omap_dss_driver *);
  472. void omap_dss_unregister_driver(struct omap_dss_driver *);
  473. void omap_dss_get_device(struct omap_dss_device *dssdev);
  474. void omap_dss_put_device(struct omap_dss_device *dssdev);
  475. #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
  476. struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
  477. struct omap_dss_device *omap_dss_find_device(void *data,
  478. int (*match)(struct omap_dss_device *dssdev, void *data));
  479. int omap_dss_start_device(struct omap_dss_device *dssdev);
  480. void omap_dss_stop_device(struct omap_dss_device *dssdev);
  481. int omap_dss_get_num_overlay_managers(void);
  482. struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
  483. int omap_dss_get_num_overlays(void);
  484. struct omap_overlay *omap_dss_get_overlay(int num);
  485. void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
  486. u16 *xres, u16 *yres);
  487. int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
  488. typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
  489. int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
  490. int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
  491. int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
  492. int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
  493. unsigned long timeout);
  494. #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
  495. #define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
  496. void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
  497. bool enable);
  498. int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
  499. int omap_dsi_prepare_update(struct omap_dss_device *dssdev,
  500. u16 *x, u16 *y, u16 *w, u16 *h,
  501. bool enlarge_update_area);
  502. int omap_dsi_update(struct omap_dss_device *dssdev,
  503. int channel,
  504. u16 x, u16 y, u16 w, u16 h,
  505. void (*callback)(int, void *), void *data);
  506. int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel);
  507. int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
  508. void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel);
  509. int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
  510. void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
  511. bool disconnect_lanes, bool enter_ulps);
  512. int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
  513. void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);
  514. void dpi_set_timings(struct omap_dss_device *dssdev,
  515. struct omap_video_timings *timings);
  516. int dpi_check_timings(struct omap_dss_device *dssdev,
  517. struct omap_video_timings *timings);
  518. int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
  519. void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);
  520. int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
  521. void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev);
  522. int omap_rfbi_prepare_update(struct omap_dss_device *dssdev,
  523. u16 *x, u16 *y, u16 *w, u16 *h);
  524. int omap_rfbi_update(struct omap_dss_device *dssdev,
  525. u16 x, u16 y, u16 w, u16 h,
  526. void (*callback)(void *), void *data);
  527. int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size,
  528. int data_lines);
  529. #endif