xref: /openbmc/linux/drivers/gpu/drm/mxsfb/lcdif_drv.h (revision 2a9eb57e)
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_crtc.h>
12 #include <drm/drm_device.h>
13 #include <drm/drm_encoder.h>
14 #include <drm/drm_plane.h>
15 
16 struct clk;
17 
18 struct lcdif_drm_private {
19 	void __iomem			*base;	/* registers */
20 	struct clk			*clk;
21 	struct clk			*clk_axi;
22 	struct clk			*clk_disp_axi;
23 
24 	unsigned int			irq;
25 
26 	struct drm_device		*drm;
27 	struct {
28 		struct drm_plane	primary;
29 		/* i.MXRT does support overlay planes, add them here. */
30 	} planes;
31 	struct drm_crtc			crtc;
32 	struct drm_encoder		encoder;
33 	struct drm_bridge		*bridge;
34 };
35 
36 static inline struct lcdif_drm_private *
37 to_lcdif_drm_private(struct drm_device *drm)
38 {
39 	return drm->dev_private;
40 }
41 
42 int lcdif_kms_init(struct lcdif_drm_private *lcdif);
43 
44 #endif /* __LCDIF_DRV_H__ */
45