vpss.h 2.8 KB

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