xref: /linux/drivers/gpu/drm/mcde/mcde_drm.h (revision 07c7b547a79605f1041d55b84d91a4a4d9c5b363)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2018 Linus Walleij <linus.walleij@linaro.org>
4  * Parts of this file were based on the MCDE driver by Marcus Lorentzon
5  * (C) ST-Ericsson SA 2013
6  */
7 #include <drm/drm_simple_kms_helper.h>
8 
9 #ifndef _MCDE_DRM_H_
10 #define _MCDE_DRM_H_
11 
12 struct mcde {
13 	struct drm_device drm;
14 	struct device *dev;
15 	struct drm_panel *panel;
16 	struct drm_bridge *bridge;
17 	struct drm_connector *connector;
18 	struct drm_simple_display_pipe pipe;
19 	struct mipi_dsi_device *mdsi;
20 	s16 stride;
21 	bool te_sync;
22 	bool video_mode;
23 	bool oneshot_mode;
24 	unsigned int flow_active;
25 	spinlock_t flow_lock; /* Locks the channel flow control */
26 
27 	void __iomem *regs;
28 
29 	struct clk *mcde_clk;
30 	struct clk *lcd_clk;
31 	struct clk *hdmi_clk;
32 
33 	struct regulator *epod;
34 	struct regulator *vana;
35 };
36 
37 #define to_mcde(dev) container_of(dev, struct mcde, drm)
38 
39 bool mcde_dsi_irq(struct mipi_dsi_device *mdsi);
40 void mcde_dsi_te_request(struct mipi_dsi_device *mdsi);
41 extern struct platform_driver mcde_dsi_driver;
42 
43 void mcde_display_irq(struct mcde *mcde);
44 void mcde_display_disable_irqs(struct mcde *mcde);
45 int mcde_display_init(struct drm_device *drm);
46 
47 #endif /* _MCDE_DRM_H_ */
48