xref: /openbmc/linux/drivers/gpu/drm/mxsfb/lcdif_drv.h (revision 9a29f5fc)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2022 Marek Vasut <marex@denx.de>
4  *
5  * i.MX8MP/i.MXRT LCDIFv3 LCD controller driver.
6  */
7 
8 #ifndef __LCDIF_DRV_H__
9 #define __LCDIF_DRV_H__
10 
11 #include <drm/drm_bridge.h>
12 #include <drm/drm_crtc.h>
13 #include <drm/drm_device.h>
14 #include <drm/drm_encoder.h>
15 #include <drm/drm_plane.h>
16 
17 struct clk;
18 
19 struct lcdif_drm_private {
20 	void __iomem			*base;	/* registers */
21 	struct clk			*clk;
22 	struct clk			*clk_axi;
23 	struct clk			*clk_disp_axi;
24 
25 	unsigned int			irq;
26 
27 	struct drm_device		*drm;
28 	struct {
29 		struct drm_plane	primary;
30 		/* i.MXRT does support overlay planes, add them here. */
31 	} planes;
32 	struct drm_crtc			crtc;
33 	struct drm_encoder		encoder;
34 	struct drm_bridge		*bridge;
35 };
36 
37 static inline struct lcdif_drm_private *
38 to_lcdif_drm_private(struct drm_device *drm)
39 {
40 	return drm->dev_private;
41 }
42 
43 int lcdif_kms_init(struct lcdif_drm_private *lcdif);
44 
45 #endif /* __LCDIF_DRV_H__ */
46