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 15 struct device; 16 struct device_node; 17 struct drm_crtc; 18 struct drm_device; 19 struct drm_fb_helper; 20 struct drm_property; 21 struct regmap; 22 23 struct mtk_mmsys_driver_data { 24 const resource_size_t io_start; 25 const enum mtk_ddp_comp_id *main_path; 26 unsigned int main_len; 27 const enum mtk_ddp_comp_id *ext_path; 28 unsigned int ext_len; 29 const enum mtk_ddp_comp_id *third_path; 30 unsigned int third_len; 31 32 bool shadow_register; 33 }; 34 35 struct mtk_mmsys_match_data { 36 unsigned short num_drv_data; 37 const struct mtk_mmsys_driver_data *drv_data[]; 38 }; 39 40 struct mtk_drm_private { 41 struct drm_device *drm; 42 struct device *dma_dev; 43 44 unsigned int num_pipes; 45 46 struct device_node *mutex_node; 47 struct device *mutex_dev; 48 struct device *mmsys_dev; 49 struct device_node *comp_node[DDP_COMPONENT_ID_MAX]; 50 struct mtk_ddp_comp ddp_comp[DDP_COMPONENT_ID_MAX]; 51 const struct mtk_mmsys_driver_data *data; 52 struct drm_atomic_state *suspend_state; 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_driver; 61 extern struct platform_driver mtk_disp_rdma_driver; 62 extern struct platform_driver mtk_dpi_driver; 63 extern struct platform_driver mtk_dsi_driver; 64 extern struct platform_driver mtk_mdp_rdma_driver; 65 66 #endif /* MTK_DRM_DRV_H */ 67