1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2015 MediaTek Inc.
4  */
5 
6 #ifndef MTK_DRM_DRV_H
7 #define MTK_DRM_DRV_H
8 
9 #include <linux/io.h>
10 #include "mtk_drm_ddp_comp.h"
11 
12 #define MAX_CRTC	3
13 #define MAX_CONNECTOR	2
14 #define DDP_COMPONENT_DRM_OVL_ADAPTOR (DDP_COMPONENT_ID_MAX + 1)
15 #define DDP_COMPONENT_DRM_ID_MAX (DDP_COMPONENT_DRM_OVL_ADAPTOR + 1)
16 
17 struct device;
18 struct device_node;
19 struct drm_crtc;
20 struct drm_device;
21 struct drm_fb_helper;
22 struct drm_property;
23 struct regmap;
24 
25 struct mtk_mmsys_driver_data {
26 	const unsigned int *main_path;
27 	unsigned int main_len;
28 	const unsigned int *ext_path;
29 	unsigned int ext_len;
30 	const unsigned int *third_path;
31 	unsigned int third_len;
32 
33 	bool shadow_register;
34 	unsigned int mmsys_id;
35 	unsigned int mmsys_dev_num;
36 };
37 
38 struct mtk_drm_private {
39 	struct drm_device *drm;
40 	struct device *dma_dev;
41 	bool mtk_drm_bound;
42 	bool drm_master;
43 	struct device *dev;
44 	struct device_node *mutex_node;
45 	struct device *mutex_dev;
46 	struct device *mmsys_dev;
47 	struct device_node *comp_node[DDP_COMPONENT_DRM_ID_MAX];
48 	struct mtk_ddp_comp ddp_comp[DDP_COMPONENT_DRM_ID_MAX];
49 	const struct mtk_mmsys_driver_data *data;
50 	struct drm_atomic_state *suspend_state;
51 	unsigned int mbox_index;
52 	struct mtk_drm_private **all_drm_private;
53 };
54 
55 extern struct platform_driver mtk_disp_aal_driver;
56 extern struct platform_driver mtk_disp_ccorr_driver;
57 extern struct platform_driver mtk_disp_color_driver;
58 extern struct platform_driver mtk_disp_gamma_driver;
59 extern struct platform_driver mtk_disp_merge_driver;
60 extern struct platform_driver mtk_disp_ovl_adaptor_driver;
61 extern struct platform_driver mtk_disp_ovl_driver;
62 extern struct platform_driver mtk_disp_rdma_driver;
63 extern struct platform_driver mtk_dpi_driver;
64 extern struct platform_driver mtk_dsi_driver;
65 extern struct platform_driver mtk_ethdr_driver;
66 extern struct platform_driver mtk_mdp_rdma_driver;
67 
68 #endif /* MTK_DRM_DRV_H */
69