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