xref: /linux/drivers/gpu/drm/mxsfb/mxsfb_drv.h (revision ae1ed0093281939b80664a687689f12436c0e874)
1c942fddfSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
245d59d70SMarek Vasut /*
345d59d70SMarek Vasut  * Copyright (C) 2016 Marek Vasut <marex@denx.de>
445d59d70SMarek Vasut  *
545d59d70SMarek Vasut  * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver.
645d59d70SMarek Vasut  */
745d59d70SMarek Vasut 
845d59d70SMarek Vasut #ifndef __MXSFB_DRV_H__
945d59d70SMarek Vasut #define __MXSFB_DRV_H__
1045d59d70SMarek Vasut 
11*ae1ed009SLaurent Pinchart #include <drm/drm_crtc.h>
12*ae1ed009SLaurent Pinchart #include <drm/drm_device.h>
13*ae1ed009SLaurent Pinchart #include <drm/drm_encoder.h>
14*ae1ed009SLaurent Pinchart #include <drm/drm_plane.h>
15*ae1ed009SLaurent Pinchart 
16*ae1ed009SLaurent Pinchart struct clk;
17c42001e3SLaurent Pinchart 
1845d59d70SMarek Vasut struct mxsfb_devdata {
1945d59d70SMarek Vasut 	unsigned int	 transfer_count;
2045d59d70SMarek Vasut 	unsigned int	 cur_buf;
2145d59d70SMarek Vasut 	unsigned int	 next_buf;
2245d59d70SMarek Vasut 	unsigned int	 debug0;
2345d59d70SMarek Vasut 	unsigned int	 hs_wdth_mask;
2445d59d70SMarek Vasut 	unsigned int	 hs_wdth_shift;
2545d59d70SMarek Vasut 	unsigned int	 ipversion;
2645d59d70SMarek Vasut };
2745d59d70SMarek Vasut 
2845d59d70SMarek Vasut struct mxsfb_drm_private {
2945d59d70SMarek Vasut 	const struct mxsfb_devdata	*devdata;
3045d59d70SMarek Vasut 
3145d59d70SMarek Vasut 	void __iomem			*base;	/* registers */
3245d59d70SMarek Vasut 	struct clk			*clk;
3345d59d70SMarek Vasut 	struct clk			*clk_axi;
3445d59d70SMarek Vasut 	struct clk			*clk_disp_axi;
3545d59d70SMarek Vasut 
36c42001e3SLaurent Pinchart 	struct drm_device		*drm;
37*ae1ed009SLaurent Pinchart 	struct drm_plane		plane;
38*ae1ed009SLaurent Pinchart 	struct drm_crtc			crtc;
39*ae1ed009SLaurent Pinchart 	struct drm_encoder		encoder;
40d0234043SRobert Chiras 	struct drm_connector		*connector;
41d0234043SRobert Chiras 	struct drm_bridge		*bridge;
4245d59d70SMarek Vasut };
4345d59d70SMarek Vasut 
44*ae1ed009SLaurent Pinchart static inline struct mxsfb_drm_private *
45*ae1ed009SLaurent Pinchart to_mxsfb_drm_private(struct drm_device *drm)
46*ae1ed009SLaurent Pinchart {
47*ae1ed009SLaurent Pinchart 	return drm->dev_private;
48*ae1ed009SLaurent Pinchart }
4945d59d70SMarek Vasut 
5045d59d70SMarek Vasut void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
5145d59d70SMarek Vasut void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
5245d59d70SMarek Vasut 
53*ae1ed009SLaurent Pinchart int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb);
5445d59d70SMarek Vasut 
5545d59d70SMarek Vasut #endif /* __MXSFB_DRV_H__ */
56