dss.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /*
  2. * linux/drivers/video/omap2/dss/dss.h
  3. *
  4. * Copyright (C) 2009 Nokia Corporation
  5. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  6. *
  7. * Some code and ideas taken from drivers/video/omap/ driver
  8. * by Imre Deak.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License version 2 as published by
  12. * the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  17. * more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along with
  20. * this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. #ifndef __OMAP2_DSS_H
  23. #define __OMAP2_DSS_H
  24. #ifdef DEBUG
  25. extern bool dss_debug;
  26. #ifdef DSS_SUBSYS_NAME
  27. #define DSSDBG(format, ...) \
  28. if (dss_debug) \
  29. printk(KERN_DEBUG "omapdss " DSS_SUBSYS_NAME ": " format, \
  30. ## __VA_ARGS__)
  31. #else
  32. #define DSSDBG(format, ...) \
  33. if (dss_debug) \
  34. printk(KERN_DEBUG "omapdss: " format, ## __VA_ARGS__)
  35. #endif
  36. #ifdef DSS_SUBSYS_NAME
  37. #define DSSDBGF(format, ...) \
  38. if (dss_debug) \
  39. printk(KERN_DEBUG "omapdss " DSS_SUBSYS_NAME \
  40. ": %s(" format ")\n", \
  41. __func__, \
  42. ## __VA_ARGS__)
  43. #else
  44. #define DSSDBGF(format, ...) \
  45. if (dss_debug) \
  46. printk(KERN_DEBUG "omapdss: " \
  47. ": %s(" format ")\n", \
  48. __func__, \
  49. ## __VA_ARGS__)
  50. #endif
  51. #else /* DEBUG */
  52. #define DSSDBG(format, ...)
  53. #define DSSDBGF(format, ...)
  54. #endif
  55. #ifdef DSS_SUBSYS_NAME
  56. #define DSSERR(format, ...) \
  57. printk(KERN_ERR "omapdss " DSS_SUBSYS_NAME " error: " format, \
  58. ## __VA_ARGS__)
  59. #else
  60. #define DSSERR(format, ...) \
  61. printk(KERN_ERR "omapdss error: " format, ## __VA_ARGS__)
  62. #endif
  63. #ifdef DSS_SUBSYS_NAME
  64. #define DSSINFO(format, ...) \
  65. printk(KERN_INFO "omapdss " DSS_SUBSYS_NAME ": " format, \
  66. ## __VA_ARGS__)
  67. #else
  68. #define DSSINFO(format, ...) \
  69. printk(KERN_INFO "omapdss: " format, ## __VA_ARGS__)
  70. #endif
  71. #ifdef DSS_SUBSYS_NAME
  72. #define DSSWARN(format, ...) \
  73. printk(KERN_WARNING "omapdss " DSS_SUBSYS_NAME ": " format, \
  74. ## __VA_ARGS__)
  75. #else
  76. #define DSSWARN(format, ...) \
  77. printk(KERN_WARNING "omapdss: " format, ## __VA_ARGS__)
  78. #endif
  79. /* OMAP TRM gives bitfields as start:end, where start is the higher bit
  80. number. For example 7:0 */
  81. #define FLD_MASK(start, end) (((1 << ((start) - (end) + 1)) - 1) << (end))
  82. #define FLD_VAL(val, start, end) (((val) << (end)) & FLD_MASK(start, end))
  83. #define FLD_GET(val, start, end) (((val) & FLD_MASK(start, end)) >> (end))
  84. #define FLD_MOD(orig, val, start, end) \
  85. (((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end))
  86. enum dss_io_pad_mode {
  87. DSS_IO_PAD_MODE_RESET,
  88. DSS_IO_PAD_MODE_RFBI,
  89. DSS_IO_PAD_MODE_BYPASS,
  90. };
  91. enum dss_hdmi_venc_clk_source_select {
  92. DSS_VENC_TV_CLK = 0,
  93. DSS_HDMI_M_PCLK = 1,
  94. };
  95. enum dss_dsi_content_type {
  96. DSS_DSI_CONTENT_DCS,
  97. DSS_DSI_CONTENT_GENERIC,
  98. };
  99. enum dss_writeback_channel {
  100. DSS_WB_LCD1_MGR = 0,
  101. DSS_WB_LCD2_MGR = 1,
  102. DSS_WB_TV_MGR = 2,
  103. DSS_WB_OVL0 = 3,
  104. DSS_WB_OVL1 = 4,
  105. DSS_WB_OVL2 = 5,
  106. DSS_WB_OVL3 = 6,
  107. DSS_WB_LCD3_MGR = 7,
  108. };
  109. struct dss_clock_info {
  110. /* rates that we get with dividers below */
  111. unsigned long fck;
  112. /* dividers */
  113. u16 fck_div;
  114. };
  115. struct dispc_clock_info {
  116. /* rates that we get with dividers below */
  117. unsigned long lck;
  118. unsigned long pck;
  119. /* dividers */
  120. u16 lck_div;
  121. u16 pck_div;
  122. };
  123. struct dsi_clock_info {
  124. /* rates that we get with dividers below */
  125. unsigned long fint;
  126. unsigned long clkin4ddr;
  127. unsigned long clkin;
  128. unsigned long dsi_pll_hsdiv_dispc_clk; /* OMAP3: DSI1_PLL_CLK
  129. * OMAP4: PLLx_CLK1 */
  130. unsigned long dsi_pll_hsdiv_dsi_clk; /* OMAP3: DSI2_PLL_CLK
  131. * OMAP4: PLLx_CLK2 */
  132. unsigned long lp_clk;
  133. /* dividers */
  134. u16 regn;
  135. u16 regm;
  136. u16 regm_dispc; /* OMAP3: REGM3
  137. * OMAP4: REGM4 */
  138. u16 regm_dsi; /* OMAP3: REGM4
  139. * OMAP4: REGM5 */
  140. u16 lp_clk_div;
  141. };
  142. struct reg_field {
  143. u16 reg;
  144. u8 high;
  145. u8 low;
  146. };
  147. struct dss_lcd_mgr_config {
  148. enum dss_io_pad_mode io_pad_mode;
  149. bool stallmode;
  150. bool fifohandcheck;
  151. struct dispc_clock_info clock_info;
  152. int video_port_width;
  153. int lcden_sig_polarity;
  154. };
  155. struct seq_file;
  156. struct platform_device;
  157. /* core */
  158. const char *dss_get_default_display_name(void);
  159. struct bus_type *dss_get_bus(void);
  160. struct regulator *dss_get_vdds_dsi(void);
  161. struct regulator *dss_get_vdds_sdi(void);
  162. int dss_get_ctx_loss_count(struct device *dev);
  163. int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask);
  164. void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask);
  165. int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
  166. int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *));
  167. struct omap_dss_device *dss_alloc_and_init_device(struct device *parent);
  168. int dss_add_device(struct omap_dss_device *dssdev);
  169. void dss_unregister_device(struct omap_dss_device *dssdev);
  170. void dss_unregister_child_devices(struct device *parent);
  171. void dss_put_device(struct omap_dss_device *dssdev);
  172. void dss_copy_device_pdata(struct omap_dss_device *dst,
  173. const struct omap_dss_device *src);
  174. /* apply */
  175. void dss_apply_init(void);
  176. int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr);
  177. int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl);
  178. void dss_mgr_start_update(struct omap_overlay_manager *mgr);
  179. int omap_dss_mgr_apply(struct omap_overlay_manager *mgr);
  180. int dss_mgr_enable(struct omap_overlay_manager *mgr);
  181. void dss_mgr_disable(struct omap_overlay_manager *mgr);
  182. int dss_mgr_set_info(struct omap_overlay_manager *mgr,
  183. struct omap_overlay_manager_info *info);
  184. void dss_mgr_get_info(struct omap_overlay_manager *mgr,
  185. struct omap_overlay_manager_info *info);
  186. int dss_mgr_set_device(struct omap_overlay_manager *mgr,
  187. struct omap_dss_device *dssdev);
  188. int dss_mgr_unset_device(struct omap_overlay_manager *mgr);
  189. int dss_mgr_set_output(struct omap_overlay_manager *mgr,
  190. struct omap_dss_output *output);
  191. int dss_mgr_unset_output(struct omap_overlay_manager *mgr);
  192. void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
  193. const struct omap_video_timings *timings);
  194. void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
  195. const struct dss_lcd_mgr_config *config);
  196. const struct omap_video_timings *dss_mgr_get_timings(struct omap_overlay_manager *mgr);
  197. bool dss_ovl_is_enabled(struct omap_overlay *ovl);
  198. int dss_ovl_enable(struct omap_overlay *ovl);
  199. int dss_ovl_disable(struct omap_overlay *ovl);
  200. int dss_ovl_set_info(struct omap_overlay *ovl,
  201. struct omap_overlay_info *info);
  202. void dss_ovl_get_info(struct omap_overlay *ovl,
  203. struct omap_overlay_info *info);
  204. int dss_ovl_set_manager(struct omap_overlay *ovl,
  205. struct omap_overlay_manager *mgr);
  206. int dss_ovl_unset_manager(struct omap_overlay *ovl);
  207. /* output */
  208. void dss_register_output(struct omap_dss_output *out);
  209. void dss_unregister_output(struct omap_dss_output *out);
  210. struct omap_dss_output *omapdss_get_output_from_dssdev(struct omap_dss_device *dssdev);
  211. /* display */
  212. int dss_suspend_all_devices(void);
  213. int dss_resume_all_devices(void);
  214. void dss_disable_all_devices(void);
  215. int dss_init_device(struct platform_device *pdev,
  216. struct omap_dss_device *dssdev);
  217. void dss_uninit_device(struct platform_device *pdev,
  218. struct omap_dss_device *dssdev);
  219. /* manager */
  220. int dss_init_overlay_managers(struct platform_device *pdev);
  221. void dss_uninit_overlay_managers(struct platform_device *pdev);
  222. int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
  223. const struct omap_overlay_manager_info *info);
  224. int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
  225. const struct omap_video_timings *timings);
  226. int dss_mgr_check(struct omap_overlay_manager *mgr,
  227. struct omap_overlay_manager_info *info,
  228. const struct omap_video_timings *mgr_timings,
  229. const struct dss_lcd_mgr_config *config,
  230. struct omap_overlay_info **overlay_infos);
  231. static inline bool dss_mgr_is_lcd(enum omap_channel id)
  232. {
  233. if (id == OMAP_DSS_CHANNEL_LCD || id == OMAP_DSS_CHANNEL_LCD2 ||
  234. id == OMAP_DSS_CHANNEL_LCD3)
  235. return true;
  236. else
  237. return false;
  238. }
  239. int dss_manager_kobj_init(struct omap_overlay_manager *mgr,
  240. struct platform_device *pdev);
  241. void dss_manager_kobj_uninit(struct omap_overlay_manager *mgr);
  242. /* overlay */
  243. void dss_init_overlays(struct platform_device *pdev);
  244. void dss_uninit_overlays(struct platform_device *pdev);
  245. void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr);
  246. int dss_ovl_simple_check(struct omap_overlay *ovl,
  247. const struct omap_overlay_info *info);
  248. int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
  249. const struct omap_video_timings *mgr_timings);
  250. bool dss_ovl_use_replication(struct dss_lcd_mgr_config config,
  251. enum omap_color_mode mode);
  252. int dss_overlay_kobj_init(struct omap_overlay *ovl,
  253. struct platform_device *pdev);
  254. void dss_overlay_kobj_uninit(struct omap_overlay *ovl);
  255. /* DSS */
  256. int dss_init_platform_driver(void) __init;
  257. void dss_uninit_platform_driver(void);
  258. int dss_dpi_select_source(enum omap_channel channel);
  259. void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
  260. enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
  261. const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
  262. void dss_dump_clocks(struct seq_file *s);
  263. #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
  264. void dss_debug_dump_clocks(struct seq_file *s);
  265. #endif
  266. void dss_sdi_init(int datapairs);
  267. int dss_sdi_enable(void);
  268. void dss_sdi_disable(void);
  269. void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src);
  270. void dss_select_dsi_clk_source(int dsi_module,
  271. enum omap_dss_clk_source clk_src);
  272. void dss_select_lcd_clk_source(enum omap_channel channel,
  273. enum omap_dss_clk_source clk_src);
  274. enum omap_dss_clk_source dss_get_dispc_clk_source(void);
  275. enum omap_dss_clk_source dss_get_dsi_clk_source(int dsi_module);
  276. enum omap_dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel);
  277. void dss_set_venc_output(enum omap_dss_venc_type type);
  278. void dss_set_dac_pwrdn_bgz(bool enable);
  279. unsigned long dss_get_dpll4_rate(void);
  280. int dss_set_clock_div(struct dss_clock_info *cinfo);
  281. int dss_calc_clock_div(unsigned long req_pck, struct dss_clock_info *dss_cinfo,
  282. struct dispc_clock_info *dispc_cinfo);
  283. /* SDI */
  284. int sdi_init_platform_driver(void) __init;
  285. void sdi_uninit_platform_driver(void) __exit;
  286. /* DSI */
  287. #ifdef CONFIG_OMAP2_DSS_DSI
  288. struct dentry;
  289. struct file_operations;
  290. int dsi_init_platform_driver(void) __init;
  291. void dsi_uninit_platform_driver(void) __exit;
  292. int dsi_runtime_get(struct platform_device *dsidev);
  293. void dsi_runtime_put(struct platform_device *dsidev);
  294. void dsi_dump_clocks(struct seq_file *s);
  295. void dsi_irq_handler(void);
  296. u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt);
  297. unsigned long dsi_get_pll_hsdiv_dispc_rate(struct platform_device *dsidev);
  298. int dsi_pll_set_clock_div(struct platform_device *dsidev,
  299. struct dsi_clock_info *cinfo);
  300. int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev,
  301. unsigned long req_pck, struct dsi_clock_info *cinfo,
  302. struct dispc_clock_info *dispc_cinfo);
  303. int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk,
  304. bool enable_hsdiv);
  305. void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes);
  306. void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev);
  307. void dsi_wait_pll_hsdiv_dsi_active(struct platform_device *dsidev);
  308. struct platform_device *dsi_get_dsidev_from_id(int module);
  309. #else
  310. static inline int dsi_runtime_get(struct platform_device *dsidev)
  311. {
  312. return 0;
  313. }
  314. static inline void dsi_runtime_put(struct platform_device *dsidev)
  315. {
  316. }
  317. static inline u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt)
  318. {
  319. WARN("%s: DSI not compiled in, returning pixel_size as 0\n", __func__);
  320. return 0;
  321. }
  322. static inline unsigned long dsi_get_pll_hsdiv_dispc_rate(struct platform_device *dsidev)
  323. {
  324. WARN("%s: DSI not compiled in, returning rate as 0\n", __func__);
  325. return 0;
  326. }
  327. static inline int dsi_pll_set_clock_div(struct platform_device *dsidev,
  328. struct dsi_clock_info *cinfo)
  329. {
  330. WARN("%s: DSI not compiled in\n", __func__);
  331. return -ENODEV;
  332. }
  333. static inline int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev,
  334. unsigned long req_pck,
  335. struct dsi_clock_info *dsi_cinfo,
  336. struct dispc_clock_info *dispc_cinfo)
  337. {
  338. WARN("%s: DSI not compiled in\n", __func__);
  339. return -ENODEV;
  340. }
  341. static inline int dsi_pll_init(struct platform_device *dsidev,
  342. bool enable_hsclk, bool enable_hsdiv)
  343. {
  344. WARN("%s: DSI not compiled in\n", __func__);
  345. return -ENODEV;
  346. }
  347. static inline void dsi_pll_uninit(struct platform_device *dsidev,
  348. bool disconnect_lanes)
  349. {
  350. }
  351. static inline void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev)
  352. {
  353. }
  354. static inline void dsi_wait_pll_hsdiv_dsi_active(struct platform_device *dsidev)
  355. {
  356. }
  357. static inline struct platform_device *dsi_get_dsidev_from_id(int module)
  358. {
  359. WARN("%s: DSI not compiled in, returning platform device as NULL\n",
  360. __func__);
  361. return NULL;
  362. }
  363. #endif
  364. /* DPI */
  365. int dpi_init_platform_driver(void) __init;
  366. void dpi_uninit_platform_driver(void) __exit;
  367. /* DISPC */
  368. int dispc_init_platform_driver(void) __init;
  369. void dispc_uninit_platform_driver(void) __exit;
  370. void dispc_dump_clocks(struct seq_file *s);
  371. void dispc_irq_handler(void);
  372. int dispc_runtime_get(void);
  373. void dispc_runtime_put(void);
  374. void dispc_enable_sidle(void);
  375. void dispc_disable_sidle(void);
  376. void dispc_lcd_enable_signal_polarity(bool act_high);
  377. void dispc_lcd_enable_signal(bool enable);
  378. void dispc_pck_free_enable(bool enable);
  379. void dispc_enable_fifomerge(bool enable);
  380. void dispc_enable_gamma_table(bool enable);
  381. void dispc_set_loadmode(enum omap_dss_load_mode mode);
  382. bool dispc_mgr_timings_ok(enum omap_channel channel,
  383. const struct omap_video_timings *timings);
  384. unsigned long dispc_fclk_rate(void);
  385. void dispc_find_clk_divs(unsigned long req_pck, unsigned long fck,
  386. struct dispc_clock_info *cinfo);
  387. int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
  388. struct dispc_clock_info *cinfo);
  389. void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
  390. void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
  391. u32 *fifo_low, u32 *fifo_high, bool use_fifomerge,
  392. bool manual_update);
  393. int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
  394. bool replication, const struct omap_video_timings *mgr_timings,
  395. bool mem_to_mem);
  396. int dispc_ovl_enable(enum omap_plane plane, bool enable);
  397. void dispc_ovl_set_channel_out(enum omap_plane plane,
  398. enum omap_channel channel);
  399. void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable);
  400. u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
  401. u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
  402. bool dispc_mgr_go_busy(enum omap_channel channel);
  403. void dispc_mgr_go(enum omap_channel channel);
  404. bool dispc_mgr_is_enabled(enum omap_channel channel);
  405. void dispc_mgr_enable(enum omap_channel channel, bool enable);
  406. bool dispc_mgr_is_channel_enabled(enum omap_channel channel);
  407. void dispc_mgr_set_io_pad_mode(enum dss_io_pad_mode mode);
  408. void dispc_mgr_enable_stallmode(enum omap_channel channel, bool enable);
  409. void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines);
  410. void dispc_mgr_set_lcd_type_tft(enum omap_channel channel);
  411. void dispc_mgr_set_timings(enum omap_channel channel,
  412. struct omap_video_timings *timings);
  413. unsigned long dispc_mgr_lclk_rate(enum omap_channel channel);
  414. unsigned long dispc_mgr_pclk_rate(enum omap_channel channel);
  415. unsigned long dispc_core_clk_rate(void);
  416. void dispc_mgr_set_clock_div(enum omap_channel channel,
  417. struct dispc_clock_info *cinfo);
  418. int dispc_mgr_get_clock_div(enum omap_channel channel,
  419. struct dispc_clock_info *cinfo);
  420. void dispc_mgr_setup(enum omap_channel channel,
  421. struct omap_overlay_manager_info *info);
  422. u32 dispc_wb_get_framedone_irq(void);
  423. bool dispc_wb_go_busy(void);
  424. void dispc_wb_go(void);
  425. void dispc_wb_enable(bool enable);
  426. bool dispc_wb_is_enabled(void);
  427. void dispc_wb_set_channel_in(enum dss_writeback_channel channel);
  428. int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
  429. bool mem_to_mem, const struct omap_video_timings *timings);
  430. /* VENC */
  431. #ifdef CONFIG_OMAP2_DSS_VENC
  432. int venc_init_platform_driver(void) __init;
  433. void venc_uninit_platform_driver(void) __exit;
  434. unsigned long venc_get_pixel_clock(void);
  435. #else
  436. static inline unsigned long venc_get_pixel_clock(void)
  437. {
  438. WARN("%s: VENC not compiled in, returning pclk as 0\n", __func__);
  439. return 0;
  440. }
  441. #endif
  442. int omapdss_venc_display_enable(struct omap_dss_device *dssdev);
  443. void omapdss_venc_display_disable(struct omap_dss_device *dssdev);
  444. void omapdss_venc_set_timings(struct omap_dss_device *dssdev,
  445. struct omap_video_timings *timings);
  446. int omapdss_venc_check_timings(struct omap_dss_device *dssdev,
  447. struct omap_video_timings *timings);
  448. u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev);
  449. int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss);
  450. void omapdss_venc_set_type(struct omap_dss_device *dssdev,
  451. enum omap_dss_venc_type type);
  452. void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev,
  453. bool invert_polarity);
  454. int venc_panel_init(void);
  455. void venc_panel_exit(void);
  456. /* HDMI */
  457. #ifdef CONFIG_OMAP4_DSS_HDMI
  458. int hdmi_init_platform_driver(void) __init;
  459. void hdmi_uninit_platform_driver(void) __exit;
  460. unsigned long hdmi_get_pixel_clock(void);
  461. #else
  462. static inline unsigned long hdmi_get_pixel_clock(void)
  463. {
  464. WARN("%s: HDMI not compiled in, returning pclk as 0\n", __func__);
  465. return 0;
  466. }
  467. #endif
  468. int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
  469. void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
  470. void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
  471. struct omap_video_timings *timings);
  472. int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
  473. struct omap_video_timings *timings);
  474. int omapdss_hdmi_read_edid(u8 *buf, int len);
  475. bool omapdss_hdmi_detect(void);
  476. int hdmi_panel_init(void);
  477. void hdmi_panel_exit(void);
  478. #ifdef CONFIG_OMAP4_DSS_HDMI_AUDIO
  479. int hdmi_audio_enable(void);
  480. void hdmi_audio_disable(void);
  481. int hdmi_audio_start(void);
  482. void hdmi_audio_stop(void);
  483. bool hdmi_mode_has_audio(void);
  484. int hdmi_audio_config(struct omap_dss_audio *audio);
  485. #endif
  486. /* RFBI */
  487. int rfbi_init_platform_driver(void) __init;
  488. void rfbi_uninit_platform_driver(void) __exit;
  489. #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
  490. static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr)
  491. {
  492. int b;
  493. for (b = 0; b < 32; ++b) {
  494. if (irqstatus & (1 << b))
  495. irq_arr[b]++;
  496. }
  497. }
  498. #endif
  499. #endif