1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2009 Texas Instruments Inc
5 * vpss - video processing subsystem module header file.
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
16 /* selector for ccdc input selection on DM355 */
17 enum vpss_ccdc_source_sel {
20 VPSS_PGLPBK, /* for DM365 only */
21 VPSS_CCDCPG /* for DM365 only */
24 struct vpss_sync_pol {
25 unsigned int ccdpg_hdpol:1;
26 unsigned int ccdpg_vdpol:1;
29 struct vpss_pg_frame_size {
34 /* Used for enable/disable VPSS Clock */
42 * When using VPSS_VENC_CLOCK_SEL in vpss_enable_clock() api
44 * en = 0 selects ENC_CLK
45 * en = 1 selects ENC_CLK/2
49 /* DM365 only clocks */
54 * When using VPSS_PCLK_INTERNAL in vpss_enable_clock() api
56 * en = 0 disable internal PCLK
57 * en = 1 enables internal PCLK
61 * When using VPSS_PSYNC_CLOCK_SEL in vpss_enable_clock() api
63 * en = 0 enables MMR clock
64 * en = 1 enables VPSS clock
73 /* select input to ccdc on dm355 */
74 int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel);
75 /* enable/disable a vpss clock, 0 - success, -1 - failure */
76 int vpss_enable_clock(enum vpss_clock_sel clock_sel, int en);
77 /* set sync polarity, only for DM365*/
78 void dm365_vpss_set_sync_pol(struct vpss_sync_pol);
79 /* set the PG_FRAME_SIZE register, only for DM365 */
80 void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size);
82 /* wbl reset for dm644x */
84 VPSS_PCR_AEW_WBL_0 = 16,
93 /* clear wbl overflow flag for DM6446 */
94 int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel);
96 /* set sync polarity*/
97 void vpss_set_sync_pol(struct vpss_sync_pol sync);
98 /* set the PG_FRAME_SIZE register */
99 void vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size);
101 * vpss_check_and_clear_interrupt - check and clear interrupt
102 * @irq - common enumerator for IRQ
104 * Following return values used:-
105 * 0 - interrupt occurred and cleared
106 * 1 - interrupt not occurred
107 * 2 - interrupt status not available
109 int vpss_dma_complete_interrupt(void);