CK Hu | 119f517 | 2016-01-04 18:36:34 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 MediaTek Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef MTK_DRM_DRV_H |
| 15 | #define MTK_DRM_DRV_H |
| 16 | |
| 17 | #include <linux/io.h> |
| 18 | #include "mtk_drm_ddp_comp.h" |
| 19 | |
| 20 | #define MAX_CRTC 2 |
| 21 | #define MAX_CONNECTOR 2 |
| 22 | |
| 23 | struct device; |
| 24 | struct device_node; |
| 25 | struct drm_crtc; |
| 26 | struct drm_device; |
| 27 | struct drm_fb_helper; |
| 28 | struct drm_property; |
| 29 | struct regmap; |
| 30 | |
yt.shen@mediatek.com | c5f228e | 2017-03-31 19:30:30 +0800 | [diff] [blame] | 31 | struct mtk_mmsys_driver_data { |
| 32 | const enum mtk_ddp_comp_id *main_path; |
| 33 | unsigned int main_len; |
| 34 | const enum mtk_ddp_comp_id *ext_path; |
| 35 | unsigned int ext_len; |
yt.shen@mediatek.com | 9dc84e9 | 2017-03-31 19:30:31 +0800 | [diff] [blame] | 36 | bool shadow_register; |
yt.shen@mediatek.com | c5f228e | 2017-03-31 19:30:30 +0800 | [diff] [blame] | 37 | }; |
| 38 | |
CK Hu | 119f517 | 2016-01-04 18:36:34 +0100 | [diff] [blame] | 39 | struct mtk_drm_private { |
| 40 | struct drm_device *drm; |
| 41 | struct device *dma_dev; |
| 42 | |
CK Hu | 119f517 | 2016-01-04 18:36:34 +0100 | [diff] [blame] | 43 | unsigned int num_pipes; |
| 44 | |
| 45 | struct device_node *mutex_node; |
| 46 | struct device *mutex_dev; |
| 47 | void __iomem *config_regs; |
| 48 | struct device_node *comp_node[DDP_COMPONENT_ID_MAX]; |
| 49 | struct mtk_ddp_comp *ddp_comp[DDP_COMPONENT_ID_MAX]; |
yt.shen@mediatek.com | c5f228e | 2017-03-31 19:30:30 +0800 | [diff] [blame] | 50 | const struct mtk_mmsys_driver_data *data; |
CK Hu | 119f517 | 2016-01-04 18:36:34 +0100 | [diff] [blame] | 51 | |
| 52 | struct { |
| 53 | struct drm_atomic_state *state; |
| 54 | struct work_struct work; |
| 55 | struct mutex lock; |
| 56 | } commit; |
| 57 | |
| 58 | struct drm_atomic_state *suspend_state; |
| 59 | }; |
| 60 | |
| 61 | extern struct platform_driver mtk_ddp_driver; |
yt.shen@mediatek.com | 5ac5895 | 2017-06-16 22:02:16 +0800 | [diff] [blame] | 62 | extern struct platform_driver mtk_disp_color_driver; |
CK Hu | 119f517 | 2016-01-04 18:36:34 +0100 | [diff] [blame] | 63 | extern struct platform_driver mtk_disp_ovl_driver; |
| 64 | extern struct platform_driver mtk_disp_rdma_driver; |
Jie Qiu | 9e629c1 | 2016-01-04 18:36:36 +0100 | [diff] [blame] | 65 | extern struct platform_driver mtk_dpi_driver; |
CK Hu | 2e54c14 | 2016-01-04 18:36:35 +0100 | [diff] [blame] | 66 | extern struct platform_driver mtk_dsi_driver; |
| 67 | extern struct platform_driver mtk_mipi_tx_driver; |
CK Hu | 119f517 | 2016-01-04 18:36:34 +0100 | [diff] [blame] | 68 | |
| 69 | #endif /* MTK_DRM_DRV_H */ |