1 /*
2 * Copyright (c) Texas Instruments Incorporated 2018
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
34 /**
35 * \defgroup DRV_DSS_MODULE DSS Driver
36 *
37 * @{
38 *
39 * The Display Subsystem (DSS) provides the logic to interface display
40 * peripherals. This is DSS FVID2 driver documentation.
41 */
42 /* @} */
44 /**
45 * \ingroup DRV_DSS_MODULE
46 * \defgroup DSS_TOP_LEVEL DSS Driver Header
47 * This is DSS's top level include for applications
48 *
49 * @{
50 */
52 /**
53 * \file dss.h
54 *
55 * \brief DSS Driver API/interface file.
56 */
58 #ifndef DSS_H_
59 #define DSS_H_
61 /* ========================================================================== */
62 /* Include Files */
63 /* ========================================================================== */
65 #include <stdint.h>
66 #include <ti/csl/soc.h>
67 #include <ti/csl/csl_dss.h>
68 #include <ti/drv/fvid2/fvid2.h>
69 #include <ti/drv/dss/include/dss_cfg.h>
70 #include <ti/drv/dss/soc/dss_soc.h>
71 #include <ti/drv/dss/include/dss_disp.h>
72 #include <ti/drv/dss/include/dss_dctrl.h>
73 #if defined (SOC_J721E)
74 #include <ti/drv/dss/include/dss_m2m.h>
75 #endif
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
82 /* ========================================================================== */
83 /* Macros & Typedefs */
84 /* ========================================================================== */
86 /** \brief Display driver ID used at the time of FVID2 create. */
87 #define DSS_DISP_DRV_ID (FVID2_DSS_DRV_BASE + 0x00U)
89 /** \brief Display controller driver ID used at the time of FVID2 create. */
90 #define DSS_DCTRL_DRV_ID (FVID2_DSS_DRV_BASE + 0x01U)
92 #if defined (SOC_J721E)
93 /** \brief Display M2M driver ID used at the time of FVID2 create. */
94 #define DSS_M2M_DRV_ID (FVID2_DSS_DRV_BASE + 0x02U)
95 #endif
97 /*
98 * IOCTLs Base address.
99 */
100 /** \brief IOCTL base address for the display driver IOCTLs. */
101 #define DSS_DISP_IOCTL_BASE (FVID2_DSS_DRV_IOCTL_BASE + 0x000U)
102 /** \brief IOCTL base address for the display controller driver IOCTLs. */
103 #define DSS_DCTRL_IOCTL_BASE (FVID2_DSS_DRV_IOCTL_BASE + 0x100U)
104 /** \brief IOCTL base address for the SOC specific display driver IOCTLs. */
105 #define DSS_DISP_SOC_IOCTL_BASE (DSS_DISP_IOCTL_BASE + 0x40U)
106 /** \brief IOCTL base address for the SOC specific display controller driver
107 * IOCTLs. */
108 #define DSS_DCTRL_SOC_IOCTL_BASE (DSS_DCTRL_IOCTL_BASE + 0x40U)
109 #if defined (SOC_J721E)
110 /** \brief IOCTL base address for the Display M2M Driver IOCTLs. */
111 #define DSS_M2M_IOCTL_BASE (FVID2_DSS_DRV_IOCTL_BASE + 0x200U)
112 #endif
113 /* ========================================================================== */
114 /* Structure Declarations */
115 /* ========================================================================== */
117 /**
118 * \brief DSS initialization parameters.
119 */
120 typedef struct
121 {
122 Dss_SocParams socParams;
123 /**< SoC parameters. Refer #Dss_SocParams for details */
124 } Dss_InitParams;
126 /* ========================================================================== */
127 /* Internal/Private Function Declarations */
128 /* ========================================================================== */
130 /* None */
132 /* ========================================================================== */
133 /* Function Declarations */
134 /* ========================================================================== */
136 /**
137 * \brief Dss_InitParams structure init function.
138 *
139 * \param dssParams Pointer to #Dss_InitParams structure.
140 *
141 * \return None
142 */
143 void Dss_initParamsInit(Dss_InitParams *dssParams);
145 /**
146 * \brief DSS initialization function.
147 * This function initializes the DSS hardware and drivers.
148 * This function should be called before calling any driver APIs and
149 * only once.
150 *
151 * \param initParams Pointer to a #Dss_InitParams structure
152 * containing the DSS configuration
153 *
154 * \return FVID2_SOK if successful, else suitable error code
155 */
156 int32_t Dss_init(const Dss_InitParams *initParams);
158 /**
159 * \brief DSS de-initialization function.
160 * This function un-initializes the DSS hardware and drivers.
161 * This function should be called during system shutdown if Dss_init()
162 * was called by the application.
163 *
164 * \return FVID2_SOK if successful, else suitable error code
165 */
166 int32_t Dss_deInit(void);
168 /* ========================================================================== */
169 /* Static Function Definitions */
170 /* ========================================================================== */
172 /* None */
174 #ifdef __cplusplus
175 }
176 #endif
178 #endif /* #ifndef DSS_H_ */
180 /* @} */