xref: /openbmc/linux/drivers/gpu/drm/mxsfb/lcdif_drv.h (revision 5769b45a)
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_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 };
33 
34 static inline struct lcdif_drm_private *
35 to_lcdif_drm_private(struct drm_device *drm)
36 {
37 	return drm->dev_private;
38 }
39 
40 int lcdif_kms_init(struct lcdif_drm_private *lcdif);
41 
42 #endif /* __LCDIF_DRV_H__ */
43