vpss.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright (C) 2009 Texas Instruments Inc
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * vpss - video processing subsystem module header file.
  15. *
  16. * Include this header file if a driver needs to configure vpss system
  17. * module. It exports a set of library functions for video drivers to
  18. * configure vpss system module functions such as clock enable/disable,
  19. * vpss interrupt mux to arm, and other common vpss system module
  20. * functions.
  21. */
  22. #ifndef _VPSS_H
  23. #define _VPSS_H
  24. /* selector for ccdc input selection on DM355 */
  25. enum vpss_ccdc_source_sel {
  26. VPSS_CCDCIN,
  27. VPSS_HSSIIN,
  28. VPSS_PGLPBK, /* for DM365 only */
  29. VPSS_CCDCPG /* for DM365 only */
  30. };
  31. struct vpss_sync_pol {
  32. unsigned int ccdpg_hdpol:1;
  33. unsigned int ccdpg_vdpol:1;
  34. };
  35. struct vpss_pg_frame_size {
  36. short hlpfr;
  37. short pplen;
  38. };
  39. /* Used for enable/disable VPSS Clock */
  40. enum vpss_clock_sel {
  41. /* DM355/DM365 */
  42. VPSS_CCDC_CLOCK,
  43. VPSS_IPIPE_CLOCK,
  44. VPSS_H3A_CLOCK,
  45. VPSS_CFALD_CLOCK,
  46. /*
  47. * When using VPSS_VENC_CLOCK_SEL in vpss_enable_clock() api
  48. * following applies:-
  49. * en = 0 selects ENC_CLK
  50. * en = 1 selects ENC_CLK/2
  51. */
  52. VPSS_VENC_CLOCK_SEL,
  53. VPSS_VPBE_CLOCK,
  54. /* DM365 only clocks */
  55. VPSS_IPIPEIF_CLOCK,
  56. VPSS_RSZ_CLOCK,
  57. VPSS_BL_CLOCK,
  58. /*
  59. * When using VPSS_PCLK_INTERNAL in vpss_enable_clock() api
  60. * following applies:-
  61. * en = 0 disable internal PCLK
  62. * en = 1 enables internal PCLK
  63. */
  64. VPSS_PCLK_INTERNAL,
  65. /*
  66. * When using VPSS_PSYNC_CLOCK_SEL in vpss_enable_clock() api
  67. * following applies:-
  68. * en = 0 enables MMR clock
  69. * en = 1 enables VPSS clock
  70. */
  71. VPSS_PSYNC_CLOCK_SEL,
  72. VPSS_LDC_CLOCK_SEL,
  73. VPSS_OSD_CLOCK_SEL,
  74. VPSS_FDIF_CLOCK,
  75. VPSS_LDC_CLOCK
  76. };
  77. /* select input to ccdc on dm355 */
  78. int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel);
  79. /* enable/disable a vpss clock, 0 - success, -1 - failure */
  80. int vpss_enable_clock(enum vpss_clock_sel clock_sel, int en);
  81. /* set sync polarity, only for DM365*/
  82. void dm365_vpss_set_sync_pol(struct vpss_sync_pol);
  83. /* set the PG_FRAME_SIZE register, only for DM365 */
  84. void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size);
  85. /* wbl reset for dm644x */
  86. enum vpss_wbl_sel {
  87. VPSS_PCR_AEW_WBL_0 = 16,
  88. VPSS_PCR_AF_WBL_0,
  89. VPSS_PCR_RSZ4_WBL_0,
  90. VPSS_PCR_RSZ3_WBL_0,
  91. VPSS_PCR_RSZ2_WBL_0,
  92. VPSS_PCR_RSZ1_WBL_0,
  93. VPSS_PCR_PREV_WBL_0,
  94. VPSS_PCR_CCDC_WBL_O,
  95. };
  96. /* clear wbl overflow flag for DM6446 */
  97. int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel);
  98. /* set sync polarity*/
  99. void vpss_set_sync_pol(struct vpss_sync_pol sync);
  100. /* set the PG_FRAME_SIZE register */
  101. void vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size);
  102. /*
  103. * vpss_check_and_clear_interrupt - check and clear interrupt
  104. * @irq - common enumerator for IRQ
  105. *
  106. * Following return values used:-
  107. * 0 - interrupt occurred and cleared
  108. * 1 - interrupt not occurred
  109. * 2 - interrupt status not available
  110. */
  111. int vpss_dma_complete_interrupt(void);
  112. #endif